1 |
On 09/07/2010 12:24 AM, Al wrote: |
2 |
>>> How does a program in Gentoo know, where to look for shared libraries? |
3 |
>> |
4 |
>> The program doesn't know. But the runtime linker does. And those paths are |
5 |
>> in /etc/ld.so.conf. This file gets updated automatically by portage when |
6 |
>> needed. |
7 |
>> |
8 |
>> But... sometimes the program also knows and can link against libraries long |
9 |
>> after it has started up using a dlopen() call: |
10 |
>> |
11 |
>> http://linux.die.net/man/3/dlopen |
12 |
>> |
13 |
> |
14 |
> Thank you Nikos. I did read obout this in the Linux HOWTO: |
15 |
> |
16 |
> http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html#DL-LIBRARIES |
17 |
> |
18 |
> But I was woundering if the /etc/ld.so.conf was only historical stuff. |
19 |
> O.K. is not it's up-to-date. Good to know this. |
20 |
> |
21 |
> But it also writes that dlopen() is specific for Linux and Solaris. |
22 |
> There would be alternatives: |
23 |
> |
24 |
> 1.) The glib library |
25 |
> 2.) libltdl, which is part of GNU libtool |
26 |
> |
27 |
> Now I was woundering, which way would Gentoo choose or if that is not |
28 |
> package specific at all. Are you sure dlopen() is used as a general |
29 |
> approach on Gentoo? |
30 |
|
31 |
Gentoo doesn't choose anything; it's up to the programs to decide how |
32 |
they want to load libraries at runtime. It's like asking whether Gentoo |
33 |
chooses to use Qt or Gtk to run Firefox; well, since Firefox is a Gtk |
34 |
application and is making calls to Gtk functions, Gentoo doesn't have a |
35 |
say about it. |