I have a binary which build for an older version linux, and when I put the binary in a newer linux and try to run it, it tells "no such file or directory" error.
I searched and found this is about improper library linking. I used ldd on this binary and the output shown is like this:
./test.exe: /lib/libpthread.so.0: version 'GLIBC_2.1' not found (required by ./test.exe)
./test.exe: /lib/libpthread.so.0: version 'GLIBC_2.0' not found (required by ./test.exe)
./test.exe: /lib/libpthread.so.0: version 'GLIBC_2.3.2' not found (required by ./test.exe)
./test.exe: /lib/libc.so.6: version 'GLIBC_2.1.3' not found (required by ./test.exe)
./test.exe: /lib/libc.so.6: version 'GLIBC_2.1' not found (required by ./test.exe)
./test.exe: /lib/libc.so.6: version 'GLIBC_2.0' not found (required by ./test.exe)
libpthread.so.0 => /lib/libpthread.so.0 (0x40004000)
libstdc++.so.5 => not found
libm.so.6 => /lib/libm.so.6 (0x40025000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x400cd000)
libc.so.6 => /lib/libc.so.6 (0x400e1000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.3 (0x2a000000)
I did tried to compile the binary with -static to try to embedded required library into the binary (if I understand the -static option correct), but result did not change. I am unfamiliar with the compile-link things. Could anyone provide some help on how to solve this problem? Thank you!
All I want to do is to make this binary run on the newer version linux, I also searched few solutions which suggests to copy older library to some folder and use a "wrapper" to force this binary to use the library in that folder, but still get no lucky.
UPDATE:
I am doing it for ARM linux. I did not mention it because I did not realize it matters.
The two linux versions, however, come from the same company which they name as ts-linux. We purchased ARM board from them and they also provide several linux versions for customers to use.
Based on this fact, I think the two linux should not be that different as GLIBC and uClibc. I tried to copy the old library to new system and set LD_LIBRARY_PATH to the old library, but then all system commands donot function, for example,
ts7800-16:~# export LD_LIBRARY_PATH=/root/libtemp/
ts7800-16:~# ls
ls: /root/libtemp/libgcc_s.so.1: version 'GCC_3.5' not found (required by ls)
ls: /root/libtemp/libc.so.6: version 'GLIBC_2.4' not found (required by ls)
ls: /root/libtemp/libc.so.6: version 'GLIBC_2.4' not found (required by /lib/libselinux.so.1)
ls: /root/libtemp/libc.so.6: version 'GLIBC_2.4' not found (required by /lib/librt.so.1)
ls: /root/libtemp/libpthread.so.0: version 'GLIBC_2.4' not found (required by /lib/librt.so.1)
ls: /root/libtemp/libc.so.6: version 'GLIBC_2.4' not found (required by /lib/libacl.so.1)
ls: /root/libtemp/libc.so.6: version 'GLIBC_2.4' not found (required by /lib/libdl.so.2)
ls: /root/libtemp/libc.so.6: version 'GLIBC_2.4' not found (required by /lib/libattr.so.1)
It seems to me they are also using some other version of GLIBC (forgive my ignorance if I am wrong)
I did checked linux version, and following is the two:
ts7800-16:~# more /etc/debian_version
6.0.3
root@ts7800:root# more /etc/debian_version
3.1 Sarge