On 09/06/2010 11:28 AM, Al wrote:
I looked into many ebuilds, but didn't come to a final conclusion yet.
I am rather confused.
How does a program in Gentoo know, where to look for shared libraries?
Try running "ldconfig -p", which relates to Nikos's comment about ld.so.conf.
Is this compiled into the programes by means of rpath?
Are you coming from a BSD background? I know NetBSD uses rpath everywhere, and
they don't use the ld.so.conf mechanism at all, but I can't recall if the others
do or don't.
Some gentoo packages use rpath, others don't. Use readelf -d <file> to list the
runtime needs of <file>. For example:
#readelf -d /usrlib/evolution/2.30/libevolution-mail-settings.so.0.0.0 | grep Library
0x0000000e (SONAME) Library soname: [libevolution-mail-settings.so.0]
0x0000000f (RPATH) Library rpath: [/usr/lib/evolution/2.30:/usr/lib]
0x0000001d (RUNPATH) Library runpath: [/usr/lib/evolution/2.30:/usr/lib]
On the other hand:
$readelf -d /lib/libm.so.6 | grep Library
0x0000000e (SONAME) Library soname: [libm.so.6]
Does this rather differ on per package basis?
Apparently yes, but I get the impression that the upstream maintainers make that
decision for gentoo, whereas the NetBSD devs add the needed linker flags for every
package they use: "-Wl,-rpath,'$ORIGIN/../lib" (man 8 ld.so).