|
From: | Peter O'Gorman |
Subject: | Re: What makes a convenience library (use --whole-archive)? |
Date: | Tue, 07 Jun 2011 20:39:59 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 |
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.
Peter
[Prev in Thread] | Current Thread | [Next in Thread] |