[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: FW: Re: help: shlibs problem

On Sat, Dec 23, 2000 at 08:11:38PM -0600, Steve Langasek wrote:
> > That's not true. Latest dpkg-shlibdeps uses ldd/objdump together. It uses
> > objdump to get the list of library deps, and then maps it against ldd
> > output to get the full PATH to just these libraries.
> > So yes, it is quite reasonable to require using LD_LIBRARY_PATH to let
> > dpkg-shlibdeps(ldd) know where this library is, even if you have shlibs.local.
> > The reason being is that it needs to know the path to the library in order
> > to map it correctly. It doesn't know that this belongs to the local build
> > unless it can see the directory.
> I guess I don't fully understand what dpkg-shlibdeps uses 'ldd' for.  (Sorry,
> I'd check myself, but I'm at a Windows box on the end of a modem for the
> holidays -- asking is easier than perusing source at the moment.)  What
> mapping are you referring to?  What more does dpkg-shlibdeps need to know,
> aside from the names of the libraries a binary is linked with and the list of
> packages that provide these libraries?  If this is truly necessary, I
> certainly have no problem with adding LD_LIBRARY_PATH where appropriate; I
> just don't understand why shlibs.local isn't enough, since it provides the
> info needed to generate a correct dependency list.

dpkg-shlibdeps does this:

ldd debian/tmp/bin/foo
  libc.so.6 => /lib/libc.so.6
  ld-linux.so.2 => /lib/ld-linux.so.2

Now, ldd outputs even child deps, so some things in ldd are not actually
linked to by "foo". So we run objdump to get that list:

objdump --all debian/tmp/bin/foo | grep NEEDED


Now you might think that the objdump output is all that's needed, but it
isn't. Think of something like libX11.so.6 which might be in
/usr/X11R6/lib/ (for libc6 built) or /usr/i486-linux/lib/ (for libc5
built). So we "map" the objdump output (the only libs we care about) to
the ldd output (the systems mapping to the full path), and use that full
path to the library to ask dpkg what package provides this library.

So if we cannot get a mapping from ldd, we fail, simply becuase we are
unsure where this mystery library is coming from (was it linked to from
/usr/local/foo? /opt/lib? who knows).


/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '

Reply to: