On Sun, 5 Jan 2020, wf...@niif.hu wrote:

On the other hand, this overlinks the final binary:

$ objdump -p .libs/translib | fgrep NEEDED
 NEEDED               liba.so
 NEEDED               libb.so
 NEEDED               libc.so.6

libb.so is unneeded here (but is present in the installed program as
well).  Coincidentally, the most prominent search result
https://wiki.mageia.org/en/Overlinking_issues_in_packaging mentions that
"this is fixed using a patch from Debian" for libtool.

What's your position on this?  Is overlinking a problem or not?  (It
causes problems for distributions.)  Should everybody use --as-needed
globally to combat it?  Something else entirely?

This has been the most common complaint (in the GNU Linux world) I have heard about libtool. There is a choice of working reliably and portably (with possible over-linking) or relying on implicit library dependencies (which are definitely not portable), or failing as you have encountered. A similar complaint is that libtool uses information in installed ".la" files in order to link with all libraries that the program/library is dependent on. Due to this, GNU Linux distributions often patch out this capability, and they don't distribute ".la" files.

Unfortunately, --as-needed may not be 100% reliable since it only reliably detects direct dependence on library symbols, and not "transitive" dependence.

Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt

Reply via email to