This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] BZ #13679: Use static link by default for --disable-shared


On Wed, 5 Sep 2012, H.J. Lu wrote:

> This patch restores --disable-shared support.  It uses static link
> by default if --disable-shared is used.  It also adds -lgcc_eh to
> static-gnulib since -lgcc_eh is needed in some glibc executables. Tested
> on Linux/x86-64.  OK to install?

static-gnulib cannot use -lgcc_eh if bootstraps are to work properly with 
a bootstrap compiler with static libgcc only (so no libgcc_eh).  
"Properly" means the binaries are the same as you get if you build with a 
compiler with shared libgcc (that itself was linked with a previous libc 
build), so far as they are the same when you build twice with identical 
compilers - note that for this you need two of my patches that went in to 
GCC 4.8.

I don't know whether that's feasible for the static-only case or whether 
some programs (that would normally be linked with shared libc) need real 
exception handling support that may not be available with a bootstrap 
compiler.  If the former, linking static-stubs.o into more binaries (when 
they are linked statically) may help.  If the latter, conditioning the 
-lgcc_eh support on --disable-shared would at least avoid regressing the 
bootstrap situation.

Note that pthreads being broken for static linking is bug 5784.  My 
preferred solution for that is using ld -r to build libpthread.a with a 
single .o file in it, as suggested in that bug.

-- 
Joseph S. Myers
joseph@codesourcery.com


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