This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++/GNU ld/position independent libraries
- From: Jason Merrill <jason at redhat dot com>
- To: "Wheeler, Fred (CRD)" <wheeler at crd dot ge dot com>
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>, "'bug-binutils at gnu dot org'" <bug-binutils at gnu dot org>, "'Brad King'" <brad dot king at kitware dot com>, "'Bill Hoffman'" <bill dot hoffman at kitware dot com>
- Date: Fri, 18 Jan 2002 10:47:38 +0000
- Subject: Re: g++/GNU ld/position independent libraries
- References: <E4AAC34FE3CF564D8AE89EB8AC333FD702FE05C4@XMB03CRDGE>
>>>>> "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