How do I build an app for an old linux distribution, and avoid the FATAL: kernel too old error?

前端 未结 2 652
北恋
北恋 2020-12-22 01:50

I distribute a statically linked binary version of my application on linux. However, on systems with the 2.4 kernel, I get a segfault on startup, and the message: \"FATAL: k

2条回答
  •  旧巷少年郎
    2020-12-22 02:40

    The easiest way is to simply install VirtualBox (or something similar, e.g. VMWare),Install CentOS 3 or any suitable old distro with a 2.4 kernel and build/test your app on that.

    Since you're getting a "kernel too old", chances are you're relying on some features not present in 2.4 kernels so you'll have to trace down and rework that. The error might simply be caused by linking statically to glibc, you could try linking to glibc dynamically and all your other libs statically, though to be backwards compatible you'd have to build your app on an old glibv system. Using the lsb tools to build could help too

提交回复
热议问题