编译busybox的笔记

来源:互联网 发布:php简历模板免费下载 编辑:程序博客网 时间:2024/06/09 05:16




for 平台: imx6dl sarasb

busybox 版本 : 1.26.2


交叉编译步骤:


按照 nxp community 的步骤,  https://community.nxp.com/docs/DOC-95046   , 下载解压后, 


先 source  poky 工具链环境变量, 然后

make defconfig

接着把 .config 里面的 CONFIG_STATIC=y , 进行静态链接.


然后 make 


编译过程会有错误,

我是直接修改 Makefile 来解决问题,

1 /  将 CC 添加内容:

CC= $(CROSS_COMPILE)gcc -mfloat-abi=hard  -L/opt/fsl-imx-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib

CFLAGS:= $(CFLAGS) -D__ARM_PCS_VFP -I/opt/fsl-imx-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include -L/home/zoe/fsl-release-bsp/build_dl_upt/tmp/sysroots/imx6dlsabresd/usr/lib --sysroot=/opt/fsl-imx-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi

如果无法找到 静态链接需要的  libm.a  , 就 加入:


-L/home/zoe/fsl-release-bsp/build_dl_upt/tmp/sysroots/imx6dlsabresd/usr/lib  这个库在文件系统的目录里,没有打包在发行的SDK工具链包中,这是有点奇葩的

编译出来的busybox  strip 之后, 1.8M


放到板子里面,   做符号链接, 例如 ln -s busybox ftpd ,然后就可以运行 ftpd 了....




0 0
原创粉丝点击