【嵌入式开发基础】在mtk8516平台,使用ninja gn进行蓝牙模块编译时报错!

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命令拷贝的本机中,然后重新编译工程!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值