龙芯loongson1:buildroot-2016.02制作龙芯1mips32交叉工具链

下载:
  https://buildroot.org/download.html
  最新版本是 buildroot-2016.02.tar.bz2

  上传的资源:https://download.csdn.net/download/damifeng/10824058

编译:
  cd /home/loongson/tools/buildroot/
  tar -xvf buildroot-2016.02.tar.bz2
  cd buildroot-2016.02

  注意:buildroot编译过程中会生成一个dl目录,用于存放联网下载所需工具,
  如果网络比较慢的话下载时间比较长。所以把网盘中dl整个目录复制到解压后的buildroot-2016.02下,这样buildroot编译时就不用再下载了,
  节省时间。
  cp -r /mnt/dl ./

  把配置文件buildroot-2016.02-glibc-gcc-4.9.x-mips32-nofpu_defconfig(这个是我自己配置好的)复制到解压后的buildroot-2016.02下,并重命名为.config
  cp /mnt/buildroot-2016.02-glibc-gcc-4.9.x-mips32-nofpu_defconfig .config
  make menuconfig
  保存退出
  make

  buildroot-2016.02-glibc-gcc-4.9.x-mips32-nofpu_defconfig的配置文件选择了 MIPS (little endian),mips 32版本
  Use soft-float,C库选择了glibc,gcc-4.9.x,
  如果编译Linux-3.0版本的内核,需要选择gcc-4.7.x的,因为较旧的内核对新版本的gcc还没有支持

  经过比较长时间的等待,buildroot编译完毕。
  编译后buildroot-2016.02目录下会生成一个output目录,工具链就在该目录下
  修改环境变量
  export PATH=/home/loongson/tools/buildroot/buildroot-2016.02/output/host/usr/bin:$PATH
  即可使用该交叉工具链来编译程序

  /output/target/lib(/output/staging/)目录下存放了交叉工具链的C库等工具,可以把需要的库复制到开发板的跟文件系统的/lib目录下,某些应用可能需要这些库。

  注意:主机需要安装G++,另外编译过程中可能会出现错误,比如主机缺少某些工具,按照错误提示安装工具就可以了。


以下是具体的配置说明,buildroot-2016.02的龙芯1的交叉工具链配置如下:

 Target options  --->
   Target Architecture (MIPS (little endian))  --->
   Target Binary Format (ELF)  --->
   Target Architecture Variant (mips 32)  --->
  [*] Use soft-float

 Build options  --->
   该目录下使用默认配置即可
   其中
   Mirrors and Download locations  --->
     (http://mirrors4.ustc.edu.cn/gnu) GNU Software mirror
   这里把GNU Software mirror的地址修改为国内的镜像地址,加快下载速度。

 Toolchain  --->
       Toolchain type (Buildroot toolchain)  --->
   (buildroot) custom toolchain vendor name
       *** Kernel Header Options ***
       Kernel Headers (Linux 3.18.x kernel headers)  --->
       C library (glibc)  --->
       glibc version (2.22)  --->
       *** Binutils Options ***
       Binutils Version (binutils 2.24)  --->
   ()  Additional binutils options
       *** GCC Options ***
       GCC compiler Version (gcc 4.9.x)  --->
   ()  Additional gcc options
   [*] Enable C++ support
   [ ] Enable Fortran support
   [*] Enable compiler link-time-optimization support
   [ ] Enable compiler OpenMP support
   [ ] Enable graphite support
   [ ] Build cross gdb for the host
   [ ] Purge unwanted locales
   ()  Generate locale data
   [ ] Copy gconv libraries
   ()  Target Optimizations
   ()  Target linker options
   [ ] Register toolchain within Eclipse Buildroot plug-in

   这里选择了glibc配置如上,如果uglib的话编译对某些应用会有问题,会出现不能使用的情况,建议不要选择。

 System configuration  --->
   (buildroot) System hostname
   (Welcome to Buildroot) System banner
       Passwords encoding (md5)  --->
       Init system (None)  --->
       /dev management (Dynamic using devtmpfs only)  --->
   (system/device_table.txt) Path to the permission tables
       Root FS skeleton (default target skeleton)  --->
   [ ] Use symlinks to /usr for /bin, /sbin and /lib
   [ ] Enable root login with password
       /bin/sh (none)  --->
   [ ] Run a getty (login prompt) after boot  ----
   [ ] remount root filesystem read-write during boot
       *** automatic network configuration via DHCP needs ifupdown or busybox ***
   [ ] Install timezone info
   ()  Path to the users tables
   ()  Root filesystem overlay directories
   ()  Custom scripts to run before creating filesystem images
   ()  Custom scripts to run after creating filesystem images

   这里不用busybox制作跟文件系统,所以Init system (None)选择None

 以下选项包括子目录选项全部选择空
 Kernel  --->
 Target packages  --->
 Filesystem images  --->
 Bootloaders  --->
 Host utilities  --->
 Legacy config options  --->

 buildroot的选项的详细说明可到网上搜索参考,buildroot的使用也可以到网上搜索参考。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值