I need to make my linux executable "compile once, run everywhere". Theoretically it's possible, because my program only use very basic system calls (system calls for network IO and file IO). In practice, it's a different story:
My developing platform is Ubuntu 12.04, which has pretty recent kernel, glibc and toolchain. I first tried to static link my executable, but the executable refuses to run on centos 5 (kernel version 2.6.18). If the executable is dynamic linked, the dynamic loader (ld.so) refuses to load my executable. I even tried to ship a modified dynamic loader (I modified it to ignore kernel version), libc, libgcc_s, still doesn't work, because the modified loader always tries to load the libc from the system and ignore the libc shipped along with my executable.
I need a dynamic loader which would blindly load everything I want it to load. Anyone knows such a dynamic loader on linux ? I'm not sure whether I'm heading to the right direction, so any suggestion is welcome.
strace
the failing execution of the statically linked program on Centos 5? You'll understand better what is failing... – Hoodoo