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

时间:2023-01-26 12:26:50

I am trying to build 32-bit linux kernel 2.6.9 on a 64-bit linux host with 2.6.9 (same version). Did some google search and tried the following:

我正在尝试在一个64位linux主机上构建32位的linux内核2.6.9,并使用2.6.9(相同的版本)。进行了谷歌搜索,并尝试了以下步骤:

step 1) make ARCH=i386 CFLAGS=-m32 menuconfig

步骤1)制作ARCH=i386 CFLAGS=-m32 menuconfig。

step 2) make ARCH=i386 CFLAGS=-m32

步骤2)制作ARCH=i386 CFLAGS=-m32。

Step 1 was okay. But step 2 got the following errors. What did I do wrong?

步骤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 个解决方案

#1


1  

The make ARCH=i386 should be sufficient assuming you have everything required by the build installed on the machine. I use this almost daily to build i386 on a "ubuntu 12.04".

如果您拥有在机器上安装的构建所需的一切,那么make ARCH=i386应该足够了。我几乎每天都用它在“ubuntu 12.04”上构建i386。

If you have built a 64-bit kernel previously, you should have everything, and it's possible that you need to "make clean" or even "make mrproper" [save your .config somewhere safe for the latter], because I know for example asm_offsets.s will be different between 32 and 64-bit.

如果您之前已经构建了64位内核,那么您应该拥有一切,并且您可能需要“进行清理”,甚至“让mrproper”(为后者保存您的.config),因为我知道例如asm_偏移。在32位和64位之间是不同的。

#1


1  

The make ARCH=i386 should be sufficient assuming you have everything required by the build installed on the machine. I use this almost daily to build i386 on a "ubuntu 12.04".

如果您拥有在机器上安装的构建所需的一切,那么make ARCH=i386应该足够了。我几乎每天都用它在“ubuntu 12.04”上构建i386。

If you have built a 64-bit kernel previously, you should have everything, and it's possible that you need to "make clean" or even "make mrproper" [save your .config somewhere safe for the latter], because I know for example asm_offsets.s will be different between 32 and 64-bit.

如果您之前已经构建了64位内核,那么您应该拥有一切,并且您可能需要“进行清理”,甚至“让mrproper”(为后者保存您的.config),因为我知道例如asm_偏移。在32位和64位之间是不同的。