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