View previous topic :: View next topic |
Author |
Message |
d4mo Guru
Joined: 27 Jun 2005 Posts: 430
|
Posted: Sun Jan 13, 2008 10:34 pm Post subject: Viewing Shared libary directories |
|
|
Isn't there a command that will show what directories the system searches in for shared libraries. I thought I was looking at something before. I thought it was similar to the PATH variable but I'm not sure.
Also if there is a command like that, how do you add directories that list? |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6051 Location: Removed by Neddy
|
Posted: Sun Jan 13, 2008 10:39 pm Post subject: |
|
|
cat /etc/ld.so.conf
maybe
and to add...
echo "/the/dir/you/want/to/add" >> /etc/ld.so.conf && ldconfig
AT YOUR OWN RISK!!
The gentoo way would be to add an entry in /etc/env.d
LDPATH="....."
and do an env-update _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
d4mo Guru
Joined: 27 Jun 2005 Posts: 430
|
Posted: Mon Jan 14, 2008 4:29 am Post subject: |
|
|
That's what I was looking for.
Out of curiosity. Why don't I have /usr/lib or /lib in my ld.so.conf? If I do a ldconfig -p I get libraries from those directories. Is this another one of those gentoo oddities or what? |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Mon Jan 14, 2008 4:47 am Post subject: |
|
|
d4mo wrote: | That's what I was looking for.
Out of curiosity. Why don't I have /usr/lib or /lib in my ld.so.conf? If I do a ldconfig -p I get libraries from those directories. Is this another one of those gentoo oddities or what? |
Those two are usually symlinks to either lib32 or lib64, depending on your arch. So, if lib32 or lib64 is on your ldpath then including lib would be reduntant. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9538 Location: beyond the rim
|
Posted: Mon Jan 14, 2008 5:36 am Post subject: |
|
|
Maybe a bit technical, but contains the wanted information (the topic is a bit complicated):
Code: | man ld.so
man ldconfig |
|
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6051 Location: Removed by Neddy
|
Posted: Mon Jan 14, 2008 10:25 am Post subject: |
|
|
Genone wrote: | Maybe a bit technical, but contains the wanted information (the topic is a bit complicated):
Code: | man ld.so
man ldconfig |
|
\o/ at least I was on the right track _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
d4mo Guru
Joined: 27 Jun 2005 Posts: 430
|
Posted: Mon Jan 14, 2008 6:57 pm Post subject: |
|
|
i92guboj wrote: | d4mo wrote: | That's what I was looking for.
Out of curiosity. Why don't I have /usr/lib or /lib in my ld.so.conf? If I do a ldconfig -p I get libraries from those directories. Is this another one of those gentoo oddities or what? |
Those two are usually symlinks to either lib32 or lib64, depending on your arch. So, if lib32 or lib64 is on your ldpath then including lib would be reduntant. |
Hmm I don't have those either. This is what I have:
Code: | /usr/local/lib
/usr/lib/opengl/nvidia/lib
/usr/i686-pc-linux-gnu/lib
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1
/opt/blackdown-jdk-1.4.2.03/jre/lib/i686/
/opt/blackdown-jdk-1.4.2.03/jre/lib/i686/native_threads/
/opt/blackdown-jdk-1.4.2.03/jre/lib/i686/client/
/opt/blackdown-jdk-1.4.2.03/jre/lib/i686/server/
/usr/games/lib
|
How are the libs from /lib being loaded into the ldpath if they are not in ld.so.conf? |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6051 Location: Removed by Neddy
|
Posted: Mon Jan 14, 2008 8:57 pm Post subject: |
|
|
from man ld.so
Quote: |
The shared libraries needed by the program are searched for in various places:
o (ELF only) Using the DT_RPATH dynamic section attribute of the binary if present and DT_RUN-
PATH attribute does not exist. Use of DT_RPATH is deprecated.
o Using the environment variable LD_LIBRARY_PATH. Except if the executable is a set-user-
ID/set-group-ID binary, in which case it is ignored.
o (ELF only) Using the DT_RUNPATH dynamic section attribute of the binary if present.
o From the cache file /etc/ld.so.cache which contains a compiled list of candidate libraries
previously found in the augmented library path. If, however, the binary was linked with -z
nodeflib linker option, libraries in the default library paths are skipped.
o In the default path /lib, and then /usr/lib. If the binary was linked with -z nodeflib linker
option, this step is skipped.
|
ie /lib and /usr/lib are implied _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
|