I am using Debian squeeze but need to run my program in another linux distribution that does not have the mudflap library installed and has a different glibc version. So I want to compile test.c in Debian squeeze and carry Debian's libraries/files (glibc, mudflap, ld, etc.) rather than use the ones installed in the other linux distribution.
Show me how to compile test.c with gcc in Debian squeeze so it is compiled in such a way that it will only use the carried libraries/files rather than the libraries/files that are installed by default in the other linux distribution.
This is what I have tried so far but does not work:
gcc -nostdlib -Wl,-dynamic-linker,/home/myuser/Desktop/ld-linux-x86-64.so.2,-rpath,/home/myuser/Desktop /home/myuser/Desktop/libc.so.6 -fmudflap /home/myuser/Desktop/libmudflap.so.0 test.c
Maybe these files have to be linked too ?
Very good knowledge of gcc is required to successfully accomplish this job. Experience in cross-compilation may be helpful.
The programmer will probably have to use Debian squeeze to successfully accomplish this job. Also, the following programs will probably be needed to check if the compilation was successful: