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: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^~~~~~~
[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: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^~~~~~~
[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命令拷贝的本机中,然后重新编译工程!

GitHub 加速计划 / ni / ninja
4
0
下载
a small build system with a focus on speed
最近提交(Master分支:4 个月前 )
048a68df Use Lowercase Headers for Cross-Compiling Windows Targets 26 天前
cc4ce1f9 This update ensures consistency in using lowercase headers across the codebase for cross-compiling Windows targets. 29 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐