在64位Linux主机上构建32位Linux内核时出错

时间:2013-01-09 01:03:36

标签: linux kernel

我正在尝试在2.6.9(相同版本)的64位Linux主机上构建32位Linux内核2.6.9。做了一些谷歌搜索并尝试了以下内容:

步骤1)使ARCH = i386 CFLAGS = -m32 menuconfig

步骤2)使ARCH = i386 CFLAGS = -m32

第1步没问题。但是第2步出现了以下错误。我做错了什么?

make ARCH=i386 CFLAGS=-m32 
< snip >
In file included from include/asm/smp.h:18,
                 from include/linux/smp.h:17,
                 from include/linux/sched.h:23,
                 from arch/i386/kernel/asm-offsets.c:7:
include/asm/mpspec.h:6:25: mach_mpspec.h: No such file or directory
In file included from include/asm/smp.h:18,
                 from include/linux/smp.h:17,
                 from include/linux/sched.h:23,
                 from arch/i386/kernel/asm-offsets.c:7:
include/asm/mpspec.h:8: error: `MAX_MP_BUSSES' undeclared here (not in a function)
include/asm/mpspec.h:22: error: `MAX_IRQ_SOURCES' undeclared here (not in a function)
In file included from include/linux/smp.h:17,
                 from include/linux/sched.h:23,
                 from arch/i386/kernel/asm-offsets.c:7:
include/asm/smp.h:72:26: mach_apicdef.h: No such file or directory
make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1
make: *** [arch/i386/kernel/asm-offsets.s] Error 2

1 个答案:

答案 0 :(得分:1)

假设您拥有计算机上安装的构建所需的所有内容,make ARCH=i386就足够了。我几乎每天使用它来在“ubuntu 12.04”上构建i386。

如果您之前已经构建了64位内核,那么您应该拥有所有内容,而且您可能需要“干净”甚至“make mrproper”[将.config保存到后者安全的地方],因为我例如,asm_offsets.s将在32位和64位之间有所不同。