build 工具链改成gcc后报错

报错内容如下:

[OHOS ERROR] In file included from /home/openharmony/prebuilts/gcc/linux-x86/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/features.h:402:0,
[OHOS ERROR]                  from /home/openharmony/prebuilts/gcc/linux-x86/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/errno.h:28,
[OHOS ERROR]                  from ../../../base/startup/appspawn_lite/services/src/appspawn_message.c:16:
[OHOS ERROR] /home/openharmony/prebuilts/gcc/linux-x86/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory
[OHOS ERROR]  # include <gnu/stubs-soft.h>
[OHOS ERROR]                              ^
[OHOS ERROR] compilation terminated.
[OHOS ERROR] [6/632] ccache arm-linux-gnueabihf-gcc -D_XOPEN_SOURCE=700 -DOHOS_DEBUG -D_FORTIFY_SOURCE=2 -D__linux__ -D__LINUX__ -I../../../base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog -I../../../base/hiviewdfx/hilog_lite/interfaces/native/innerkits -I../../../third_party/bounds_checking_function/include -I../../../third_party/bounds_checking_function/include -fPIC -Os -mfloat-abi=softfp -mfpu=neon-vfpv4 -mfloat-abi=softfp -mfpu=neon-vfpv4 -march=armv7-a -fno-common -fno-builtin -fno-strict-aliasing -Wall -funwind-tables -fasynchronous-unwind-tables -fsigned-char -fstack-protector-all -fPIC -std=c99 -c ../../../base/hiviewdfx/hilog_lite/frameworks/featured/hiview_log.c -o obj/base/hiviewdfx/hilog_lite/frameworks/featured/libhilog_shared.hiview_log.o
[OHOS ERROR] FAILED: obj/base/hiviewdfx/hilog_lite/frameworks/featured/libhilog_shared.hiview_log.o 
[OHOS ERROR] ccache arm-linux-gnueabihf-gcc -D_XOPEN_SOURCE=700 -DOHOS_DEBUG -D_FORTIFY_SOURCE=2 -D__linux__ -D__LINUX__ -I../../../base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog -I../../../base/hiviewdfx/hilog_lite/interfaces/native/innerkits -I../../../third_party/bounds_checking_function/include -I../../../third_party/bounds_checking_function/include -fPIC -Os -mfloat-abi=softfp -mfpu=neon-vfpv4 -mfloat-abi=softfp -mfpu=neon-vfpv4 -march=armv7-a -fno-common -fno-builtin -fno-strict-aliasing -Wall -funwind-tables -fasynchronous-unwind-tables -fsigned-char -fstack-protector-all -fPIC -std=c99 -c ../../../base/hiviewdfx/hilog_lite/frameworks/featured/hiview_log.c -o obj/base/hiviewdfx/hilog_lite/frameworks/featured/libhilog_shared.hiview_log.o
[OHOS ERROR] In file included from /home/openharmony/prebuilts/gcc/linux-x86/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/features.h:402:0,
[OHOS ERROR]                  from /home/openharmony/prebuilts/gcc/linux-x86/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/stdio.h:27,
[OHOS ERROR]                  from ../../../base/hiviewdfx/hilog_lite/frameworks/featured/hiview_log.c:16:
[OHOS ERROR] /home/openharmony/prebuilts/gcc/linux-x86/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory
[OHOS ERROR]  # include <gnu/stubs-soft.h>
[OHOS ERROR]                              ^
[OHOS ERROR] compilation terminated.
[OHOS ERROR] you can check build log in /home/openharmony/out/MyBoard/My_Product_demo/build.log
[OHOS ERROR] command: "/home/openharmony/prebuilts/build-tools/linux-x86/bin/ninja -w dupbuild=warn -C /home/openharmony/out/MyBoard/My_Product_demo -v" failed
[OHOS ERROR] return code: 1
[OHOS ERROR] execution path: /home/openharmony

根据。。。。查找资料得出gcc编译报错,fatal error: gnu/stubs-soft.h: No such file or directory问题解决!!_ballack_linux的博客-CSDN博客_stubs-soft.h

把这个改成

# Board related common compile flags.
board_cflags = [
  "-mfpu=neon-vfpv4",
  "-mfloat-abi=hard",
]
board_cxx_flags = [
  "-mfpu=neon-vfpv4",
  "-mfloat-abi=hard",  
]
board_ld_flags = []

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

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

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值