$ printf 'int main(){}' | gcc -static -x c - -o hello
$ scp hello vi-server.org:./
hello 100% 565KB 565.2KB/s 00:00
$ ssh -t vi-server.org "./hello; uname -r"
FATAL: kernel too old
sh: line 1: 15378 Segmentation fault ./hello
2.6.18-274.... # can't easily upgrade the kernel
Connection to vi-server.org closed.
如何构建可在旧系统上运行的静态二进制文件?我希望静态二进制文件甚至可以在 2.4 上工作。