dependency list for static libraries

Howard Chu
Thu Sep 3 20:42:59 GMT 2020

Howard Chu wrote:
> Joseph Myers wrote:
>> You can install a linker script under a .a file name to achieve this
>> effect.  On x86_64, glibc's libm.a now looks like:
>> /* GNU ld script
>> */
>> OUTPUT_FORMAT(elf64-x86-64)
>> GROUP ( /usr/lib64/libm-2.26.90.a /usr/lib64/libmvec.a )
> Thanks for the suggestion, but that still means introducing additional/auxiliary files, so it has much the same drawback as libtool files. I also find this
> particularly gross because it breaks the principle of least surprise; when I see a *.a file I expect ar, nm, and ranlib to work on it. I'm kind of shocked that
> such a solution ever flew.
Here's a proposed patch to ar to implement the first half of the solution:
storing the dependencies into a static library. It looks like I may be able
to use the linker plugin facility to handle the ld side of things. But it's
not clear to me that it won't clash with other plugins. I.e., if one plugin
claims an archive file, will that prevent other plugins from being able to
process it?

  -- Howard Chu
  CTO, Symas Corp. 
  Director, Highland Sun
  Chief Architect, OpenLDAP
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-ar-support-for-dependencies.patch
Type: text/x-patch
Size: 9613 bytes
Desc: not available
URL: <>

More information about the Binutils mailing list