我正在 64 位 linux 主机上构建 32 位 linux 内核。(主机和目标上的版本 2.6.9)。我正在执行以下操作:
make ARCH=i386 CFLAGS='-m32 -Iinclude/asm/mach-default' ASFLAGS='-march=i386 --32'
即使我为 make 指定了 ASFLAGS,我仍然收到以下警告和错误:
AS usr/initramfs_data.o
LD usr/built-in.o
ld: warning: i386:x86-64 architecture of input file `usr/initramfs_data.o' is incompatible with i386 output
<snip>
AS arch/i386/kernel/entry.o
arch/i386/kernel/entry.S: Assembler messages:
arch/i386/kernel/entry.S:145: Error: suffix or operands invalid for `pushf'
entry.S:145 处的代码是:
pushfl # We get a different stack layout with call
# gates, which has to be cleaned up later..
有什么想法可以确保 AS 使用的是 i386(32 位),而不是 x86_64?
谢谢。