Multiple GCC versions and libstdc++.so

Ian Lance Taylor iant@google.com
Tue Oct 26 08:34:00 GMT 2010


"Richard Sewards" <richard.sewards@exfo.com> writes:

> Is it not possible to make libstdc++ and libgcc_s static, somewhat
> equivalent to the crtX.o objects linked prior to main, and still support
> the exception stuff across libraries?

On GNU/Linux, it is.  You can link with the -static-libgcc and
-static-libstdc++ options (the latter is new in gcc 4.5) and everything
should work.  I'm not aware of any non-GNU/Linux systems for which this
will work reliably.  It requires a linker which support --eh-frame-hdr
and a libc which supports dl_iterate_phdr.  A few more notes at
http://www.airs.com/blog/archives/166 .

Ian



More information about the Gcc-help mailing list