libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What makes a convenience library (use --whole-archive)?


From: Michael Poole
Subject: Re: What makes a convenience library (use --whole-archive)?
Date: Wed, 8 Jun 2011 08:09:02 -0400

On Tue, Jun 7, 2011 at 9:39 PM, Peter O'Gorman wrote:
> On 06/07/2011 08:07 PM, Michael Poole wrote:
>>
>> Some of the files in my convenience libraries have static
>> initializers.  By default, the linker discards these symbols because
>> they are not referenced.  I am trying to figure out how to keep them
>> in an automake-driven build.
>>
>> Mailing list threads I have seen on the Internet, plus the "libtool"
>> script code (as of version 2.2.6b), indicate that convenience
>> libraries should be linked with -Wl,--whole-archive (or the
>> equivalent).  I do not see that here.
>
> Yes, when convenience libraries are used to create a shared library, all the
> objects are included in the output, when the output is an application they
> are used like a normal archive library.
>
> Either use them to create a shared library or, if creating an application,
> don't use them, use the objects instead.

Ah, thank you.  I was not aware that they were treated differently
when used by shared libraries versus applications.

Michael Poole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]