博通“toolschain”搭建--安装篇!

来源:互联网 发布:淘宝上钱包店铺哪家好 编辑:程序博客网 时间:2024/05/23 00:27

VMware版本:10.0.0

Linux版本:Ubuntu8.10

GCC版本:gcc-4.3.6.tar.bz2

vsftpd支持软件:CuteFTP9

(用于Windows与Linux平台之间的文件传输)


安装工作:

1.安装mingw32

1.1下载以下文件,并存放在对应目录下

Mingw32 source and patch can be downloaded from following links:

* mingw32_4.2.1.dfsg-2ubuntu1.diff.gz

https://launchpad.net/ubuntu/maverick/+source/mingw32/4.2.1.dfsg-2ubuntu1/+files/mingw32_4.2.1.dfsg-2ubuntu1.diff.gz

* mingw32_4.2.1.dfsg.orig.tar.gz

https://answers.launchpad.net/ubuntu/+archive/primary/+files/mingw32_4.2.1.dfsg.orig.tar.gz

* mingw32_4.2.1.dfsg-2ubuntu1.dsc

https://answers.launchpad.net/ubuntu/+archive/primary/+files/mingw32_4.2.1.dfsg-2ubuntu1.dsc

Save these files in ‘~/tools/mingw32/’ directory. Download the mingw32-

binutils source and patch from following links:


* mingw32-binutils_2.20-0.1.diff.gz

https://launchpad.net/ubuntu/+archive/primary/+files/mingw32-binutils_2.20-0.1.diff.gz

* mingw32-binutils_2.20-0.1.dsc

https://launchpad.net/ubuntu/+archive/primary/+files/mingw32-binutils_2.20-0.1.dsc

* mingw32-binutils_2.20.orig.tar.gz

https://launchpad.net/ubuntu/+archive/primary/+files/mingw32-binutils_2.20.orig.tar.gz

Save these files in ‘~/tools/mingw32-binutils/’ directory. Download the

mingw32-runtime source and patch from following links:


* mingw32-runtime_3.15.2-0ubuntu1.diff.gz

https://launchpad.net/ubuntu/+archive/primary/+files/mingw32-runtime_3.15.2-0ubuntu1.diff.gz

* mingw32-runtime_3.15.2-0ubuntu1.dsc

https://launchpad.net/ubuntu/+archive/primary/+files/mingw32-runtime_3.15.2-0ubuntu1.dsc

* mingw32-runtime_3.15.2.orig.tar.gz

https://launchpad.net/ubuntu/+archive/primary/+files/mingw32-runtime_3.15.2.orig.tar.gz

Save these files in ‘~/tools/mingw32-runtime/’ directory.


1.2 mingw32升级/组建/安装和相关设置


Run the following commands to update mingw32 package:

Note: In this step, the ‘*.diff.gz’ files are compressed patch files.

But if you download these packages using internet explorer (such

as IE, FireFox, etc.), it might automatically help you unzip these

files. Please check the downloaded files using following commands:

#Here using mingw32_4.2.1.dfsg-2ubuntu1.diff.gz as an example,

#the same story stands for all *.diff.gz files

$ cd ~/tools/mingw32/

$ file mingw32_4.2.1.dfsg-2ubuntu1.diff.gz

mingw32_4.2.1.dfsg-2ubuntu1.diff.gz: ASCII English text

It says that ‘mingw32_4.2.1.dfsg-2ubuntu1.diff.gz’ is an

ASCII text file, though file name has ‘gz’ suffix. In this case, you

could choose either following methods:

• Download the packages using "wget" command;

• Execute following commands to prepare the diff file:

$ cd ~/tools/mingw32/

$ mv mingw32_4.2.1.dfsg-2ubuntu1.diff.gz mingw32_4.2.1.dfsg-2ubuntu1.diff

Using this method, there is no need to unzip ‘*.diff.gz’ in the next step.


$ cd ~/tools/mingw32/

$ ls

mingw32_4.2.1.dfsg-2ubuntu1.diff.gz mingw32_4.2.1.dfsg.orig.tar.gz

mingw32_4.2.1.dfsg-2ubuntu1.dsc

$ tar xzf mingw32_4.2.1.dfsg.orig.tar.gz

#$ gzip -d mingw32_4.2.1.dfsg-2ubuntu1.diff.gz#上文已经解压过该文件,此步省略!!!

$ mv mingw32-4.2.1.dfsg.orig mingw32-4.2.1.dfsg

$ cd mingw32-4.2.1.dfsg

$ patch -p1 <../mingw32_4.2.1.dfsg-2ubuntu1.diff

$ chmod a+x ./debian/rules

$ sudo dpkg-buildpackage

Everything should be ok and debian package

‘mingw32_4.2.1.dfsg-2ubuntu1_i386.deb’ should be generated in‘~/mingw32/’ directory.

Install the generated package:

$ cd ~/tools/mingw32/

$ sudo dpkg -i mingw32_4.2.1.dfsg-2ubuntu1_i386.deb



Run the following commands to update mingw32-binutils package:

$ cd ~/tools/mingw32-binutils/

$ ls

mingw32-binutils_2.20-0.1.diff.gz mingw32-binutils_2.20-0.1.dsc

mingw32-binutils_2.20.orig.tar.gz

$ tar xzf mingw32-binutils_2.20.orig.tar.gz

$ gzip -d mingw32-binutils_2.20-0.1.diff.gz

$ cd mingw32-binutils-2.20

$ patch -p1 <../mingw32-binutils_2.20-0.1.diff

$ chmod a+x ./debian/rules

$ sudo dpkg-buildpackage

Install the generated package:

$ cd ~/tools/mingw32-binutils/

$ sudo dpkg -i mingw32-binutils_2.20-0.1_i386.deb


Run the following commands to update mingw32-runtime package:

$ cd ~/tools/mingw32-runtime/

$ ls

mingw32-runtime_3.15.2-0ubuntu1.diff.gz

mingw32-runtime_3.15.2-0ubuntu1.dsc

mingw32-runtime_3.15.2.orig.tar.gz

$ tar xzf mingw32-runtime_3.15.2.orig.tar.gz

$ gzip -d mingw32-runtime_3.15.2-0ubuntu1.diff.gz

$ cd mingw32-runtime-3.15

$ patch -p1 <../mingw32-runtime_3.15.2-0ubuntu1.diff

$ chmod a+x ./debian/rules

$ sudo dpkg-buildpackage

Install the generated package:

$ cd ~/tools/mingw32-runtime/

$ sudo dpkg -i mingw32-runtime_3.15.2-0ubuntu1_all.deb


2.Install InstallJammer

Download latest InstallJammer installer (installjammer-1.2.15.tar.gz) from

website: http://www.installjammer.com/. Save it in ‘~/tools’ directory,

unpack it by running following command:

$ cd ~/tools

$ tar xzf installjammer-1.2.15.tar.gz

After unpacking, find the executable program named installjammer in the

destination directory, for example ‘~/tools/installjammer’. Export the

path in PATH environment variable by appending following lines at the end

of ‘~/.bashrc’ file:

#For example, $YOUR_INSTALLJAMMER_PATH=/home/build/tools/installjammer

export PATH=$YOUR_INSTALLJAMMER_PATH:$PATH

Save ‘.bashrc’ and quit, then restart or re-login your system. Check that

installjammer is in your ‘$PATH’ by running below command:

$ which installjammer

$YOUR_INSTALLJAMMER_PATH/installjammer

#in my system, the output would be:

#/home/build/tools/installjammer/installjammer


3.Build new native gcc

note: If you don’t want to build the package running on the platform which is different from your build machine, please skip this
step.
Reconfigure and compile native gcc/g++ on Ubuntu 8.10 system. Gcc distributed along with Ubuntu 8.10 system supports ssp utility by default,
which uses symbols of version GLIBC 2.8/GLIBC 2.7, etc. In glibc, resulting in programs compiled by this gcc/g++ may not be able to run on system
with lower version glibc, like redhat5/redhat4. To provide greater application coverage of our toolchain, we have to reconfigure and compile gcc with
libssp disabled.
Download ‘gcc-4.3.6.tar.bz2’ from website and save it
in ‘~/tools/native-gcc/src’ directory. The website is
ftp://ftp.gnu.org/gnu/gcc/gcc-4.3.6/gcc-4.3.6.tar.bz2.
Reconfigure and compile gcc with following commands:
$ cd ~/tools/native-gcc/src
$ mkdir -p ~/tools/native-gcc/obj/gcc && mkdir ~/tools/native-gcc/target
$ tar -xjf gcc-4.3.6.tar.bz2
$ cd ../obj/gcc
$ ../../src/gcc-4.3.6/configure \
--build=i686-linux-gnu \
--host=i686-linux-gnu \
--target=i686-linux-gnu \
--enable-languages=c,c++ \
--enable-shared \
--enable-threads=posix \
--disable-decimal-float \
--disable-libffi \
--disable-libgomp \
--disable-libmudflap \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-nls \
--with-gnu-as \
--with-gnu-ld \
--enable-libstdcxx-debug \
--enable-targets=all \
--enable-checking=release \
--prefix=/home/build/tools/native-gcc/target \
--with-host-libstdcxx="-static-libgcc -L /usr/lib/gcc/i486-linuxgnu/4.3.2/ -
lstdc++ -lsupc++ -lm"
$ make
$ make install
After this, add path ‘/home/build/tools/native-gcc/target/bin’ into
your PATH environment, make sure to use the new gcc/g++ to compile our
arm toolchain. You can do this by appending following line at the end of
‘~/.bashrc’ file:
export PATH=/home/build/tools/native-gcc/target/bin:$PATH
Then re-start or re-login the system.


4.Build GNU Tools for ARM Embedded Processors

You have set up the building environment. You can now build the toolchain
by yourself with below commands:
#Copy the src release package into ~/toolchain/ directory
$ cp gcc-arm-none-eabi-4_7-2013q1-20130313-src.tar.bz2 ~/toolchain
#Prepare source codes
$ cd ~/toolchain
$ tar -xjf gcc-arm-none-eabi-4_7-2013q1-20130313-src.tar.bz2
$ cd ./gcc-arm-none-eabi-4_7-2013q1-20130313/src
$ find -name ’*.tar.*’ | xargs -I% tar -xf %
#Since we should not modify zlib package,
#here provides a patch to compile it successfully.
$ cd zlib-1.2.5
$ patch -p1 <../zlib-1.2.5.patch
$ cd ../../
#Start building the toolchain.
#Can specify "--skip_mingw32" option to skip building windows host
#toolchain, and if specify that option when building prerequisites,
#you have to specify it when building toolchain too.
$ ./build-prerequisites.sh [--skip_mingw32]
$ ./build-toolchain.sh [--skip_mingw32]
After this, you can ‘cd’ into
‘~/toolchain/gcc-arm-none-eabi-4_7-2013q1-20130313/pkg’ and find
the built toolchain/source code packages and the md5 checksum file.



0 0
原创粉丝点击