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: "William A. Hoffman" <bill dot hoffman at kitware dot com>
- Cc: "Wheeler, Fred (CRD)" <wheeler at crd dot ge dot com>, "'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>
- Date: Fri, 18 Jan 2002 12:39:31 +0000
- Subject: Re: g++/GNU ld/position independent libraries
- References: <E4AAC34FE3CF564D8AE89EB8AC333FD702FE05C4@XMB03CRDGE><E4AAC34FE3CF564D8AE89EB8AC333FD702FE05C4@XMB03CRDGE><5.0.2.1.0.20020118063810.02cca868@pop.nycap.rr.com>
>>>>> "William" == William A Hoffman <bill.hoffman@kitware.com> writes:
> At 10:47 AM 1/18/2002 +0000, Jason Merrill wrote:
>> GCC shared libraries should always be built with gcc -shared. -nostdlib is
>> wrong.
> OK, I'll bite, how should they be built? I guess you would have to figure
> out if the libstdc++ was built shared or
> not then add or remove the -nostdlib? If libstdc++ is built static then
> you have to have the -nostdlib.
Why? The gcc driver doesn't link against libstdc++.
>> 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.
> I think on solaris global Weak symbols are used anyway, and both linkers
> should get rid of duplicates right?
Only one version will be used, but with the Sun linker you'll still get the
extra copies hanging around taking up space. Of course, with hard drives
these days that doesn't matter as much...
Jason