【sep4020】busybox-1.10.1的交叉编译过程

本文档记录了在Fedora8系统上,使用3.3.2版本的交叉编译器交叉编译Busybox-1.10.1的过程,包括遇到的错误和解决方案。首先,进行make menuconfig,选择静态编译,并设置交叉编译器路径。在编译过程中,由于头文件和编译器版本不匹配导致错误,如linux/watchdog.h解析错误。通过修改配置,禁用无关的Miscellaneous Utilities中的watchdog选项,解决了编译问题。然而,又遇到了网络相关函数未声明的问题,这需要进一步的调查和解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于交叉编译博芯官方提供的busybox 1.10,出现了不少问题,刚好找到一篇出现问题一样的文章

我的平台是fedora8,

交叉编译器:/usr/local/arm/3.3.2/bin/arm-linux-
Busybox版本:busybox-1.10.1.tar.bz2

解压,进入目录,
make menuconfig
Busybox Settings-->Build Options--> Build BusyBox as a static binary (no shared libs) 选上。静态编译,为了以后方便。
在Busybox Settings-->Build Options-->Cross Compiler Prefix
填入交叉编译器路径。这里用3.3.2的版本。
/usr/local/arm/3.3.2/bin/arm-linux-
(注意最后是arm-linux-不多不少)
由于编译器版本,glibc的版本匹配问题,编译过程中可能会出错。有些错误是莫名其妙的。
编译过程中出现了
In file included from miscutils/watchdog.c:13: 
/usr/local/arm/3.3.2/arm-linux/sys-include/linux/watchdog.h:17: error: parse error before "__u32" 
/usr/local/arm/3.3.2/arm-linux/sys-include/linux/watchdog.h:19: error: parse error before "identity" 
/usr/local/arm/3.3.2/arm-linux/sys-include/linux/watchdog.h:20: error: parse error before ''}'' token 
make[1]: *** [miscutils/watchdog.o] 错误 1 
make: *** [miscutils] 错误 2 
可是/usr/local/arm/3.3.2/arm-linux/sys-include/linux/watchdog.h相关行
struct watchdog_info {
__u32 options;  /* Options the card/driver supports */
__u32 firmware_version; /* Firmware version of the card */
__u8  identity[32]; /* Identity of the board */
};
并没有语法错误,解决办法为,去掉相应选项,
make menuconfig
去掉Miscellaneous Utilities  --->里的最后一个watchdog(实际上它是指pc机上的,和我们板子的看门狗没有关系)
继续make
networking/brctl.c: In function `brctl_main'': 
networking/brctl.c:186: error: `SIOCBRADDBR'' undeclared (first use in this function) 
networking/brctl.c:186: error: (Each undeclared identifier is reported on

ly once 
networking/brctl.c:186: error: for each function it appears in.) 
networking/brctl.c:186: error: `S
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值