snifer

【原创】嵌入式交叉工具链的安装及应用

0
阅读(2658)

今天跟一个朋友交流了半天的linux交叉工具链的安装,这个过程很重要,关乎以后编译的成败,特意写出来,与大家分享。

开发环境就是如下,最近买了块FARsight的教学板。

1、  ubuntu 10.10发行版

2、  FS_S5PC100平台

       1、如果要自己编译工具链,从以下链接下载源码

       crosstools-ng下载地址

http://ymorin.is-a-geek.org/download/crosstool-ng/

       同时对每一个版本都有相应的补丁我们尽量把这些补丁打上,这些补丁的下载地址是

http://ymorin.is-a-geek.org/download/crosstool-ng/01-fixes/

 

2、工具的安装

在使用之前先安装下列软件

$ sudo  apt-get  install  gawk  autotools-dev  automake  texinfo  libtool  cvs  patch  bison  flex  libncurses5-dev

也可以在本地安装,前提是需要下载下来。

$ sudo  dpkg  -i  tools/*.deb

 

1、   解压工具链压缩包

$  cd  ~

$ tar  xvf  arm-none-linux-gnueabi.tar.bz2

$ mv  arm-2010.09  toolchain

 

2、   环境变量的添加

修改文件/etc/bash.bashrc添加如下内容

export  PATH=$PATH:/home/linux/toolchain/bin

重启配置文件

$ source  /etc/bash.bashrc

 

3、   工具链的测试

$ arm-none-linux-gnueabi-gcc  –v

Using built-in specs.

Target : arm-none-linux-gnueabi

Configured with: /home/linux/src/gcc-4.5.1/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-none-linux-gnueabi --prefix=/home/linux/toolchain --with-sysroot=/home/linux/toolchain/arm-none-linux-gnueabi//sys-root --enable-languages=c,c++,fortran --disable-multilib --with-arch=armv5te    --with-float=soft --with-pkgversion=crosstool-NG-1.8.1-none --disable-sjlj-exceptions --enable-__cxa_atexit --disable-libmudflap --with-gmp=/home/linux/toolchain/toolchain-build/targets/arm-none-linux-gnueabi/build/static --with-mpfr=/home/linux/ toolchain/toolchain-build/targets/arm-none-linux-gnueabi/build/static --enable-threads=posix --enable-target-optspace --with-local-prefix=/home/linux/toolchain/arm-none-linux-gnueabi//sys-root --disable-nls --enable-symvers=gnu --enable-c99 --enable-long-long

Thread model: posix

gcc version 4.5.1 (Sourcery  G++  Lite)

这个时候我们的交叉工具链就安装好了,如果有疑问,可以给我发站内信。