9

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?

4

2 回答 2

2

您需要使用动态链接器的显式调用,因此如下所示:

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

(但GLIBC_2.4符号版本不可用的事实表明新的 glibc 存在严重问题,或者它实际上根本不是新的,早于 glibc 2.4。)

于 2017-07-16T20:08:44.360 回答
0

如果你自己编译了 glibc,你的构建目录中应该有 testrun.sh 脚本。这比使用 ld-linux.so 更简单、更可靠:

build/testrun.sh ls
于 2017-09-19T13:40:04.153 回答