title: How to run a binary which require an older glibc library in an newer Linux?
body: <p>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. </p>
  
  <p>I searched and found this is about improper library linking. I used ldd on this binary and the output shown is like this: </p>
  
  <p><code>./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 =&gt; /lib/libpthread.so.0 (0x40004000)
      libstdc++.so.5 =&gt; not found
      libm.so.6 =&gt; /lib/libm.so.6 (0x40025000)
      libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x400cd000)
      libc.so.6 =&gt; /lib/libc.so.6 (0x400e1000)
      /lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.3 (0x2a000000)
  </code>
  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!</p>
  
  <p>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. </p>
  
  <p>UPDATE: </p>
  
  <p>I am doing it for ARM linux. I did not mention it because I did not realize it matters. </p>
  
  <p>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. </p>
  
  <p>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, </p>
  
  <p><code>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)</code></p>
  
  <p>It seems to me they are also using some other version of GLIBC (forgive my ignorance if I am wrong)</p>
  
  <p>I did checked linux version, and following is the two: </p>
  
  <p>ts7800-16:~# more /etc/debian_version</p>
  
  <p>6.0.3</p>
  
  <p>root@ts7800:root# more /etc/debian_version</p>
  
  <p>3.1 Sarge</p>