This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Dinhibit_libc
- To: aph at redhat dot com (Andrew Haley)
- Subject: Re: -Dinhibit_libc
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 07 Mar 2001 12:13:46 -0800
- CC: gcc at gcc dot gnu dot org
- References: <15014.28840.359194.506099.cygnus.gcc@viagra.cambridge.redhat.com>
aph@redhat.com (Andrew Haley) writes:
> I'm building a cross compiler for a new Linux target.
>
> To begin with I have no glibc. (How could I? I haven't a compiler to
> build it with.) So, to start with I nee compiler. I build gcc for my
> target with `inhibit_libc' defined, because otherwise libgcc will fail
> to link.
>
> Then I build glibc with the compiler I just built. No problem, so I
> install that.
>
> Now here's the problem: I then build the toolchain with glibc and its
> headers in place, so this time I want to build libgcc with
> `inhibit_libc' undefined. As far as I can see, `inhibit_libc' is
> usually controlled by the target triplet, but I need to turn it on the
> first time gcc is built and off the second time; the target triplet
> doesn't change.
>
> What is the right way to do this?
Don't do it that way. Start with a temporary set of headers. It
turns out that you can start with a set of _empty_ headers and
everything will still build OK, which probably represents a bug
somewhere---there are lots of bugs in this area because no-one has
really looked at it.
Note that since glibc depends on libgcc, if you do it the way you did
it you need to go through the loop again: after building glibc, you
need to get headers from it, rebuild gcc, and then rebuild glibc.
--
- Geoffrey Keating <geoffk@geoffk.org>