标签:
1. 环境准备,ubuntu 10.04 LTS,也可以使用ubuntu 12.04,10.04的结果更加接近
2. 安装必要的软件,crosstool编译的时候需要的就不说了,容易漏的是msgfmt,可以通过下面的命令安装
sudo apt-get install maketex
3. 创建工作目录,并且获取crosstool-ng
sudo mkdir /work sudo chown you:yourgroup /work cd /work git clone git@github.com:secularbird/fsl_crosstoolng.git build
4. 编译和安装crosstool-ng
cd build ./configure --local make make install
5. 开始编译toolchain,开玩笑的,还编不了,先通过它下载点必要的代码
cp default_configs/linaro_2011.07.config .config ./ct-ng build
运行到解压代码的时候就可以停止了,中间有些下载找不到,需要你到网上找了对应的下下来
6. 创建下中间目录,用来替换5中下载的,但是版本对不上的
mkdir /work/source cd /work/source # 获取binutils git clone http://git.linaro.org/toolchain/binutils-gdb.git binutils cd binutils git checkout 3f26b7e8cb3d1e545a1461ded51f24259b1795e7
cd .. # 获取gcc编译器 wget -c https://launchpad.net/gcc-linaro/4.6/4.6-2011.07/+download/gcc-linaro-4.6-2011.07.tar.bz2 tar xf gcc-linaro-4.6-2011.07.tar.bz2 mv gcc-linaro-4.6-2001.07.0 gcc # 获取glibc git clone https://git.linaro.org/toolchain/glibc.git cd glibc git checkout 943515f05cdbc1463bb06c9adbd3dcee5c1a7f57 cd .. #获取glibc-ports git clone git://sourceware.org/git/glibc-ports.git cd glibc-ports git checkout 4f32a56ebbf9936a4990f1bcdeab7afcec8f5322 cd .. #获取cortex-strings git clone http://git.linaro.org/toolchain/cortex-strings.git cd cortex-strings git checkout d5fda23377842a6bc0b22f502af3db43b5e5475d
7. 创建对应的软连接
cd /work/build/.build/src rm --rf binutils-2.21 gcc-linaro-4.6-2011.06-0 glibc-2.13 ln -sf /work/source/binutils binutils-2.21 ln -sf /work/source/gcc gcc-linaro-4.6-2011.06-0 ln -sf /work/source/glibc glibc-2.13
cd /work/source/glibc
ln -sf /work/source/glibc-ports ports
8. 准备cortex-string
cd /work/source/cortex-strings ./autogen.sh ./configure --with-cpu=armv7-a --with-neon make add-on tar xf cortex-strings.tar mv cortex-strings /work/source/glibc/
9. 打patch
cd /work/source/gcc/ patch -p1 < /work/build/multilib_patches/0001-linaro-gcc-multilib.patch cd /work/source/glibc/ patch -p1 < /work/build/multilib_patches/0001-glibc-multilib.patch cd /work/source/glibc/cortex-strings patch -p1 < /work/build/multilib_patches/0002-glibc-cortex-strings.patch
cd /work/souce/binutils
rm -rf sim gdb readline
10. 开始编译
./ct-ng build
重建freescale 4.6.2 multilib toolchain
标签:
原文地址:http://www.cnblogs.com/zelos/p/5539182.html