Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use different glibc version

Currently I have glibc which does not support epoll, so I installed new glibc at non default lation which supports epoll. I have python program which uses this epoll.

I tried to set LD_LIBRARY_PATH

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

then I run 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 can I use newly installed glibc instead of default one?

like image 547
big Avatar asked May 25 '12 16:05

big


People also ask

Can I have multiple glibc versions?

So, in a way, we can have multiple versions of glibc on our machine and have a libglib-2.0.so link to a specific version. The linker will look for the soname field in the shared object and embed it in the resulting binary. The soname field specifies the filename for our target shared library.

Is glibc backward compatible?

Glibc has a versioning system that allows backward compatibility (older programs built to run on older versions of glibc will continue to run on new glibc); but it is of no help the other way around: programs that depend on newer glibc will usually not run on systems with older glibc.


1 Answers

You need to use an explicit invocation of the dynamic linker, so 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 GLIBC_2.4 symbol version is not available suggests that something is very wrong with the new glibc, or it is actually not very new at all, predating glibc 2.4.)

like image 190
Florian Weimer Avatar answered Sep 18 '22 13:09

Florian Weimer