fatal error: 'gnu/stubs-soft.h' file not found

转载地址:https://blog.csdn.net/yellow_hill/article/details/51525821

这个编译宏的意思是, __VFP_FP__ which merely indicates presence of VFP unit 表示当前硬件能否支持。VFP是ARM某些芯片的浮点运算模块,不是所有的都有。

报错往往是找不到硬件定义,

[plain]  view plain  copy
  1. clang -mfpu=vfp -mfloat-abi=hard test.c  
  2. In file included from test.c:1:  
  3. In file included from /usr/include/stdio.h:27:  
  4. In file included from /usr/include/features.h:399:  
  5. /usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-soft.h' file not found  
  6. # include <gnu/stubs-soft.h>  
  7.           ^  
  8. 1 error generated.  

或者

[plain]  view plain  copy
  1. : No such file or directory  
  2.  # include <gnu/stubs-hard.h>  

cc has a builtin define to denote hard abi when in use, e.g. when using -mfloat-abi=hard it will define __ARM_PCS_VFP to 1 and therefore we should check that to determine which calling convention is in use and not __VFP_FP__ which merely indicates presence of VFP unit

这些其实是在编译选项里面设定的,如果你傻傻的去找 __ARM_PCS_VFP那就很惨了,你会完全没有头绪。

其实只需要修改编译参数,-mfloat-abi=hard 或者 -mfloat-abi=soft


2 -mfpu=neon

ARM cotext9 这个模块是可选的,那么如果编译的时候使能了这个选项,会造成运行的时候指令错误的提示。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值