libstdc++.a and PIC

Michael Heissmeier michael63@gmx.net
Wed Apr 12 20:05:00 GMT 2006


We produce shared libraries which are used on different computers than those
which they were produced on. In order to minimize dependencies and to avoid
trouble with users' settings of LD_LIBRARY_PATH we prefer to link those shared
libraries against static libraries wherever possible.

I would thus like to configure gcc with "--disable-shared" in order to avoid
referencing libstdc++.so. Linking static libraries into shared libraries
requires that those static libraries were compiled with -fPIC, at least under
Solaris and the x86_64 Opteron architecture.

Is there a way to use "--disable-shared" and get libstdc++.a compiled using
"-fPIC"? So far my attempts were unsuccessful for gcc 4.0.3 and 4.1.0.


Thank you for any suggestions

Michael Heissmeier



More information about the Gcc-help mailing list