预计“内核太旧"2.6.16 和 2.6.26 内核版本之间的错误 [英] Anticipate "kernel too old" errors between 2.6.16 and 2.6.26 kernel versions

查看:27
本文介绍了预计“内核太旧"2.6.16 和 2.6.26 内核版本之间的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一台运行 Linux (Debian) 内核为 2.6.26-2-amd64 的机器上构建了一个应用程序,我想在另一台运行 Linux (Suse) 内核为 2.6.16.60-0.21-smp 的机器上运行这个应用程序,但我收到错误致命:内核太旧".

I build an application on a machine running Linux (Debian) with kernel 2.6.26-2-amd64 and I want to run this application on another machine running Linux (Suse) with kernel 2.6.16.60-0.21-smp but I get the error "FATAL: kernel too old".

我从互联网上的研究中了解到,在针对未编译为支持旧内核版本的 glibc 库进行构建时可能会发生这种情况,但通常涉及 2.4 版.同一系列(2.6)的内核是否有可能出现这样的错误,或者这可能来自其他东西?

I know from research on the internet that this can happen when building against a glibc library that was not compiled to support older kernel versions, but it usually concerns version 2.4. Is it possible to get such errors for kernel of the same series (2.6) or can this be from something else ?

另外,我读到这个问题的解决方案是针对使用适当的 --enable-kernel=VERSION 选项编译的另一个版本的 glibc 重建应用程序.作为替代方案,您可以将您的应用程序与 glibc 动态链接来解决问题吗?

Additionally I read that the solution to this problem is to rebuild the application against another version of glibc compiled with appropriate --enable-kernel=VERSION option. As an alternative can you just dynamically link your application with glibc to solve the problem ?

感谢您的帮助.

更新:我知道我的问题可能看起来含糊不清或已被已经提到的解决方案之一解决(动态链接,在另一个[虚拟]系统上构建,重建glibc [考虑到评论,这似乎很棘手我读过它])但我最终要寻找的是防止此类问题的方法.

UPDATE: I understand my question may seem vague or solved by one of the solutions already mentionned (dynamically linking, building on another [virtual] system, rebuilding glibc [which seems quite tricky considering the comments I read about it]) but what I am ultimately looking for are ways to prevent such problems.

例如,是否可以找到哪些版本的 Linux 内核与特定的 glibc 版本兼容?

For instance, is it possible to find which versions of the Linux kernel are compatible with a particular build of glibc ?

更新 2:我最终找到了 glibc 的源补丁(用于 Debian,但我想其他发行版的在线文档也有类似的文档),其中(我猜)包含我正在寻找的信息.

UPDATE 2: I eventually found a source patch for glibc (for Debian but I guess there are similar docs online for other distros) that (I guess) contains the information I was looking for.

从此页面:

--- eglibc-2.11.2.orig/debian/sysdeps/linux.mk
+++ eglibc-2.11.2/debian/sysdeps/linux.mk
@@ -0,0 +1,51 @@
[...]
+MIN_KERNEL_SUPPORTED := 2.6.18
[...]
+# Minimum Kernel supported
+with_headers = --with-headers=$(shell pwd)/debian/include
--enable-kernel=$(call xx,MIN_KERNEL_SUPPORTED)
[...]

这解释了内核太旧"错误.希望它可以帮助其他人.

Which explains the "kernel too old" error. Hope it helps other people.

推荐答案

确定给定 ELF 文件的最低内核版本的一种方法是在其上运行 file,如下所示:

One way you can determine the minimum kernel version for a given ELF file is to run file on it, like so:

$ echo 'int main(){}' > test.c
$ gcc -o test test.c
$ file test
test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.38, not stripped

这里重要的部分是for GNU/Linux 2.6.38",表示最低内核版本.

The important part here is the "for GNU/Linux 2.6.38", which indicates the minimum kernel version.

这篇关于预计“内核太旧"2.6.16 和 2.6.26 内核版本之间的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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