Subject: Re: Why do I need to add an entry into ld.so.conf?
To: None <firstname.lastname@example.org>
From: Rui Paulo <email@example.com>
Date: 03/23/2005 19:52:00
On 2005-03-23, Phil Pereira <firstname.lastname@example.org> wrote:
> Hey all,
> I'm a little confused by an issue I'm having.
> The pkgsrc collection builds fine and I've *never* needed to change anything to have an app complie and work.
> Yesterday I downloaded the app wmswallow and tried to build it. All seemed to go well, and the app itself compiled. However - upon trying to run the program I was told that a certain .so file could not be found :(
> I used "ldd" to determine that, in fact, a couple of dependencies could not be found.
> I added "/usr/X11R6/lib" to ld.so.conf and all worked fine - including the app. "ldd" showed links to the correct dependencies.
> My question : If I *never* need to add anything to ld.so.conf to compile an app in pkgsrc, why did I need to add it for a program I compiled myself? What am I missing? Or what did I get wrong?
> Many thanks all
When building packages, pkgsrc adds linker flags to gcc command line,
so, when the program is executed, some library paths are hardcoded in
ELF's .dynamic section:
$ objdump -p /usr/pkg/bin/xscreensaver
/usr/pkg/bin/xscreensaver: file format elf32-i386
[program header skipped]
Also, dinamically linked objects continue to check ld.so.conf even if
they have RPATH set in ELF's dynamic section.
Hope this helps.
Rui Paulo <email@example.com> http://www.netbsd-pt.org/users/rpaulo/