前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >编译busybox错误汇总

编译busybox错误汇总

作者头像
嵌入式与Linux那些事
发布2021-05-20 10:23:44
1.4K0
发布2021-05-20 10:23:44
举报

提示错误: arm-linux-gcc:Command not found PATH里有/usr/oca/arm/bin,但是make的时候,就是找不到 arm-linux-gcc 原因: export PATH=$PATH:/usr/local/arm/bin是设置当前用户的PATH,而sudo执行make的时候,使用的是超级用户权限,那也就使用了超级用户的PATH(但是这个PATH里,并没有/usr/ local/arm/bin)

解决办法: 先打开一个超级用户权限的 sudo -s 在当前模式下,设置环境变量export PATH=$PATH /usr/local/arm/bin,再进入到busybox目录, make CONFIG_PREFIX=/work/nfs_root/first_fs install,就成功安装busybox了。

提示错误: /home/book/work/busybox-1.7.0/scripts/gcc-version.sh: line 11: arm-linux-gcc: command not found /home/book/work/busybox-1.7.0/scripts/gcc-version.sh: line 11: arm-linux-gcc: command not found CC applets/applets.o /bin/sh: 1: arm-linux-gcc: not found scripts/Makefile.build:192: recipe for target ‘applets/applets.o’ failed make[1]: *** [applets/applets.o] Error 127 Makefile:701: recipe for target ‘applets’ failed make: *** [applets] Error 2

原因: 交叉编译器的绝对路径与相对路径问题

解决办法: 在busybox的顶层Makefile 176行 CROSS COMPILE ?= 中添加/work/tools/gcc-3.4.5-glibc-2.3.6/bin/arm-linux-的绝对路径就成功了。(为什么以前用arm-linux-就可以自己找到?)

提示错误: CC applets/applets.o In file included from include/busybox.h:10, from applets/applets.c:16: include/libbb.h:15: error: syntax error before ‘<’ token In file included from /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/sys-include/dirent.h:62, from include/libbb.h:16, from include/busybox.h:10, from applets/applets.c:16: /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/sys-include/bits/dirent.h:35: error: syntax error before ‘}’ token applets/applets.c: In function get_trimmed_slice': applets/applets.c:102: warning: implicit declaration of functionisspace’ scripts/Makefile.build:192: recipe for target ‘applets/applets.o’ failed make[1]: *** [applets/applets.o] Error 1 Makefile:701: recipe for target ‘applets’ failed make: *** [applets] Error 2 原因: 缺少必要头文件 解决办法: 修改busybox中的源码:include/libbb.h 中,增加一行#include <sys/resource.h>。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-04-14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档