0

我正在尝试在具有 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
4

1 回答 1

1

假设您已经在机器上安装了构建所需的一切,这make ARCH=i386应该足够了。我几乎每天都使用它在“ubuntu 12.04”上构建 i386。

如果您之前构建了一个 64 位内核,那么您应该拥有一切,并且您可能需要“make clean”甚至“make mrproper”[将您的 .config 保存在对后者安全的地方],因为我知道例如asm_offsets.s 在 32 位和 64 位之间会有所不同。

于 2013-01-09T09:32:26.397 回答