在安装在vmware工作站11上的Fedora 20上编译内核3.15.6时,反复出现错误
[root@localhost linux-3.15.6]# make
gcc: error: unrecognized argument in option ‘-mabi=64’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: 0: No such file or directory
gcc: error: unrecognized command line option ‘-G’
gcc: error: unrecognized command line option ‘-mno-abicalls’
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
gcc: error: unrecognized argument in option ‘-mabi=64’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: 0: No such file or directory
gcc: error: unrecognized command line option ‘-G’
gcc: error: unrecognized command line option ‘-mno-abicalls’
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
答案 0 :(得分:1)
从您的uname -a
输出中,您可以看到您正在使用x86-64 (also known as x64, x86_64, AMD64 and Intel 64
,它是Intel计算机,基于CISC架构。
-mabi
是RISC-V体系结构的一部分,通常被ARM和MIPS处理器使用。
有关更多信息,请通过下面的链接。
以上链接供您理解。要解决该错误,基本上在执行make时需要删除这些选项,因为您使用的是英特尔处理器并且不需要这些选项。您必须在CFLAGS参数中提供了这些选项。
如果要对X86_64使用类似的选项,请Link
在同时支持32位和64位模式的AMD64 (‘x86_64’)
系统上,可以使用以下ABI选项。
ABI = 64
The 64-bit ABI uses 64-bit limbs and pointers and makes full use of the chip architecture. This is the default. Applications will usually not need special compiler flags, but for reference the option is
gcc -m64
ABI = 32
The 32-bit ABI is the usual i386 conventions. This will be slower, and is not recommended except for inter-operating with other code not yet 64-bit capable. Applications must be compiled with
gcc -m32
(In GCC 2.95 and earlier there’s no ‘-m32’ option, it’s the only mode.)
ABI = x32
The x32 ABI uses 64-bit limbs but 32-bit pointers. Like the 64-bit ABI, it makes full use of the chip’s arithmetic capabilities. This ABI is not supported by all operating systems.
gcc -mx32