autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linker default library search path


From: Guillaume Rousse
Subject: Re: linker default library search path
Date: Thu, 01 Jun 2006 10:01:40 +0200
User-agent: Thunderbird 1.5.0.2 (X11/20060425)

Bob Proulx wrote:
> Guillaume Rousse wrote:
>> I recently get surprised by different behaviour of AC_CHECK_LIB on
>> x86_64 and i586 mandriva machines. It seems than on the first one,
>> /usr/local/lib is also part of the default search path. I read ld
>> documentation, but I couldn't find any way to explicitely check my
>> assumption. So, is there any way to display linker default library
>> search path ?
> 
> Usually the compiled in default path is /lib and /usr/lib.  The man
> page for ld.so should document this.
> 
>   man ld.so
> 
> I would peek in the binary and check that those paths are also in the
> binary too.  (/lib/ld-linux.so.2 on i686 systems.)
> 
>   strings /lib/ld-linux-x86-64.so.2 | grep /lib/
>   /lib/
>   /usr/lib/
> 
> Additionally /etc/ld.so.conf instructs ldconfig what paths to put in
> /etc/ld.so.cache which is used by the ld.so.
> 
>   man ldconfig
> 
> In summary it is /lib:/usr/lib plus the contents of /etc/ld.so.conf
> plus the setting of LD_LIBRARY_PATH.
> 
> I am not sure where this is documented but the LD_DEBUG variable may
> be set to trace interesting information about the actions of the
> dynamic loader.
> 
>   LD_DEBUG=help /lib/ld-linux-x86-64.so.2
>   ...
>   libs        display library search paths
>   ...
> 
> Which means you can display the search path for your program by
> setting that variable for the command run and tracing the output.
> 
>   LD_DEBUG=libs cat /dev/null
Unless I'm wrong, you're refering to the loader here, not the linker.
Unless they are supposed to share their configuration, the loader is
only used when you try to execute a programm, not when linking at the
end of compilation.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]