On Wed, 9 Nov 2011, Linas Vepstas wrote:

> I've run into a bootstrapping issue which I'd like to solve
> "the right way", instead of continuing to hack around it.
> 
> Briefly: I can't build glibc without libgcc_eh.a, which is
> provided by gcc. However, libgcc_eh.a is not built, unless
> I configure gcc with --enable-shared. But doing so causes
> gcc to attempt to build libgcc_s.so, which fails because it
> wants to link to libc.so, which hasn't been built yet.  And
> so it goes....
The usual approach involves building three compilers and configuring glibc 
twice.

http://www.eglibc.org/cgi-bin/viewvc.cgi/trunk/libc/EGLIBC.cross-building?revision=2037

NB this involves EGLIBC features not in FSF glibc to make bootstrapping 
easier.  For FSF glibc you may need to use a config.cache with

libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes

in it (both times you configure glibc), for the initial headers 
installation install bits/stdio_lim.h manually and also create gnu/stubs.h 
manually.

It would be good to be able to configure GCC just once, build the 
compilers just once and have separate targets to configure/build/install 
the initial version of libgcc (before target headers and libc.so are 
available) and then the full set of target libraries (one install would 
install compilers and minimal libraries, later install would replace them 
with the final builds of the libraries).  I'm not sure if the toplevel 
libgcc transition (a prerequisite of such a feature) is now far enough 
along for that, but an obvious complication would be the various cases 
where the compiler's configure script looks into the sysroot's headers to 
determine how to configure the compiler; you'd need to make sure all the 
defaults are right for new glibc.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to