This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: static library dependencies
- From: Ian Lance Taylor <iant at google dot com>
- To: Howard Chu <hyc at highlandsun dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 19 Mar 2010 08:41:30 -0700
- Subject: Re: static library dependencies
- References: <4BA2A5FE.6040002@highlandsun.com>
Howard Chu <hyc@highlandsun.com> writes:
> When building shared libraries you can link any dependencies into the
> shared library file, and so any application can use the shared library
> without mentioning the library's dependencies on the link line. It
> would be nice to provide the same capability for static libraries,
> otherwise build procedures need to be changed drastically depending on
> whether a library dependency is static or shared.
>
> It seems all you need to do is add a dependency list member in the ar
> archive, and extend the linker to look for this dependency list by
> default. It could be an extension of the symbol directory maintained
> by "ar rs" or some other option.
>
> Comments?
That could be done, and I believe it could even be done in a backward
compatible manner, but it would lead to the same set of issues that
arise with shared libraries. Because archives can move around and be
renamed, you need to use a search path.
Ian