Use a different version of glibc

I currently have glibc that does not support epoll, so I installed a new glibc with non default lation that supports epoll. I have a python program that uses this epoll.

I tried to set LD_LIBRARY_PATH

export LD_LIBRARY_PATH="/home/glibc/lib:$LD_LIBRARY_PATH"

then i started ls, it gave me errors

ls: /home/glibc/lib/tls/libc.so.6: version 'GLIBC_2.4' not found (required by /lib/libpam.so.0)

ls: /home/glibc/lib/tls/libc.so.6: version 'GLIBC_2.4' not found (required by /lib/libpam_misc.so.0)

Also, when I tried to run python, I got

python: relocation error: /home/glibc/lib/tls/libc.so.6: symbol _dl_out_of_memory, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference

How to use newly installed glibc instead of the standard?

+7
source share
2 answers

You need to use an explicit call to the dynamic linker, something like this:

 /home/glibc/lib/ld-linux-x86-64.so.2 --library-path /home/glibc/lib /usr/bin/python 

(But the fact that the version of the GLIBC_2.4 character GLIBC_2.4 unavailable indicates that something is very bad with the new glibc, or that it is actually not entirely new, preceded by glibc 2.4.)

0
source

If you compiled glibc yourself, you should have testrun.sh script in your build directory. This is simpler and more reliable than using ld -linux.so:

 build/testrun.sh ls 
0
source

All Articles