URL: <https://savannah.gnu.org/support/?111217>
Summary: "link_all_deplibs": issue with overlinking dependencies Group: GNU Libtool Submitter: None Submitted: Thu 03 Apr 2025 07:48:53 PM UTC Category: None Priority: 5 - Normal Severity: 4 - Important Status: None Privacy: Public Assigned to: None Originator Email: anthony.mal...@laas.fr Open/Closed: Open Discussion Lock: Any Operating System: *BSD _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Thu 03 Apr 2025 07:48:53 PM UTC By: Anonymous Hi, I am facing an issue with dependency "overlinking" (related to the "link_all_deplibs" variable). This is on NetBSD, but it concerns all ELF systems. As far as I can tell, on NetBSD at least, a libtool library is linked with all the dependencies of any dependent libtool libray. Let's summarize it with an example. In the following scenario, imagine 3 libtool libraries X, Y and Z: libX-1.la -> libY-1.la -> libZ-1.la where libX (major version 1) depends on libY (major version 1) which depends on libZ (major version 1). Linking libX-1.la with libtool to libY-1.la (and just this one) will add the libZ-1.la dependency to libX-1.la in the DSO file. This is useless on any ELF system, as libY already holds that dependency information thanks to the DT_NEEDED tag. libX should only depend on libY, if that's what is given on the command line. This can even be wrong in the case where libZ is a private dependency of libY (so that libZ is not part or libY ABI). If at some point libY is upgraded to libY-1.1.la, now internally using libZ-2.la, then libX-1.la with be dependent on both libZ.so.1 and libZ.so.2, which may not work at all. I noticed that this behaviour does not happen on a Debian system. So while analyzing the differences between a Debian system and NetBSD, I found this patch from Debian: https://sources.debian.org/src/libtool/2.5.4-4/debian/patches/link_all_deplibs.patch/ This is from the list of current patches to Debian libtool package: https://udd.debian.org/patches.cgi?src=libtool&version=2.5.4-4 This patch addresses exactly my issue (enven though it should be extended to any ELF system, in particular NetBSD, and not only Linux). So I was wondering if you where somehow aware of this patch (the Debian entry says "not submitted upstream"), and if you think it makes sense. The comment says "will be fixed in a better way in a future upstream version", hence my questions. In any case, I can work on a fix for NetBSD, if you think that's relevant, but I think the above patch should be considered. Cheers, Anthony _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/support/?111217> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
signature.asc
Description: PGP signature