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

Bug#572895: ldconfig issue: priority of /lib and /usr/lib is too high



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Package: libc-bin
Version: 2.10.2-6

I would like to override the "standard" libGL.so files by a "private"
library installed in a special directory. Problem: It seems that
the libraries in in /lib and /usr/lib have a higher priority than any
other directory. This is a severe restriction. Looking at ld.so(8)
I had the impression that /lib and /usr/lib are supposed to provide a
_default_ set of libraries to be overridden by ld.so.conf and
$LD_LIBRARY_PATH as needed;

:
:
The necessary shared libraries needed by the program are searched for in the following order

o      Using  the  environment  variable LD_LIBRARY_PATH (LD_AOUT_LIBRARY_PATH for a.out programs).  Except if
       the executable is a setuid/setgid binary, in which case it is ignored.
o      From the cache file /etc/ld.so.cache which contains a compiled list of candidate  libraries  previously
       found in the augmented library path.
o      In the default path /lib, and then /usr/lib.
:
:


Here is my setup:

	% cat /etc/ld.so.conf
	include /etc/ld.so.conf.d/*.conf

	% cat /etc/ld.so.conf.d/*.conf
	/usr/lib/nvidia-current
	/usr/lib32/nvidia-current
	# libc default configuration
	/usr/local/lib
	# Multiarch support
	/lib/x86_64-linux-gnu
	/usr/lib/x86_64-linux-gnu

AFAICS this is Debian's default, except for the nvidia libs. Please note
that there is neither /usr/lib nor /lib included in this list.

ldd and strace show that the library is taken from the wrong directory.
Sample session:

% cat <<EOF >/tmp/conftest.cpp
> #include <GL/gl.h>
> int main () { glBegin(GL_POINTS); return 0; }
> EOF
% g++ /tmp/conftest.cpp -I/usr/include/nvidia-current -L/usr/lib/nvidia-current -lGL -o /tmp/conftest
% ldd /tmp/conftest
        linux-vdso.so.1 =>  (0x00007fff217ff000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f4673b5f000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f467384b000)
        :
        :
%
% file -L /usr/lib/libGL.so.1 /usr/lib/nvidia-current/libGL.so.1
/usr/lib/libGL.so.1:                ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, for GNU/Linux 2.4.20, stripped
/usr/lib/nvidia-current/libGL.so.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped


Regards

Harri
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuTvM0ACgkQUTlbRTxpHjfWbwCcD4pDDI6BwI3v1mAz01AIAe1m
ZBcAn34Pw3/iSKtsskC8duMc1XNRtCcK
=B/XD
-----END PGP SIGNATURE-----



Reply to: