crosstool-ng制作交叉编译工具链(powerpc-linux)

本文介绍了如何使用crosstool-ng工具构建powerpc-linux的交叉编译工具链。从下载crosstool-ng源码、配置、编译、安装到错误处理,详细步骤逐一展开,包括安装依赖、创建软链接和打包工具链等过程。
摘要由CSDN通过智能技术生成
 

2011-08-01
lianyiquan

crosstool-ng主页
http://crosstool-ng.org/

crosstool-ng是新的用来建立交叉工具链的工具,它是crosstool的替换者。
使用crosstool最多只能编译gcc 4.1.1 glibc 2.x的版本。而crosstool-ng一直保持着更新,现在最新能够建立 gcc 4.3.2版本 glibc 2.9版本。
下载解压后,在根目录下执行以下操作(若是下载的crosstool-ng源码包有补丁文件的,也需要自己下载打补丁)

mkdir -p  /opt/powerpc/install_dir/

tar -xjvf  crosstool-ng-1.9.3.tar.bz2  -C /opt/powerpc

step:
1.配置crosstool
[root@localhost crosstool-ng-1.9.3]# ./configure --prefix=/opt/powerpc/install_dir/
Checking for 'grep'... /bin/grep
Checking whether '/bin/grep' supports -E... yes
Checking for 'sed'... /bin/sed
Checking whether '/bin/sed' supports -i and -e... yes
Checking for 'bash'... /bin/bash
Checking for 'cut'... /bin/cut
Checking for 'install'... /usr/bin/install
Checking for 'make'... /usr/bin/make
Checking for 'gcc'... /usr/lib/ccache/gcc
Checking for 'awk'... /bin/awk
Checking for 'bison'... /usr/bin/bison
Checking for 'flex'... /usr/bin/flex
Checking for 'makeinfo'... /usr/bin/makeinfo
Checking for 'automake'... /usr/bin/automake
Checking for 'libtool'... /usr/bin/libtool
Checking for 'stat'... /usr/bin/stat
Checking for 'aria2c'... no
Checking for 'curl'... /usr/bin/curl
Checking for 'cvs'... /usr/bin/cvs
Checking for 'patch'... /usr/bin/patch
Checking for 'tar'... /bin/tar
Checking for 'gzip'... /bin/gzip
Checking for 'bzip2'... /usr/bin/bzip2
Checking for 'lzma'... no

lzma: none found

Either you are missing entirely the needed tool,
or the version you have is too old.

configure: Bailing out...

(yum install lzma后继续下一步)

2.配置crosstool
[root@localhost crosstool-ng-1.9.3]# ./configure --prefix=/opt/powerpc/install_dir/
Checking for 'grep'... /bin/grep
Checking whether '/bin/grep' supports -E... yes
Checking for 'sed'... /bin/sed
Checking whether '/bin/sed' supports -i and -e... yes
Checking for 'bash'... /bin/bash
Checking for 'cut'... /bin/cut
Checking for 'install'... /usr/bin/install
Checking for 'make'... /usr/bin/make
Checking for 'gcc'... /usr/lib/ccache/gcc
Checking for 'awk'... /bin/awk
Checking for 'bison'... /usr/bin/bison
Checking for 'flex'... /usr/bin/flex
Checking for 'makeinfo'... /usr/bin/makeinfo
Checking for 'automake'... /usr/bin/automake
Checking for 'libtool'... /usr/bin/libtool
Checking for 'stat'... /usr/bin/stat
Checking for 'aria2c'... no
Checking for 'curl'... /usr/bin/curl
Checking for 'cvs'... /usr/bin/cvs
Checking for 'patch'... /usr/bin/patch
Checking for 'tar'... /bin/tar
Checking for 'gzip'... /bin/gzip
Checking for 'bzip2'... /usr/bin/bzip2
Checking for 'lzma'... /usr/bin/lzma
Checking for 'readlink'... /usr/bin/readlink
Checking for 'objcopy'... /usr/bin/objcopy
Checking for 'objdump'... /usr/bin/objdump
Checking for 'readelf'... /usr/bin/readelf
Checking for 'patch'... /usr/bin/patch
Checking for 'ncurses/ncurses.h'... yes
Checking for 'libncursesw.so'... yes
Computing version string... 1.9.3
Building up Makefile... done

crosstool-NG configured as follows:
  PREFIX='/opt/powerpc/install_dir/'
  BINDIR='/opt/powerpc/install_dir//bin'
  LIBDIR='/opt/powerpc/install_dir//lib/ct-ng-1.9.3'
  DOCDIR='/opt/powerpc/install_dir//share/doc/ct-ng-1.9.3'
  MANDIR='/opt/powerpc/install_dir//share/man'

Now run:
  make
  make install

3. 编译
[root@localhost crosstool-ng-1.9.3]# make
  SED    'ct-ng'
  SED    'scripts/crosstool-NG.sh'
  SED    'scripts/saveSample.sh'
  SED    'scripts/showTuple.sh'
  GEN    'paths.mk'
  SED    'docs/ct-ng.1'
  GZIP   'docs/ct-ng.1.gz'

4. 安装到prefix指定路径
[root@localhost crosstool-ng-1.9.3]# make install
  MKDIR   '/opt/powerpc/install_dir//bin/'
  INST    'ct-ng'
  RMDIR   '/opt/powerpc/install_dir//lib/ct-ng-1.9.3/'
  MKDIR   '/opt/powerpc/install_dir//lib/ct-ng-1.9.3/'
  INSTDIR 'config/'
  INSTDIR 'contrib/'
  INSTDIR 'kconfig/'
  INSTDIR 'patches/'
  INSTDIR 'scripts/'
  INST    'steps.mk'
  INST    'paths.mk'
  INSTDIR 'sampl

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值