欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > linux >内容正文

linux

arm-buildroot-linux-,buildroot构建交叉编译工具链,根文件系统

发布时间:2025/5/22 linux 99 豆豆
生活随笔 收集整理的这篇文章主要介绍了 arm-buildroot-linux-,buildroot构建交叉编译工具链,根文件系统 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

支持多种处理器,arch,avr32,mips,x86等等,在arch/目录可查看。

buildroot可使用make menuconfig进行配置,选择需要编译到目标文件系统的包,相关的配置文件在configs目录下。

在board目录下可以添加一些构建文件系统所需的额外配置或库,这些在make menuconfig时指定,编译完成或拷贝到根文件系统中, 这个可以避免单独去编译安装第三方库文件,很方便。

dl目录用来存放编译过程需要使用的源码。

output目录,用来存放编译后的目标文件,像编译生成的交叉工具链在output/host/usr/目录,编译过程中解压后使用源码包在output/build/目录,编译后生成的目标文件系统和配置文件所需的库和应用程序在output/target/目录。

下载buildroot最新版buildroot-2013.08

解压源码包

tar xvzf buildroot-2013.08.tar.gz

拷贝一个现有的配置文件进行配置

cp configs/mini2440_defconfig .config

make menuconfig

可以配置字节序、指令集、浮点处理类型、CPU核心、uclibc版本、内核版本、主机名,登录密码、busybox版本、构建的交叉编译器版本、根文件系统的打包类型、目标文件系统需要用到各种包、board目录下的外部文件、等等。

编译

make

编译可能会出错,什么什么未安装,apt-get install安装好重新编译

如果是编译过程中需要下载什么包,但是停在那儿下载不了,需要重新配置buildroot的包下载地址

Build options  --->

Mirrors and Download locations  --->

下添加后重新编译即可

编译完成查看output/host/usr/目录下已经生成了交叉编译工具链

buildroot-2013.08/output/host/usr/bin# ./arm-buildroot-linux-uclibcgnueabi-gcc -v

Using built-in specs.

COLLECT_GCC=./arm-buildroot-linux-uclibcgnueabi-gcc

COLLECT_LTO_WRAPPER=/opt/buildroot-2013.08/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.7.3/lto-wrapper

Target: arm-buildroot-linux-uclibcgnueabi

Configured with: ./configure --prefix=/opt/buildroot-2013.08/output/host/usr --sysconfdir=/opt/buildroot-2013.08/output/host/etc --enable-shared --disable-static --disable-gtk-doc --disable-doc --disable-docs --disable-documentation --with-xmlto=no --with-fop=no --target=arm-buildroot-linux-uclibcgnueabi --with-sysroot=/opt/buildroot-2013.08/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --with-gmp=/opt/buildroot-2013.08/output/host/usr --with-mpfr=/opt/buildroot-2013.08/output/host/usr --enable-target-optspace --disable-libquadmath --enable-tls --enable-threads --with-mpc=/opt/buildroot-2013.08/output/host/usr --with-float=soft --disable-decimal-float --with-arch=armv4t --with-tune=arm920t --with-abi=aapcs-linux --with-float=soft --with-mode=arm --with-pkgversion='Buildroot 2013.08' --with-bugurl= --enable-languages=c --disable-largefile --disable-nls

Thread model: posix

gcc version 4.7.3 (Buildroot 2013.08)

output/target下已经生成了根文件系统

output/target# ls

bin  etc   lib    media  opt   root  sbin  THIS_IS_NOT_YOUR_ROOT_FILESYSTEM  usr

dev  home  lib32  mnt    proc  run   sys   tmp                               var

总结

以上是生活随笔为你收集整理的arm-buildroot-linux-,buildroot构建交叉编译工具链,根文件系统的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。