编译 Linux 内核时出现“未编译 64 位模式”错误

编译 Linux 内核时出现“未编译 64 位模式”错误

我正在从 CentOS 源代码构建 2.6.18。

我正按照他们的说明进行构建过程的最后一步,但似乎出现了我无法理解的错误。

我遵循的说明: http://wiki.centos.org/HowTos/Custom_Kernel

我运行了... [user@host SPECS]$ rpmbuild -bb --target= uname -mkernel.spec 2> build-err.log | tee build-out.log

并得到……

[...]

Patch #20239 (xen-vtd-let-iommu-use-another-irq-without-conflict.patch):
Patch #20240 (xen-hvm-add-hvmop_get_time-hypercall.patch):
Patch #20241 (xen-fix-64-bit-pv-guest-user-mode-segv-crashing-host.patch):
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.57640
cc     linux-2.6.18.x86_64/scripts/bin2c.c   -o linux-2.6.18.x86_64/scripts/bin2c
make -f Rules.mk _build
make[1]: Entering directory `/home/~~~~/rpmbuild/BUILD/kernel-2.6.18/xen'
make -C include/public/foreign
make[2]: Entering directory `/home/~~~~/rpmbuild/BUILD/kernel-2.6.18/xen/include/public/foreign'
python mkheader.py x86_32 x86_32.h ../arch-x86/xen-x86_32.h ../arch-x86/xen.h ../xen.h
python mkheader.py x86_64 x86_64.h ../arch-x86/xen-x86_64.h ../arch-x86/xen.h ../xen.h
python mkheader.py ia64 ia64.h ../arch-ia64.h ../xen.h
python mkchecker.py x86_64 checker.c x86_32 x86_64 ia64
gcc -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -m64        
-Wdeclaration-after-statement -o checker checker.c
make[2]: Leaving directory `/home/~~~~/rpmbuild/BUILD/kernel-2.6.18/xen/include/public/foreign'
make[1]: Leaving directory `/home/~~~~/rpmbuild/BUILD/kernel-2.6.18/xen'

RPM build errors:

我不知道为什么“RPM 构建错误”后没有有用的消息。运行上述 rpmbuild 命令后,我应该看到在 ~/rpmbuild/RPMS/ uname -m/ 目录中生成的“自定义内核 rpm 文件”。但我在该文件夹中没有看到任何内容。

以下是我在 build-err.log 中看到的内容:

gpg: WARNING: unsafe permissions on homedir `.'
gpg: keyring `./secring.gpg' created
gpg: keyring `./pubring.gpg' created
  ++++++++++.++++++++++++++++++++.+++++.+++++.++++++++++++++++++++.++++++++++++++++++++.+++++++++++++++++++++++++++++++++++..+++++++++++++++>++++++++++....................................................................................................................+++++

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 275 more bytes)
+ gpg --homedir . --export --keyring ./kernel.pub CentOS
gpg: WARNING: unsafe permissions on homedir `.'
+ make linux-2.6.18.x86_64/scripts/bin2c
+ linux-2.6.18.x86_64/scripts/bin2c ksign_def_public_key __initdata
+ rm -rf /var/tmp/kernel-2.6.18-238.9.1.el5.local-root
+ mkdir -p /var/tmp/kernel-2.6.18-238.9.1.el5.local-root/boot
+ cd xen
+ mkdir -p /var/tmp/kernel-2.6.18-238.9.1.el5.local-root/boot /var/tmp/kernel-    
2.6.18-238.9.1.el5.local-root/boot
+ make -j2 verbose=y crash_debug=y max_phys_cpus=256 XEN_VENDORVERSION=-238.9.1.el5.local
checker.c:1: sorry, unimplemented: 64-bit mode not compiled in
make[2]: *** [checker] Error 1
make[1]: *** [build-headers] Error 2
make: *** [build] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.57640 (%build)
Bad exit status from /var/tmp/rpm-tmp.57640 (%build)

答案1

看起来您正在尝试在 32 位平台(或仅具有 32 位开发工具链的平台)上交叉编译 64 位内核。您安装的工具链(或如果您有多个,则您选择的工具链)不支持 64 位目标。

相关内容