I don't have the build files so I'm not sure if this will work but what about statically linking to libc. It would add about 2M to a download that is already about 275M.
I think this would work - http://statifier.sourceforge.net/
. I didn't read too much about it, but I hope you can do it just for specific libraries. Adding all of the dependencies to the executable would be pretty messy.
You could also just download a copy of the necessary libc and load it instead of your system's default one using LD_LIBRARY_PATH.
Static link to libc usually (not always, but usually is a problematic thing) Why ?
In a lot of case program uses not only glibc but also functions from libnss_* libraries
Translation uid to username and back, ip address to hostname and back and a number of others implemented by those libnss_* libraries
Those libraries (at least on all systems that I saw) are shared only, there is no ready available .a libraries. So there is no [easy] way to statically link them too.
Those libraries tightly coupled with libc. Using libc from one version and libnss_* libraries from another often produce undesirable results (segfault at best, hard to understand and debug problems at worst)
Statifier pack into executable ALL of it's shared libraries. You can ask some more libraries to be packaged using LD_PRELOAD, but there is no way to exclude libraries from packaging by statifier
Commercial alternative to statifer - Ermine (http://magicErmine.com
) indeed able to pack only executable and libc, but it's commercial.
Bring another libc and using LD_LIBRARY_PATH is a nice idea and should work - as long as ld-linux.so.2, which is too tightly coupled with libc is not too different.