g++/GNU ld/position independent libraries

Jason Merrill jason@redhat.com
Fri Jan 18 05:59:00 GMT 2002


>>>>> "Wheeler," == Wheeler, Fred (CRD) <wheeler@crd.ge.com> writes:

> To get right to the point -- If it is truly the case that one should not use GNU ld in Solaris when
> making relocatable libraries then I hope somebody active in the GCC/binutils projects can add
> warnings to the documentation or configure processes so that others can avoid this problem.

> Over the past several days I have gone through a great deal of trouble to figure out why suddenly all
> programs in a big project (VXL) build crashed with a bus error on Solaris 2.7 and 2.8 immediately
> upon execution.  My build system (CMake) recently switched me from -Wl,-G to -shared -nostdlib for
> shared libs, which started to the problem.

GCC shared libraries should always be built with gcc -shared.  -nostdlib is
wrong.

I haven't heard about problems with Solaris shared libraries and GNU ld,
though that doesn't mean there aren't any.  You really want to use GNU as
and ld for C++ if at all possible, so that duplicate template
instantiations, vtables and such get discarded.

Jason



More information about the Gcc mailing list