#960469 libtool: for a shared library, -L. -lfoo works but libfoo.so is ignored

Package:
src:libtool
Source:
libtool
Submitter:
Nicolas Boulenguez
Date:
2026-02-26 00:31:02 UTC
Severity:
normal
Tags:
#960469#5
Date:
2020-05-13 02:34:52 UTC
From:
To:
Hello.

When linking a shared library against another uninstalled shared
library missing libtool support,
      -L. -lfoo      -L. -l:libfoo.so      libfoo.so
should be equivalent.

https://www.gnu.org/software/libtool/manual/libtool.html#FOOT2 and
https://www.gnu.org/software/automake/manual/automake.html#Linking
both recommend the third form because it is less ambiguous, but
libtool ignores it.

This results in the library containing undefined symbols, or an
immediate failure with --no-undefined.

A reproducer is attached.

#960469#10
Date:
2020-05-15 18:04:41 UTC
From:
To:
Hello.

An improved reproducer is attached. The patch just copies other
portions of the code and requires competent review.  On my machine,
* sh reproducer
  fails and demonstrates the problem.
* sh reproducer check_reproducer
  succeeds, so the reproducer seems minimal.
* sh reproducer check_fix
  succeeds, so the attached patch seems basically correct.
* (echo draft960469.diff >> debian/patches/series) && debian/rules build
  passes all non-skipped tests.
Do you see other things that I can check before forwarding it to
upstream as described at [1]?

Thanks.

[1] https://www.gnu.org/software/libtool/manual/libtool.html#Reporting-bugs