libtool
[Top][All Lists]
Advanced

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

Re: Several questions about libtool


From: Russ Allbery
Subject: Re: Several questions about libtool
Date: Fri, 06 Jan 2012 18:13:09 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Bob Friesenhahn <address@hidden> writes:
> On Fri, 6 Jan 2012, Peter O'Gorman wrote:

>> This is still an issue, libtool always adds all dependencies. Many
>> packages assume this and don't explicitly add required dependencies to
>> Makefile.am etc. I don't recall the arguments for not changing this
>> when building shared. IIRC Scott tried to include Debian's patch at
>> some point. I'll look it up in the archives later.

> Some systems (e.g. GNU Linux) add library implicit dependencies at link
> time while others (e.g. Solaris) only seem to add them at run-time and
> will fail to link if the dependencies are not also listed.

I don't believe this is correct.  GNU/Linux does not add implicit
dependencies at link time; it only links with the libraries that you
explicitly list.  ELF doesn't require that all symbols be resolved during
the link, only the symbols in the thing that you're linking.  This
behavior is, so far as I know, the same on both GNU/Linux and on Solaris.

On an ELF system, if linking fails, that means that what you're trying to
link references symbols in a library that you're not including, not that
one of the libraries that you link against has unreferenced symbols.  ELF
build-time linkers should not care about the latter; that's handled by the
runtime loader.

> Some systems require that no symbols remain unresolved in order to
> produce a shared library.

This refers only to the binary or shared library itself, not by symbols
used by shared libraries that it depends on.

> Libtool's mode of operation works with static builds and on systems
> where all libraries have to be supplied at link time.

Of which there are very few still in existence in terms of widespread use,
since most systems now use ELF or (like Mac OS X) some other object format
that doesn't require this.  Solaris is definitely not one of them.  I
believe you may still need this on such platforms as AIX or HP-UX that use
a much different object format, but I'm not at all certain of that; it's
been years since I've used them.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>



reply via email to

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