This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
dependency list for static libraries
- From: Howard Chu <hyc at symas dot com>
- To: binutils at sourceware dot org
- Date: Tue, 19 Sep 2017 16:49:21 +0100
- Subject: dependency list for static libraries
- Authentication-results: sourceware.org; auth=none
We often get link errors when switching from dynamic linking to static
linking, because dynamic libraries list all of their own dependency libraries,
and static libraries don't. (And the program being linked doesn't know about
those indirect dependencies.)
It Would Be Nice if we could add a dependency list to a static library too.
Much like ranlib creates an index for a static library already, store the list
of dependencies in a reserved module.
It seems to me I've made this suggestion before but Google and my memory have
failed to locate it. We'd need either a new tool like ranlib, or a new flag to
ar to store a list of dependencies, and then linker support to lookup the
dependency list whenever referencing a static library.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/