When linking C++ programs (i.e. invoking g++), libstdc++ and libgcc_s are linked dynamically, even when -static-libgcc is given as an option. This causes the linked programs to crash or hang on systems using different versions of g++, or simply if my path happens to be set to a different version of g++. (I suspect the reason here is that I am using -D_GLIBCXX_DEBUG, etc., and that the older versions of the library didn't support this.)
What I think I need here is to link libstdc++, so I can be independant of the LD_LIBRARY_PATH and the version of the installed g++ libraries on the target machine, but to link libc dynamically, so that the executable will run on different versions of Solaris. My impression from the documentation was that -static-libgcc should do this. -- Summary: Option -static-libgcc doesn't work Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: driver AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jkanze at cheuvreux dot com GCC build triplet: sparc-sun-solaris2..8 GCC host triplet: sparc-sun-solaris2..8 GCC target triplet: sparc-sun-solaris2..8 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27276