Subject: Re: REQUIRES= is broken with ldd having non-NetBSD-like output
To: Jeremy C. Reed <reed@reedmedia.net>
From: Alistair Crooks <agc@pkgsrc.org>
List: tech-pkg
Date: 02/10/2005 11:53:39
On Thu, Feb 10, 2005 at 03:05:39AM -0800, Jeremy C. Reed wrote:
> I noticed this week that new glibc 2.3.4 caused my ldd output to have
> new first entry:
>
> linux-gate.so.1 => (0xffffe000)
>
> I thought this caused my REQUIRES= to fail. But now I see none of it is
> there. (PROVIDES= works fine it appears.)
>
> ldd output on a NetBSD box is
> \tab -lfoo => /path/to/libfoo.
> (That is a space after the tab.)
>
> This works on NetBSD:
>
> ldd foo | awk 'NF == 3 { print $3 }'
>
> But does not work on Linux which has:
> \tablibfoo => /path/to/libfoo (0xb777000)
>
> This works on Linux:
>
> awk 'NF == 4 { print $3 }
>
> Anyways, I had proposed that we should not use ldd and use objdump (for
> NEEDED) on systems that provide it.
>
> Until then do we need some operating system specific LDD_FIELDS variable,
> like LDD_FIELDS=4 for Linux?
>
> I now have LDD_FIELDS?= 3 and set to 4 in my own mk.conf
> and use it for the above awk expression in bsd.pkg.mk. It works for me.
You could always check that the second field is "=>" - I think I just
put the number of fields check in to make sure we only got the shared
lib entries.
Regards,
Alistair