Package: libtool
Debian patches libtool, so that its link_all_deplibs is set to no. In
the documentation of libtool is written, that link_all_deplibs is set to
unknown (which is yes). A program, that follows what is written in
libtool's documentation, will fail to link under debian, due the
link_all_deplibs patch. I have read many bug reports and discussions,
but as long as my build system fails just on Ubuntu and Debian, because
of link_all_deplibs, I consider this change as a bug introduced by
Debian's patch.
Cyrus imap (www.cyrusimap.org) consist of several libraries and
executables. One of the library (libcyrus) depends on linking
(DT_NEEDED as in ELF) to libsasl and libssl in order to work. The
programs from cyrus imap on their own depend on libcyrus and might use
functions from libsasl and libssl. In Makefile.am for those programs is
just listed, that they depend on libcyrus.la .
These programs cannot be linked on Debian, as libtool states there ...
/bin/bash ./libtool --tag=CC --mode=link gcc -o imtest/imtest
imtest/imtest_imtest-imtest.o lib/libcyrus.la lib/libcyrus_min.la -ldb
-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl
-lpq -lsqlite3 -lpcre -lpcreposix -lz -ldb -L/usr/lib/x86_64-linux-gnu
-lmysqlclient -lpthread -lz -lm -lrt -ldl -lpq -lsqlite3 -lpcre
-lpcreposix -lz
libtool: link: gcc -o imtest/.libs/imtest imtest/imtest_imtest-imtest.o
lib/.libs/libcyrus.so lib/.libs/libcyrus_min.so
-L/usr/lib/x86_64-linux-gnu -ldb -lmysqlclient -lpthread -lm -lrt -ldl
-lpq /usr/lib/x86_64-linux-gnu/libsqlite3.so -lpcre -lpcreposix -lz
-Wl,-rpath -Wl,/mail/github/cyrus-imapd-master/lib
/usr/bin/ld: imtest/imtest_imtest-imtest.o: undefined reference to
symbol 'sasl_errstring@@SASL2'
/usr/bin/ld: note: 'sasl_errstring@@SASL2' is defined in DSO
/mail/me/cyrus-sasl-2.1.23/lib/libsasl2.so.2 so try adding it to the linker
command line
/mail/me/cyrus-sasl-2.1.23/lib/libsasl2.so.2: could not read symbols:
Invalid operation
collect2: ld returned 1 exit status
... that in effect the program is linked with libcyrus, lincyrus is
linked with libsasl, but the program is not linked with libsasl, so the
linker will not link.
According to my understanding, and the documentation of libtool for the
default of link_all_deplibs, if a program A is linked to library B, and
library B depends on library C, then the program A may use functions
from library C, without linking explicitly with it.
Now, I do not think, that library C has to be in DT_NEEDED in program A,
in order to be able to execute program A (which links with libB, which
links with libC). However the only way to make linking succeed is to
explicitly link program A with libC, which in effect is the same as
using link_all_deplibs = yes.
While I have understanding, that the intention of switching
link_all_deplibs to false is to minimize the DT_NEEDED entries, this
does not help in my case. It just forces me to add libC explicitly as
dependency of program A, which is awkward.
I do not find an option in gnu ld how to ask it, when linking program A,
to search in all DT_NEEDED of libB for the unknown symbols in program A,
without including that additional libraries as DT_NEEDED in program A.
The option --copy-dt-needed-entries is a try, but to the extend I
understand it, it does add libC in DT_NEEDED of progA, which is
effectively the same as link_all_deplibs = yes. Isn't it better, to
pass --as-needed to the linker and let it shorten the DT_NEEDED entries,
rather than stripping the dependency libraries?
I kindly ask you to modify the behaviour of libtool on Debian to be
conform with the documentation of libtool (in the part of link_all_deplibs).
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org