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: Bob Friesenhahn
Subject: Re: What makes a convenience library (use --whole-archive)?
Date: Tue, 7 Jun 2011 20:31:20 -0500 (CDT)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Tue, 7 Jun 2011, 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.

Libtool "convenience" libraries are created like an archive library (using 'ar') but are not actually used like a library. Instead, whenever they are referenced as a dependency, libtool extracts all of the object files from the archive file and links them directly into the executable, just like the program's own .o files. The "convenience" library then becomes a convenient way to bundle the object files for later use. Note that this is different than linking in the normal way with an archive library because in that case, the linker selects only the objects which were actually referenced by the program.

I think that this information should help considerably with understanding the issue.

Bob
--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



reply via email to

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