[Top][All Lists]

[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: Sat, 07 Jan 2012 15:23:27 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Bob Friesenhahn <address@hidden> writes:

> I think that it is wrong to solely blame libtool for this state of
> affairs.  In order for a project to work properly on non-ELF systems, or
> where installed shared libraries have abbreviated/truncated ELF implicit
> dependencies, or where static libraries are involved, the project needs
> to add all dependencies to LIBS during the configure run.

pkg-config is an excellent example of an alternative way of handling this
that does not have this problem, and it includes Autoconf support.

One interesting possible solution to this problem would be to eliminate
Libtool *.la files in favor of pkg-config or something similar, rather
than continuing to maintain two different mechanisms for doing largely the
same thing.

> I do agree that a tool can help solve these issues.  The linker itself
> is in the best position to know which library dependencies are really
> needed and to skip those which are not.

It turns out that this is harder than it looks.  --as-needed causes
obscure failures in places where the dependency really is needed although
the linker can't figure that out.

The pkg-config solution allows the maintainer of the library to declare
the necessary behavior for both cases: working transitive dependency
resolution, and situations where this cannot be relied upon.  The build
system then chooses based on the situation.

Russ Allbery (address@hidden)             <>

reply via email to

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