Re: linker default library search path

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

 



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

Hope that helps,
Bob


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux