Building IA-64 gcc breaks
Daniel Jacobowitz
drow@mvista.com
Fri May 9 04:59:00 GMT 2003
On Thu, May 08, 2003 at 05:17:16PM -0700, Janis Johnson wrote:
> On Thu, May 08, 2003 at 04:29:00PM -0400, Jim Wilson wrote:
> > navin wrote:
> > > ../../gcc-3.2/gcc/config/ia64/fde-glibc.c:42:3: #error You need GLIBC
> > > 2.2.4 or later on IA-64 Linux
> >
> > You need a newer copy of glibc. The one you have is too old to work
> > with gcc 3.x.
> >
> > > 2)I saw on the posts that we could do that same by doing gcc and glibc in
> > > parallel.
> >
> > This is a general linux cross compiler problem, not an IA-64 problem.
> > We have instructions on how to build a cross compiler to an embedded
> > target that uses newlib, but we have no documented process for building
> > a cross compiler to a linux target that uses glibc if you don't already
> > have access to such a system. I don't know how to do this offhand. I
> > believe it is considerably more complicated than an embedded cross. You
> > could ask for general help on doing gcc/glibc cross builds for linux,
> > and avoid mentioning IA-64 since that might confuse people who don't do
> > IA-64 work.
> >
> > Jim
> >
>
> Someone was asking me about this recently, and here's what I learned.
>
> Normally, to build a cross toolchain from scratch you do the following:
>
> 1. Build binutils.
> 2. Build a minimal C cross compiler (no support for shared libraries,
> threads, or anything else that requires help from glibc).
> [3. Build the Linux kernel?]
> 4. Build cross glibc.
> 5. Build fully-function cross compilers.
>
> The second step doesn't work for IA-64 because there are assumptions
> that glibc is available. This patch allows it to work; it's followed by
> a script to get through steps 1 and 2. I haven't tried the other steps
> for ia64-linux. Building glibc requires having Linux sources available,
> and perhaps even doing a kernel build first.
I've been meaning to fix the process for glibc so that the way I do
this is somewhat simpler, but I never get around to it...
There's a problem with your patch: you may need in some cases to do:
6. Rebuild glibc
because code from libgcc may end up exported by glibc or used in the
applications built at the same time. Here's a better way to do it.
1. Build binutils
2. Install glibc's headers, using make install_headers. This
currently requires a bit of additional hand-holding and
configure-fooling.
3. Build a minimal C cross compiler; it will be slightly less minimal,
because it will include unwinding et cetera.
4. Build glibc.
5. Build real cross compilers.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Gcc-bugs
mailing list