自己制作arm-linux交叉编译环境(二)-crosstool篇

crosstool是个不错的软件,能够很方便的编译自己的交叉编译环境

我们要编译的环境为gcc-3.4.4-glibc-2.3.2,但采用gdb-6.6,binutils-2.17

crosstool-0.43 : http://kegel.com/crosstool/crosstool-0.43.tar.gz

编译前需要安装一些软件:

sudo apt-get install build-essential
sudo apt-get install bison flex

配置crosstool

arm.dat:
  
  KERNELCONFIG = `pwd` / arm.config
  TARGET
= arm - linux         #交叉编译软件的前缀,如arm - linux - gcc
  TARGET_CFLAGS
= " -O "

demo-arm.sh:
   
# !/ bin / sh
# This script has one line 
for  each known working toolchain
for   this  architecture.  Uncomment the one you want.
# Generated by generate
- demo.pl from buildlogs / all.dats.txt

set   - ex
TARBALLS_DIR
= $HOME / downloads     #下载的软件包存放的地址
RESULT_TOP
=/ opt / crosstool                #交叉编译环境安装在哪里
export TARBALLS_DIR RESULT_TOP
GCC_LANGUAGES
= " c,c++ "
export GCC_LANGUAGES

# Really, you should 
do  the mkdir before running  this ,
# and chown 
/ opt / crosstool to yourself so you don ' t need to run as root.
mkdir  - p $RESULT_TOP

#eval `cat arm.dat gcc
- 2.95 . 3 - glibc - 2.1 . 3 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 2.95 . 3 - glibc - 2.2 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 2.95 . 3 - glibc - 2.2 . 5 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.2 . 3 - glibc - 2.2 . 5 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.2 . 3 - glibc - 2.3 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.2 . 3 - glibc - 2.3 . 2 - tls.dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.3 . 6 - glibc - 2.2 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.3 . 6 - glibc - 2.2 . 5 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.3 . 6 - glibc - 2.3 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.3 . 6 - glibc - 2.3 . 2 - tls.dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.4 . 5 - glibc - 2.2 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.4 . 5 - glibc - 2.2 . 5 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.4 . 5 - glibc - 2.3 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.4 . 5 - glibc - 2.3 . 2 - tls.dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.4 . 5 - glibc - 2.3 . 5 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.4 . 5 - glibc - 2.3 . 5 - tls.dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.4 . 5 - glibc - 2.3 . 6 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 3.4 . 5 - glibc - 2.3 . 6 - tls.dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.0 . 2 - glibc - 2.2 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.0 . 2 - glibc - 2.3 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.0 . 2 - glibc - 2.3 . 2 - tls.dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.0 . 2 - glibc - 2.3 . 5 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.0 . 2 - glibc - 2.3 . 5 - tls.dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.0 . 2 - glibc - 2.3 . 6 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.0 . 2 - glibc - 2.3 . 6 - tls.dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.1 . 0 - glibc - 2.2 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.1 . 0 - glibc - 2.3 . 2 .dat` sh all.sh  -- notest
#eval `cat arm.dat gcc
- 4.1 . 0 - glibc - 2.3 . 2 - tls.dat` sh all.sh  -- notest
eval `cat arm.dat gcc
- 3.4 . 4 - glibc - 2.3 . 2 .dat` sh all.sh  -- notest            #这是我们要编译的交叉环境的版本

echo Done.

 gcc-3.4.4-glibc-2.3.2.dat :
 
BINUTILS_DIR=binutils-2.17
GCC_DIR=gcc-3.4.4
GLIBC_DIR=glibc-2.3.2
LINUX_DIR=linux-2.6.8
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
GCC_CORE_DIR=gcc-3.3.6
GDB_DIR=gdb-6.6

 最后在用户模式下执行demo-arm.sh就可以了

./demo-arm.sh
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值