mtk8516平台基于yocto的系统构建,在对于bluetooth部分,Makefile的生成和构建是基于ninja、gn 在我的平台中遇到如下报错,
/home/space/mtk8516/yocto_mt8516_git/build/tmp/work/aarch64-poky-linux/bluetooth-vendor/1.0-r0/recipe-sysroot/usr/include/features.h:376:4: warning:
^~~~~~~
[18/23] LINK boots
FAILED: boots
aarch64-poky-linux-g++ -mcpu=cortex-a72.cortex-a53+crypto -mtune=cortex-a72.cortex-a53 --sysroot=/home/aispeech/aispeech_space/mtk8516/yocto_mt8516_git/build/tmp/work/aarch64-poky-linux/bluetooth-vendor/1.0-r0/recipe-sysroot -Wl,--gc-sections -o boots -Wl,--start-group @boots.rsp -Wl,--end-group -l-lpthread
/home/aispeech/aispeech_space/mtk8516/yocto_mt8516_git/build/tmp/work/aarch64-poky-linux/bluetooth-vendor/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/ld: cannot find -l-lpthread
collect2: error: ld returned 1 exit status
[19/23] CC obj/boots_srv.boots_script.o
In file included from /home/aispeech/aispeech_space/mtk8516/yocto_mt8516_git/build/tmp/work/aarch64-poky-linux/bluetooth-vendor/1.0-r0/recipe-sysroot/usr/include/sys/types.h:25:0,
from ../../boots_script.c:39:
/home/space/mtk8516/yocto_mt8516_git/build/tmp/work/aarch64-poky-linux/bluetooth-vendor/1.0-r0/recipe-sysroot/usr/include/features.h:376:4: warning:
^~~~~~~
[20/23] CC obj/boots_srv.boots_common.o
In file included from /home/aispeech/aispeech_space/mtk8516/yocto_mt8516_git/build/tmp/work/aarch64-poky-linux/bluetooth-vendor/1.0-r0/recipe-sysroot/usr/include/bits/libc-header-start.h:33:0,
from /home/aispeech/aispeech_space/mtk8516/yocto_mt8516_git/build/tmp/work/aarch64-poky-linux/bluetooth-vendor/1.0-r0/recipe-sysroot/usr/include/stdio.h:27,
from ../../boots_common.c:40:
/home/space/mtk8516/y
基于以上报错信息可以看到: cannot find -l-lpthread 导致的error,这里会很奇怪?? 为什么会出现-l-lpthread? 通过测试于分析发现,是ninja 的版本 过高导致的问题, 也就是不同版本的ninja对应的语法是有差异的!! 知道了这一点后,找到了能编译过的电脑将对应的ninja和gn命令拷贝的本机中,然后重新编译工程!
|