Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Viewing Shared libary directories
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Sun Jan 13, 2008 10:34 pm    Post subject: Viewing Shared libary directories Reply with quote

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
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Sun Jan 13, 2008 10:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Mon Jan 14, 2008 4:29 am    Post subject: Reply with quote

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
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Mon Jan 14, 2008 4:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9538
Location: beyond the rim

PostPosted: Mon Jan 14, 2008 5:36 am    Post subject: Reply with quote

Maybe a bit technical, but contains the wanted information (the topic is a bit complicated):
Code:
man ld.so
man ldconfig
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Mon Jan 14, 2008 10:25 am    Post subject: Reply with quote

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
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Mon Jan 14, 2008 6:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Mon Jan 14, 2008 8:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum