On Sun, 26 Nov 2017, Aurelien Jarno wrote:
> > > You mean that even now running 'ldconfig' followed by 'ldd /bin/true' > > > will give you > > > libc.so.6 => /lib64/libc.so.6 > > > instead of > > > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 > > > ? > > > > Yes. > > # ldd /bin/true > > linux-vdso.so.1 (0x00007ffc62b5a000) > > libc.so.6 => /lib64/libc.so.6 (0x00007fd870377000) > > /lib64/ld-linux-x86-64.so.2 (0x00007fd870921000) > > > > If I use the --inhibit-cache flag, it points to the correct location: > > # /lib64/ld-linux-x86-64.so.2 --list --inhibit-cache /bin/true > > linux-vdso.so.1 (0x00007ffd566e4000) > > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f73026c8000) > > /lib64/ld-linux-x86-64.so.2 (0x00007f7302c73000) > > > > Without --inhibit-cache, it points to /lib64/libc.so.6 > > # /lib64/ld-linux-x86-64.so.2 --list /bin/true > > linux-vdso.so.1 (0x00007ffd5ad10000) > > libc.so.6 => /lib64/libc.so.6 (0x00007fc566092000) > > /lib64/ld-linux-x86-64.so.2 (0x00007fc56663c000) > > I am still unable to reproduce this problem. On my system > lib/x86_64-linux-gnu/ is preferred over lib64. ldconfig uses glob to to > interpret the "*.conf" in /etc/ld.so.conf, so the files are sorted > alphabetically and thus the zz_amd64-biarch-compat.conf should appear > last. > > It would be interesting to check at the order in the cache, using > "ldconfig -p | grep libc.so". Could you please provide that output? > > Thanks, > Aurelien # ldconfig -p | grep libc.so libc.so.6 (libc6,x32, ABI OS: Linux 3.4.0) => /lib/x86_64-linux-gnux32/libc.so.6 libc.so.6 (libc6,x86-64, ABI OS: Linux 3.2.0) => /lib64/libc.so.6 libc.so.6 (libc6,x86-64, ABI OS: Linux 2.6.32) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (libc6, ABI OS: Linux 3.2.0) => /lib32/libc.so.6 libc.so.6 (libc6, ABI OS: Linux 2.6.32) => /lib/i386-linux-gnu/libc.so.6 The problem is caused by the "ABI OS" field - the libraries in /lib64 have higher field than the libraries in /lib/x86_64-linux-gnu/ If I comment out this piece of code in the function compare in the file glibc/elf/cache.c, the problem goes away and the linker will prefer libraries in /lib/x86_64-linux-gnu/ and /lib/i386-linux-gnu/. /* if (e2->osversion > e1->osversion) return 1; if (e2->osversion < e1->osversion) return -1; */ Mikulas