This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Add --print-dirs option for ldconfig
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Dan Nicholson <dbn dot lists at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 11 May 2012 14:57:48 -0700 (PDT)
- Subject: Re: [PATCH] Add --print-dirs option for ldconfig
- References: <email@example.com><20120331210756.AD8972C0C5@topped-with-meat.com><20120401160854.GA10330@buster.dwcab.com><20120402164541.066C92C081@topped-with-meat.com><20120402172807.GA11723@buster.dwcab.com><20120402181419.6D81C2C07E@topped-with-meat.com><20120403003507.GA25174@buster.dwcab.com>
> On Mon, Apr 02, 2012 at 11:14:19AM -0700, Roland McGrath wrote:
> > Exactly what uses is this intended for?
> Figuring out where the linker is looking for libraries since it's not
> really documented anywhere.
More exact, please. ;-)
Do you mean the linker (ld) at link time?
Do you mean ldconfig?
Do you mean all the places the dynamic linker might look on
your installation? (I think that should be the same answer
Do you mean the actual places the dynamic linker will in fact look
if you ran a program right now on the current machine? (That is
a subset of the previous answer.)
> * The non-existent directories won't be shown. It could be nice to
> know all the possible directories, but didn't seem ncessary.
Depends what you want. If you're trying to decide where is the truly
proper place to put something new, then it might well be one of the
directories that doesn't exist now but would be used if it did.
> * The path built up by ldconfig puts the hwcap directories at the end.
> I would have expected them to come at the beginning like
> LD_DEBUG=libs shows. It does seem that things work out correctly in
> the cache, though.
ldconfig is enumerating everything and storing each one in the cache along
with the bit mask of HWCAP bits that control whether to actually select it.
The dynamic linker at runtime is using a search path controlled by the
current HWCAP bits, and stopping when it finds the first hit.
So I still need to understand with much more precision what your actual use