Would it be possible to turn libgcc_s.so into a linker script that links
against libgcc.a and libgcc_s.so.1, and teach g++ not to link against
libgcc.a explicitly anymore?

I'm suggesting this because libtool uses -nostdlib when linking shared
objects in C++ mode, and does not link against -lgcc, only -lgcc_s.
This causes subtle problems if GCC generates code that actually needs
libgcc.a, particularly if the main program uses the same symbols and
gets the hidden definitions from libgcc.a.

As far as I can tell, previous attempts to dissuade libtool from using
-nostdlib have failed.  It is also difficult to change libtool as it is
deployed in package sources.  It seems to me that the GCC workaround
could be rolled out quite seamlessly.

Thanks,
Florian

Reply via email to