700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > gcc编译报错 fatal error: gnu/stubs-soft.h: No such file or directory问题解决!!

gcc编译报错 fatal error: gnu/stubs-soft.h: No such file or directory问题解决!!

时间:2022-08-28 03:40:49

相关推荐

gcc编译报错 fatal error: gnu/stubs-soft.h: No such file or directory问题解决!!

最近需要为客户平台编译一个工具, 客户提供了交叉编译链过来, 按照以往的编译经验, 找到gcc所在的路径,然后通过

make CROSS_COMPILE= gcc所在路径即可, 但是报错了,提示 fatal error: gnu/stubs-soft.h: No such file or directory 。

具体如下:

ballack@ballack:~/test$ make TARGET=WL CROSS_COMPILE=/home/ballack/1.8.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-make cleanmake[1]: 正在进入目录 `/home/ballack/test'rm -f *.o *.so *.a wl/exe/*.o wl/ppr/src/*.o shared/*.o shared/bcmwifi/src/*.o dhd/exe/*.omake[1]:正在离开目录 `/home/ballack/test'make testmake[1]: 正在进入目录 `/home/ballack/test'/home/ballack/1.8.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/ballack/1.8.1/sysroots/cortexa8hf-vfp-neon-poky-linux-gnueabi -Iinclude -Icommon/include -Ishared/bcmwifi/include -Iwl/exe/ -Iwl/ppr/include -Idhd/exe -g -Wall -DBCMWPA2 -DTARGETENV_android -DLINUX -Dlinux -DRWL_WIFI -DRWL_SOCKET -DRWL_DONGLE -DRWL_SERIAL -DBCMINTERNAL -DBCMDBG -DD11AC_IOTYPES -DPPR_API -DSR_DEBUG -DWLCNT -DWIFI_ACT_FRAME -DWLEXTLOG -DSERDOWNLOAD -DWLTEST -DWLBTAMP -DWLP2P -DWLMCHAN -DWLTDLS -DWLNDOE -DWLP2PO -DWLANQPO -DTRAFFIC_MGMT -DWL11ULB -DBT_WIFI_HANDOVER -DWLWNM -DWLBSSLOAD_REPORT -DWL_NAN -DWL_BTCDYN -DWLPFN -DWLPFN_AUTO_CONNECT -DWLC_HIGH -c -o wl/exe/wlu.o wl/exe/wlu.cIn file included from /home/ballack/1.8.1/sysroots/cortexa8hf-vfp-neon-poky-linux-gnueabi/usr/include/features.h:389:0,from /home/ballack/1.8.1/sysroots/cortexa8hf-vfp-neon-poky-linux-gnueabi/usr/include/sys/types.h:25,from include/typedefs.h:201,from include/wlioctl.h:18,from wl/exe/wlu.c:27:/home/ballack/1.8.1/sysroots/cortexa8hf-vfp-neon-poky-linux-gnueabi/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory# include <gnu/stubs-soft.h>^compilation terminated.make[1]: *** [wl/exe/wlu.o] 错误 1make[1]:正在离开目录 `/home/ballack/test'make: *** [make_wl] 错误 2

查看对方提供的sdk编译说明, 才知道他们编译之前需要source一个文件:

source /home/ballack/1.8.1/environment-setup-cortexa8hf-vfp-neon-poky-linux-gnueabi

查看文件内容, 发现 CC 是需要指定一系列参数的:

export SDKTARGETSYSROOT=/home/ballack/1.8.1/sysroots/cortexa8hf-vfp-neon-poky-linux-gnueabi

export CC="arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=$SDKTARGETSYSROOT"

所以直接使用arm-poky-linux-gnueabi-gcc -o test test.c 是不行的。

解决方法一:

source ./1.8.1/environment-setup-cortexa8hf-vfp-neon-poky-linux-gnueabi

注释掉

#CC = $(CROSS_COMPILE)gcc

然后make即可。

解决方法二:

source ./1.8.1/environment-setup-cortexa8hf-vfp-neon-poky-linux-gnueabi

修改test工具目录下的Makefile中的CC为:

CC=arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/ballack/1.8.1/sysroots/cortexa8hf-vfp-neon-poky-linux-gnueabi

然后make即可。

这样直接make就可以通过了, 搞了好久 ,仅此用来警醒自己, 需要打好基础!!!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。