This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -Dinhibit_libc


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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]