mainGNU Libtool - Support: sr #111217, "link_all_deplibs":...

 
 

sr #111217: "link_all_deplibs": issue with overlinking dependencies

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:  -email is unavailable- Open/Closed:  Open
Operating System:  *BSD
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Thu 03 Apr 2025 07:48:53 PM UTC, original submission:  

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.d ... ll_deplibs.patch/
This is from the list of current patches to Debian libtool package:
https://udd.debia ... p;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

Anonymous

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16-a7ba.
    Corresponding source code