> 文档中心 > build 工具链改成gcc后报错

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 [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 [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

虫部落快搜