如何为旧的Linux发行版构建应用程序,并避免发生FATAL:kernel too old错误? [英] How do I build an app for an old linux distribution, and avoid the FATAL: kernel too old error?

查看:1125
本文介绍了如何为旧的Linux发行版构建应用程序,并避免发生FATAL:kernel too old错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux上分发了我的应用程序的静态链接二进制版本.但是,在具有2.4内核的系统上,我在启动时遇到段错误,并显示消息:致命:内核太旧".

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: kernel too old."

如何轻松启动并运行2.4内核的版本?我需要的某些库甚至在2003年左右的旧linux发行版中都不可用.是否有apt-get安装程序或使我可以轻松地针对较早内核的东西?

How can I easily get a version up and running with a 2.4 kernel? Some of the libraries I need aren't even available on old linux distributions circa 2003. Is there an apt-get install or something that will allow me to easily target older kernels?

推荐答案

最简单的方法是简单地安装 VirtualBox (或类似的东西,例如VMWare),安装 CentOS 3 或任何其他版本适用于2.4内核的旧发行版,并以此为基础构建/测试您的应用.

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.

由于您的内核太旧",因此您有可能依赖于2.4内核中不存在的某些功能,因此您必须对其进行追溯和重新设计. 该错误可能仅是由于静态链接至glibc引起的,您可以尝试动态链接至glibc以及静态链接所有其他库,尽管要向后兼容,您必须在旧的glibv系统上构建您的应用程序.使用 lsb 工具进行构建也可以提供帮助

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

这篇关于如何为旧的Linux发行版构建应用程序,并避免发生FATAL:kernel too old错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆