[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Linking convenience libraries
From: |
Albert Chin |
Subject: |
Re: Linking convenience libraries |
Date: |
Thu, 3 Mar 2005 21:54:08 -0600 |
User-agent: |
Mutt/1.5.6i |
On Thu, Mar 03, 2005 at 09:39:36PM -0600, Albert Chin wrote:
> On Thu, Mar 03, 2005 at 12:01:26PM -0600, Bob Friesenhahn wrote:
> > On Thu, 3 Mar 2005, Albert Chin wrote:
> >
> > >When using the compiler to perform the link and linking against
> > >convenience libraries, is there any reason to link explicitly against
> > >the extracted objects of the convenience libraries rather than just
> > >the .a file? I'm running into a problem on IRIX with the SGI C++
> > >compiler that is solved if I link the .a files. I see no reason why we
> > >extract the convenience libraries libraries when linking against the
> > >compiler v. the linker.
> >
> > If we link against the .a file directly then the only objects which
> > will get pulled in are the ones required to link (resolve symbols).
> > This means that much of the library may be missing.
> >
> > If we are building an application it is desirable to shed unnecessary
> > objects but it is not desirable to do that for libraries.
>
> What if we use $whole_archive_flag_spec?
>
> Are the following equivalent on Linux?
> 1. ld -soname libfoo.so 1.o 2.o 3.o [all .o's from lib1.a] \
> [all .o's from lib2.a]
> 2. ld -soname libfoo.so 1.o 2.o 3.o \
> --whole-archive lib1.a lib2.a -no-whole-archive
>
> If so, then we should be able to use $whole_archive_flag_spec in lieu
> of extracting everything.
Sorry, this is already used when creating shared libraries.
--
albert chin (address@hidden)