GNU bug report logs - #54726
when linking a shared library on Linux, libtool 2.4.6 ignores libfoo.so arguments

Previous Next

Package: libtool;

Reported by: Nicolas Boulenguez <nicolas <at> debian.org>

Date: Tue, 5 Apr 2022 14:24:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Nicolas Boulenguez <nicolas <at> debian.org>
To: 54726 <at> debbugs.gnu.org
Subject: bug#54726: when linking a shared library on Linux, libtool 2.4.6 ignores libfoo.so arguments
Date: Tue, 5 Apr 2022 12:50:59 +0200
[Message part 1 (text/plain, inline)]
Hello.

When linking a shared library or a program against a (locally built, not
installed) foo library, it is recommended to prefer
  dir/libfoo.so
over
  -Ldir -lfoo
which only adds complexity and unwanted ambiguity (for example,
/usr/lib/libfoo.{a,so} may silently be selected if dir/libfoo.so is
unexpectedly missing).

Libtool recognizes such options when linking a program, but ignores
them when linking a shared library.

The attached reproducer
* builds with -Ldir -lfoo in order to ensure that the sources are
  correct
* demonstrates the link failure with a direct path
* builds with the attached patch applied and a direct path

Just in case it helps, the original bug report is here:
Bug-Debian: https://bugs.debian.org/960469

Thanks.
[draft960469.diff (text/x-diff, attachment)]
[reproducer (text/plain, attachment)]

This bug report was last modified 3 years and 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.