【问题标题】:gcc: error: unrecognized argument in option ‘-mabi=64’gcc:错误:选项'-mabi = 64'中的参数无法识别
【发布时间】:2015-01-22 18:05:53
【问题描述】:

在 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      

【问题讨论】:

  • 检查 uname -a 为您返回的内容。强烈建议安装所有可用的更新。另外,你有没有试过编译内核?
  • uname 返回以下 [root@localhost linux-3.15.6]# uname -a Linux localhost.localdomain 3.17.8-200.fc20.x86_64 #1 SMP Thu Jan 8 23:26:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux。我是第一次安装和编译,我已经执行了yum update

标签: linux gcc linux-kernel kernel


【解决方案1】:

从您的uname -a 输出中,我可以看到您正在使用x86-64 (also known as x64, x86_64, AMD64 and Intel 64,这是一台基于 CISC 架构的 Intel 机器。

-mabi 是 ARM 和 MIPS 处理器常用的 RISC-V 架构的一部分。

欲了解更多信息,请通过以下链接。

以上链接仅供您理解。要基本上解决错误,您需要在 make 时删除这些选项,因为您使用的是 Intel 处理器并且不需要这些选项。您必须在 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

【讨论】:

    猜你喜欢
    • 2020-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-26
    • 2020-02-03
    • 2021-10-04
    • 2020-04-20
    相关资源
    最近更新 更多