2.3.1 Using buildroot to build toolchain up
- Essential tools Before build up buildroot
Install some package like below:
sudo apt-get install bison flex gettext patch build-essential texinfo sudo apt-get install subversion sudo apt-get install libncurses5-dev
- Download the source code of buildroot.
we can use subversion [Using buildroot make toolchain] to download the source code of buildroot.
In Terminal type
svn co -r 21163 svn://uclibc.org/trunk/buildroot
- Change configure
We want build up cross-compilation toolchain ,close the other function of buildroot.
In the directory of buildroot.
Type
make menuconfig
Into the menu selection of buildroot like below:
target change to ARM ,don't do filesystem 。
go back to main menu,then save.「Target Architechure」-->「arm」,press Enter.
- Change target as ARM architechure
In Main menu,entry「Target filesystem options」-->「ext2 root filesystem」 choose 「n」to cancel build up 「ext2 root filesystem 」,go to main menu。 「Package Selection for the target」--> press n to cancel option of 「Busybox」.
- Cancel build up filesystem
「Kernel」-->「Kernel type」-->「none」to cancel build up linux kernel 。
- Cancel compile kernel
NFS (Network filesystem),add some funcion of toolchain.
- Extend the function of toolchain
「Toolchain」-->「Enable RPC」,press y.
- make toolchain
After setting.
Type 「make」 ,buildroot will to compile toolchain Keep internet is connection, because if need some package will download from internet.
Take a rest, and wait for a while
2.3.2 setting toolchain
After compiling buildroot , we can find some toolchain bin file under build_arm/staging_dir/usr/bin.At the front of toolchain like arm-linux-uclibc-, at the end will like gcc ' as ' ld ......
Set $PATH ,let bash shell can search to toolchain 。
Assume the root directory of buildroot is <buildroot> ,then type
export PATH=<buildroot>/build_arm/staging_dir/usr/bin:$PATH
or wirte the above command into .bashrc then use
source ~/.bashrc
to load the new setting of bash shell.
We can test under terminal.
Press tab will appear the command like below.
'arm-linux- xxxxx '

Reference:
0 意見:
張貼留言