Typically even old programs (copied from systems with Linux kernel version 2.4) just run file on modern Linux systems, unless they depend on a lot of libraries or use frameworks.
New programs, (often even int main(){return 0;}
) often fail to run if copied to an old system.
How do I make such dynamically linked executables on a modern system? I don't want to set up old system in chroot or virtual machine. Is it possible to "cross-compile" for old library?