1. 程式人生 > >crosstool-ng自制交叉工具鏈

crosstool-ng自制交叉工具鏈

手動安裝termcap

到這裡termcap-1.3.1.tar.gz 已經下載完成。

#tar zxvf termcap-1.3.1.tar.gz
#cd termcap-1.3.1
#sudo  ./configure  prefix=/usr
#sudo make
#sudo make install

二,解壓、打補丁(如果有)並建立工作目錄

      crosstool-ng和crosstool不同的地方之一就是:她並不是一下載下來就可以使用了,必須先配置安裝。
將下載下來的crosstool-ng-X.Y.Z.tar.bz2解壓到你為她準備的工作目錄,並建立安裝和編譯目錄。

#tar xjvf crosstool-ng-1.9.2.tar.bz2 -C /work/tools/crosstool-ng-1.9.3//進入工作目錄

#mkdir crosstool-ng-1.9.2_build   //這是編譯新交叉編譯器的工作目錄

#mkdir crosstool-ng-1.9.2_install //這是crosstool-ng的安裝目錄


#cd  crosstool-ng-1.9.2   //進入解壓後的 crosstool-ng-1.9.2目錄

#patch -p1 < 補丁檔案      //如果有補丁,打補丁

#./configure --prefix=/work/tools/crosstool-ng-1.9.2_install   //配置crosstool-ng

#sudo make                    //編譯crosstool-ng

#sudo make install            //安裝crosstool-ng

# echo "PATH=$PATH:/work/tools/crosstool/crosstool-ng-1.9.2_install/bin" >> ~/.bashrc //為後面呼叫ct-ng命令增加環境變數
# source ~/.bashrc

# ct-ng help

This is crosstool-NG version 1.9.2

Copyright (C) 2008  Yann E. MORIN <[email protected]>
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

See below for a list of available actions, listed by category:

Configuration actions:
  menuconfig         - Update current config using a menu based program
  oldconfig          - Update current config using a provided .config as base
  extractconfig      - Extract to stdout the configuration items from a
                       build.log file piped to stdin
  saveconfig         - Save current config as a preconfigured target
  show-tuple         - Print the tuple of the currently configured toolchain

Preconfigured toolchains (#: force number of // jobs):
  list-samples       - prints the list of all samples (for scripting)
  show-<sample>      - show a brief overview of <sample> (list with list-samples)
  <sample>           - preconfigure crosstool-NG with <sample> (list with list-samples)
  build-all[.#]      - Build *all* samples (list with list-samples) and install in
                       ${CT_PREFIX} (which you must set)

Build actions (#: force number of // jobs):
  build[.#]          - Build the currently configured toolchain
  list-steps         - List all build steps

Clean actions:
  clean              - Remove generated files
  distclean          - Remove generated files, configuration and build directories

Distribution actions:
  wiki-samples       - Print a DokuWiki table of samples
  updatetools        - Update the config tools
  tarball            - Build a tarball of the configured toolchain

Environement variables (see /work/tools/crosstool-ng-1.9.3_install/share/doc/ct-ng-1.9.3/0 - Table of content.txt):
  STOP=step          - Stop the build just after this step (list with list-steps)
  RESTART=step       - Restart the build just before this step (list with list-steps)
  CT_PREFIX=dir      - install samples in dir (see action "build-all", above).
  V=0|1|2            - 0 => show only human-readable messages (default)
                       1 => show only the commands being executed
                       2 => show both

Use action "menuconfig" to configure your toolchain
Use action "build" to build your toolchain
Use action "version" to see the version
See "man 1 ct-ng" for some help as well

crosstool-ng安裝成功.

三,配置本次編譯的交叉編譯工具鏈

接下來就是配置你要編譯的交叉編譯工具鏈了,在crosstool-ng已很多已經做好的預設配置(位於crosstool-ng- X.Y.Z/samples目錄下),你只要針對其進行修改就好了。對於編譯器元件部分的版本最好不要修改,因為那個配搭應該是經過測試後的最高本版了,但核心版本可以修改。

#sudo mkdir /work/tools/TQ2440/x-tools //建立交叉編譯器的安裝路徑

#sudo mkdir /work/tools//TQ2440/crosstool-ng/src //建立儲存原始碼包目錄

#cd /work/tools/crosstool-ng-1.9.2_build 

//進入編譯新交叉編譯器的工作目錄
#sudo cp ../crosstool-ng-1.9.2/samples/arm-unknown-linux-gnueabi /* ./

//拷貝預設配置檔案到工作目錄

#mv crosstool.config .config

//修改檔名

#../crosstool-ng-1.9.2_install/bin/ct-ng menuconfig

進入menuconfig,開始修改配置。

此時會出現crosstool-ng的配置視窗:

針對armv4t體系架構,因為TQ2440用的是armv4t架構,開始對其進行修改配置:

0、已下載好的原始碼包路徑和交叉編譯器的安裝路徑。
Paths and misc options  --->Local tarballs directory  
  (/work/tools/TQ2440/crosstool-ng/src) Local tarballs directory   儲存原始碼包路徑

Paths and misc options  --->Prefix directory   
  (/work/tools/TQ2440/x-tools/${CT_TARGET}) Prefix directory  交叉編譯器的安裝路徑
這兩個請依據你的實際情況來修改。

1、Target options --->
 *** Target optimisations ***

Target options --->Architecture level
寫上:armv4t

Target options --->Emit assembly for CPU
寫上:arm9tdmi


Target options --->Tune for CPU
寫上:arm920t
通過查詢資料,這個應該是指令集的架構,對於S3C2410/S3C2440,都是ARM920T的核心,架構指令是armv4t,所以,如果要編譯2410/2440的,就選armv4t。以此類推S3C6410 ARM1176JZF-S核心 使用的是armv6架構,就選armv6,那麼具體都支援哪些架構呢?可以用man gcc來查詢,搜尋arm,再搜尋-march=就可以找到本gcc支援的處理器核心列表了。

2、根據參考資料,禁止核心標頭檔案檢測(只起到節約時間的作用(不到1S的時間),不推薦禁用)
Operating System  --->

 [N]     Check installed headers

 

3、增加編譯時的並行程序數,以增加執行效率,加快編譯。
Paths and misc options  --->
   *** Build behavior ***
   (4) Number of parallel jobs
   這個數值不宜過大,應該為CPU數量的兩倍。由於我的CPU是雙核的,所以我填了4.

4、一些個性化的修改(可以不修改)
Toolchain options  --->
       *** Tuple completion and aliasing *** 
       (hens) Tuple's vendor string
這樣產生的編譯器字首就是:arm-hens-linux-gnueabi-

5、C compiler  --->
       (crosstool-NG-${CT_VERSION}-hens) gcc ID string
    以上紅色字型部分即為修改之處。

Ubuntu10.10下利用crosstool-ng構建交叉編譯鏈

      之所以用crosstool-ng是因為crosstool-ng是最新的用來建立交叉工具鏈的工具,正如其官網所說,crosstool-ng is a rewrite of the original crosstool by Dan Kegel.它是crosstool的替代者,crosstool的gcc版本只能到4.1.1,無法編譯版本高於2.6.29 的linux核心,而crosstool-ng一直儲存著更新,而且crosstool-ng is really targetted at building toolchains, and only toolchains.

Linux ubuntu 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 01:41:57 UTC 2010 i686 GNU/Linux

      我這次使用的是1.9.2

      使用crosstool-ng必須先安裝一些開發用的軟體,在ubuntu下必須安裝(使用apt):

#apt-get install libncurses5-dev

#apt-get install bison

#apt-get install flex

#apt-get install texinfo

#apt-get install automake

#apt-get install libtool

#apt-get install patch

#apt-get install gcj

#apt-get install cvs

#apt-get install cvsd

#apt-get install gawk

然後手動安裝termcap

#cd /tmp
#wget ftp://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz
#tar zxvf termcap-1.3.1.tar.gz
#cd termcap-1.3.1
#./configure --prefix=/usr
#make
#make install

二,解壓、打補丁(如果有)並建立工作目錄

      crosstool-ng和crosstool不同的地方之一就是:她並不是一下載下來就可以使用了,必須先配置安裝。
將下載下來的crosstool-ng-X.Y.Z.tar.bz2解壓到你為她準備的工作目錄(這裡假設為/home/lwm/software/crosstool),並建立安裝和編譯目錄。

#tar xjvf crosstool-ng-1.9.2.tar.bz2 -C /home/lwm/software/crosstool

#cd /home/lwm/software/crosstool  //進入工作目錄

#mkdir crosstool-ng-1.9.2_build   //這是編譯新交叉編譯器的工作目錄

#mkdir crosstool-ng-1.9.2_install //這是crosstool-ng的安裝目錄


#cd  crosstool-ng-1.9.2   //進入解壓後的 crosstool-ng-1.9.2目錄

#patch -p1 < 補丁檔案      //如果有補丁,打補丁

#./configure –prefix=/home/lwm/software/crosstool/crosstool-ng-1.9.2_install            //配置crosstool-ng

#make                    //編譯crosstool-ng

#make install            //安裝crosstool-ng

# echo "PATH=$PATH:/home/lwm/software/crosstool/crosstool-ng-1.9.2_install/bin" >> ~/.bashrc //為後面呼叫ct-ng命令增加環境變數
# source ~/.bashrc
# ct-ng help

This is crosstool-NG version 1.9.2

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

See below for a list of available actions, listed by category:

Configuration actions:

  menuconfig         - Update current config using a menu based program

  oldconfig          - Update current config using a provided .config as base

  extractconfig      - Extract to stdout the configuration items from a

                       build.log file piped to stdin

  saveconfig         - Save current config as a preconfigured target

  show-tuple         - Print the tuple of the currently configured toolchain

Preconfigured toolchains (#: force number of // jobs):

  list-samples       - prints the list of all samples (for scripting)

  show-<sample>      - show a brief overview of <sample> (list with list-samples)

  <sample>           - preconfigure crosstool-NG with <sample> (list with list-samples)

  build-all[.#]      - Build *all* samples (list with list-samples) and install in

                       ${CT_PREFIX} (which you must set)

Build actions (#: force number of // jobs):

  build[.#]          - Build the currently configured toolchain

  list-steps         - List all build steps

Clean actions:

  clean              - Remove generated files

  distclean          - Remove generated files, configuration and build directories

Distribution actions:

  wiki-samples       - Print a DokuWiki table of samples

  updatetools        - Update the config tools

  tarball            - Build a tarball of the configured toolchain

Environement variables (see /home/lwm/software/crosstool/crosstool-ng-1.9.2_install/share/doc/ct-ng-1.9.2/0 - Table of content.txt):

  STOP=step          - Stop the build just after this step (list with list-steps)

  RESTART=step       - Restart the build just before this step (list with list-steps)

  CT_PREFIX=dir      - install samples in dir (see action "build-all", above).

  V=0|1|2            - 0 => show only human-readable messages (default)

                       1 => show only the commands being executed

                       2 => show both

Use action "menuconfig" to configure your toolchain

Use action "build" to build your toolchain

Use action "version" to see the version

See "man 1 ct-ng" for some help as well

好了,crosstool-ng安裝成功。

三,配置本次編譯的交叉編譯工具鏈

接下來就是配置你要編譯的交叉編譯工具鏈了,在crosstool-ng已很多已經做好的預設配置(位於crosstool-ng- X.Y.Z/samples目錄下),你只要針對其進行修改就好了。對於編譯器元件部分的版本最好不要修改,因為那個配搭應該是經過測試後的最高本版了,但核心版本可以修改。

#mkdir /home/lwm/software/mini2440/x-tools //建立交叉編譯器的安裝路徑

#mkdir /home/lwm/software/mini2440/crosstool-ng/src //建立儲存原始碼包目錄

#cd /home/lwm/software/crosstool/crosstool-ng-1.9.2_build/ 

//進入編譯新交叉編譯器的工作目錄
#cp ../crosstool-ng-1.9.2/samples/arm-unknown-linux-gnueabi /* ./

//拷貝預設配置檔案到工作目錄

#mv crosstool.config .config

//修改檔名

#../crosstool-ng-1.9.2_install/bin/ct-ng menuconfig

進入menuconfig,開始修改配置。

此時會出現crosstool-ng的配置視窗,針對armv4t體系架構,因為mini2440用的是armv4t架構,開始對其進行修改配置:

0、已下載好的原始碼包路徑和交叉編譯器的安裝路徑。
Paths and misc options  --->
  (/home/lwm/software/mini2440/crosstool-ng/src) Local tarballs directory   儲存原始碼包路徑
  (/home/lwm/software/mini2440/x-tools/${CT_TARGET}) Prefix directory  交叉編譯器的安裝路徑
這兩個請依據你的實際情況來修改。

1、Target options --->
 *** Target optimisations ***
(armv4t) Architecture level
(arm9tdmi) Emit assembly for CPU
(arm920t) Tune for CPU
通過查詢資料,這個應該是指令集的架構,對於S3C2410/S3C2440,都是ARM920T的核心,架構指令是armv4t,所以,如果要編譯2410/2440的,就選armv4t。以此類推S3C6410 ARM1176JZF-S核心 使用的是armv6架構,就選armv6,那麼具體都支援哪些架構呢?可以用man gcc來查詢,搜尋arm,再搜尋-march=就可以找到本gcc支援的處理器核心列表了。

以上這幾個引數是如何得出的可以參考gcc的man手冊,你可以在你下載的gcc-4.3.2.tar.bz2解壓後找到,她的位置是gcc-4.3.2/gcc/doc/gcc.1。開啟方式:

man ./gcc.1
 


你可以在其中找到:

......
 ARM Options
......
-mcpu=name   (Emit assembly for CPU)
           This specifies the name of the target ARM processor. GCC uses this
           name to determine what kind of instructions it can emit when gener‐
           ating assembly code. Permissible names are: arm2, arm250, arm3,
           arm6, arm60, arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm,
           arm7di, arm7dmi, arm70, arm700, arm700i, arm710, arm710c, arm7100,
           arm7500, arm7500fe, arm7tdmi, arm7tdmi-s, arm8, strongarm, stron‐
           garm110, strongarm1100, arm8, arm810, arm9, arm9e, arm920, arm920t,
           arm922t, arm946e-s, arm966e-s, arm968e-s, arm926ej-s, arm940t,
           arm9tdmi, arm10tdmi, arm1020t, arm1026ej-s, arm10e, arm1020e,
           arm1022e, arm1136j-s, arm1136jf-s, mpcore, mpcorenovfp,
           arm1156t2-s, arm1176jz-s, arm1176jzf-s, cortex-a8, cortex-r4, cor‐
           tex-m3, xscale, iwmmxt, ep9312.

       -mtune=name   (Tune for CPU)
           This option is very similar to the -mcpu= option, except that
           instead of specifying the actual target processor type, and hence
           restricting which instructions can be used, it specifies that GCC
           should tune the performance of the code as if the target were of
           the type specified in this option, but still choosing the instruc‐
           tions that it will generate based on the cpu specified by a -mcpu=
           option. For some ARM implementations better performance can be
           obtained by using this option.

       -march=name  (Architecture level)
           This specifies the name of the target ARM architecture. GCC uses
           this name to determine what kind of instructions it can emit when
           generating assembly code. This option can be used in conjunction
           with or instead of the -mcpu= option. Permissible names are:
           armv2, armv2a, armv3, armv3m, armv4, armv4t, armv5, armv5t,
           armv5te, armv6, armv6j, armv6t2, armv6z, armv6zk, armv7, armv7-a,
           armv7-r, armv7-m, iwmmxt, ep9312.

......
 

2、根據參考資料,禁止核心標頭檔案檢測(只起到節約時間的作用(不到1S的時間),不推薦禁用)
Operating System  --->

 [N]     Check installed headers

3、增加編譯時的並行程序數,以增加執行效率,加快編譯。
Paths and misc options  --->
   *** Build behavior ***
   (4) Number of parallel jobs
   這個數值不宜過大,應該為CPU數量的兩倍。由於我的CPU是雙核的,所以我填了4.

4、一些個性化的修改(可以不修改)
Toolchain options  --->
       *** Tuple completion and aliasing *** 
       (lwm) Tuple's vendor string
這樣產生的編譯器字首就是:arm-lwm-linux-gnueabi-

5、C compiler  --->
       (crosstool-NG-${CT_VERSION}-lwm) gcc ID string
    以上紅色字型部分即為修改之處。

配置好以後儲存。

最後,核心原始碼的版本號修改,請直接修改crosstool-ng-1.9.2_build目錄下的.config檔案,不止一處,有關的都要修改。
有:

CT_KERNEL_VERSION=           //開始我在這裡寫上Linux-2.6.33.7時不能編譯通過
CT_KERNEL_V_2_6_??_?=y
CT_LIBC_GLIBC_MIN_KERNEL=
 

如果再次../crosstool-ng-1.9.2_install/bin/ct-ng menuconfig,這個修改又會復原,必須再次手工修改。
你也可以選擇修改crosstool-ng-X.Y.Z_build/config/kernel/linux.in等檔案,只是比較麻煩,但這可以徹底解決,實現在介面中增加核心版本。

 配置完後,在crosstool-ng-1.9.2_build目錄下執行命令:$ ct-ng build.4。

當我輸入執行這個命令時提示:

ct-ng: command not found

找不到命令,試試從普通使用者轉換到超級使用者執行還是不行。可能是是環境變數沒有設定正確,導致不能正確的識別命令的路徑。於是我重新執行:

# echo "PATH=$PATH:/home/lwm/software/crosstool/crosstool-ng-1.9.2_install/bin" >> ~/.bashrc //為後面呼叫ct-ng命令增加環境變數
# source ~/.bashrc

OK,可以了。

表示它正在編譯之中,這個可能時間比較長,因為有些包預先不存在的話,還要自行下載,當然會比較慢,不過都走到這裡了,等應該不成問題。

但是往下就有問題了:

[INFO ]  Retrieving needed toolchain components' tarballs
[EXTRA]    Retrieving 'duma_2_5_15'
[ERROR]    Could not retrieve 'duma_2_5_15'.
[09:16] / make[1]: *** [build] Error 1
make: *** [build.4] Error 2
重新進入配置介面Debug facilities  --->

                                 [ ] duma  --->,把'duma這項去掉。也還是不行。

剛開始懷疑我用的版本是目前最新的1.93,會不會是跟這之前的版本有太大的區別。於是我換用1.90版的。但是還是會出現:

這個看看來是不能檢索到“expat-2.0.1”,可能是源發生了變化,我償試自己下載,再把它放到存放原始碼的目錄中,以後只要是有這樣提示的都自己下載然後手動放進。繼續操作。

                                                                                              .

                                          .

                                          .

 

 到這裡它已經全部可以下載了,當然前面還有已經下載完的,這裡只不過是拿出一部分圖示意。下面系統會自動轉入安裝階段:

                                                                                              .

                                         .

                                         .

為能看清楚總共下載多少包,想想還是把它們全部都列出來:

 [email protected]:/work/crosstool/crosstool_build# ../crosstool_install/bin/ct-ng build
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20120524.143846
[INFO ]  Building environment variables
[EXTRA]  Preparing working directories
[EXTRA]  Installing user-supplied crosstool-NG configuration
[EXTRA]  =================================================================
[EXTRA]  Dumping internal crosstool-NG configuration
[EXTRA]    Building a toolchain for:
[EXTRA]      build  = i686-pc-linux-gnu
[EXTRA]      host   = i686-pc-linux-gnu
[EXTRA]      target = arm-hens-linux-gnueabi
[EXTRA]  Dumping internal crosstool-NG configuration: done in 0.20s (at 00:04)
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[EXTRA]    Retrieving 'ncurses-5.7'
[EXTRA]    Saving 'ncurses-5.7.tar.gz' to local storage
[INFO ]  Retrieving needed toolchain components' tarballs: done in 22.27s (at 00:26)
[INFO ]  =================================================================
[INFO ]  Extracting and patching toolchain components
[EXTRA]    Extracting 'linux-2.6.33.7'
[EXTRA]    Patching 'linux-2.6.33.7'
[EXTRA]    Extracting 'gmp-4.3.2'
[EXTRA]    Patching 'gmp-4.3.2'
[EXTRA]    Extracting 'mpfr-2.4.2'
[EXTRA]    Patching 'mpfr-2.4.2'
[EXTRA]    Extracting 'libelf-0.8.13'
[EXTRA]    Patching 'libelf-0.8.13'
[EXTRA]    Extracting 'binutils-2.19.1'
[EXTRA]    Patching 'binutils-2.19.1'
[EXTRA]    Extracting 'gcc-4.3.2'
[EXTRA]    Patching 'gcc-4.3.2'
[EXTRA]    Extracting 'glibc-2.9'
[EXTRA]    Patching 'glibc-2.9'
[EXTRA]    Extracting 'glibc-ports-2.9'
[EXTRA]    Patching 'glibc-ports-2.9'
[EXTRA]    Extracting 'dmalloc-5.5.2'
[EXTRA]    Patching 'dmalloc-5.5.2'
[EXTRA]    Extracting 'duma_2_5_15'
[EXTRA]    Patching 'duma-2_5_15'
[EXTRA]    Extracting 'gdb-6.8'
[EXTRA]    Patching 'gdb-6.8'
[EXTRA]    Extracting 'ncurses-5.7'
[EXTRA]    Patching 'ncurses-5.7'
[EXTRA]    Extracting 'expat-2.0.1'
[EXTRA]    Patching 'expat-2.0.1'
[EXTRA]    Extracting 'ltrace-0.5.3'
[EXTRA]    Patching 'ltrace-0.5.3'
[EXTRA]    Extracting 'strace-4.5.19'
[EXTRA]    Patching 'strace-4.5.19'
[INFO ]  Extracting and patching toolchain components: done in 211.31s (at 03:58)
[INFO ]  =================================================================
[INFO ]  Installing kernel headers
[EXTRA]    Installing kernel headers
[EXTRA]    Checking installed headers
[INFO ]  Installing kernel headers: done in 11.32s (at 04:09)
[INFO ]  =================================================================
[INFO ]  Installing GMP
[EXTRA]    Configuring GMP
[EXTRA]    Building GMP
[EXTRA]    Installing GMP
[INFO ]  Installing GMP: done in 283.14s (at 08:52)
[INFO ]  =================================================================
[INFO ]  Installing MPFR
[EXTRA]    Configuring MPFR
[EXTRA]    Building MPFR
[EXTRA]    Installing MPFR
[INFO ]  Installing MPFR: done in 52.61s (at 09:45)
[INFO ]  =================================================================
[INFO ]  Installing binutils
[EXTRA]    Configuring binutils
[EXTRA]    Building binutils
[EXTRA]    Installing binutils
[INFO ]  Installing binutils: done in 178.97s (at 12:44)
[INFO ]  =================================================================
[INFO ]  Installing static core C compiler
[EXTRA]    Configuring static core C compiler
[EXTRA]    Building static core C compiler
[EXTRA]    Installing static core C compiler
[INFO ]  Installing static core C compiler: done in 336.89s (at 18:21)
[INFO ]  =================================================================
[INFO ]  Installing C library headers
[EXTRA]    Configuring C library
[EXTRA]    Installing C library headers
[INFO ]  Installing C library headers: done in 45.14s (at 19:06)
[INFO ]  =================================================================
[INFO ]  Installing C library start files
[EXTRA]    Configuring C library
[WARN ]    Removing "-pipe" for use with glibc>=2.6
[EXTRA]    Building C library start files
[EXTRA]    Installing C library start files
[INFO ]  Installing C library start files: done in 35.80s (at 19:42)
[INFO ]  =================================================================
[INFO ]  Installing shared core C compiler
[EXTRA]    Configuring shared core C compiler
[EXTRA]    Building shared core C compiler
[EXTRA]    Installing shared core C compiler
[INFO ]  Installing shared core C compiler: done in 373.23s (at 25:55)
[INFO ]  =================================================================
[INFO ]  Installing C library
[EXTRA]    Configuring C library
[WARN ]    Removing "-pipe" for use with glibc>=2.6
[EXTRA]    Building C library
[EXTRA]    Installing C library
[EXTRA]    Fixing C library linker scripts
[INFO ]  Installing C library: done in 1118.93s (at 44:34)
[INFO ]  =================================================================
[INFO ]  Installing final compiler
[EXTRA]    Configuring final compiler
[EXTRA]    Building final compiler
[EXTRA]    Installing final compiler
[INFO ]  Installing final compiler: done in 914.62s (at 59:49)
[INFO ]  =================================================================
[INFO ]  Installing libelf for the target
[EXTRA]    Configuring libelf
[EXTRA]    Building libelf
[EXTRA]    Installing libelf
[INFO ]  Installing libelf for the target: done in 14.22s (at 60:03)
[INFO ]  =================================================================
[INFO ]  Installing binutils for target
[EXTRA]    Configuring binutils for target
[EXTRA]    Building binutils' libraries (libiberty bfd) for target
[EXTRA]    Installing binutils' libraries (libiberty bfd) for target
[INFO ]  Installing binutils for target: done in 169.56s (at 62:53)
[INFO ]  =================================================================
[INFO ]  Installing dmalloc
[EXTRA]    Configuring dmalloc
[EXTRA]    Building dmalloc
[EXTRA]    Installing dmalloc
[INFO ]  Installing dmalloc: done in 17.31s (at 63:10)
[INFO ]  =================================================================
[INFO ]  Installing D.U.M.A.
[EXTRA]    Copying sources
[EXTRA]    Building libraries 'libduma.a libduma.so.0.0.0'
[EXTRA]    Installing libraries 'libduma.a libduma.so.0.0.0'
[EXTRA]    Installing shared library link
[EXTRA]    Installing wrapper script
[INFO ]  Installing D.U.M.A.: done in 2.73s (at 63:13)
[INFO ]  =================================================================
[INFO ]  Installing cross-gdb
[EXTRA]    Configuring cross-gdb
[EXTRA]    Building cross-gdb
[EXTRA]    Installing cross-gdb
[INFO ]  Installing cross-gdb: done in 324.74s (at 68:38)
[INFO ]  =================================================================
[INFO ]  Installing native gdb
[EXTRA]    Building static target ncurses
[EXTRA]    Building static target expat
[EXTRA]    Configuring native gdb
[EXTRA]    Building native gdb
[EXTRA]    Installing native gdb
[EXTRA]    Cleaning up ncurses
[INFO ]  Installing native gdb: done in 521.52s (at 77:19)
[INFO ]  =================================================================
[INFO ]  Installing gdbserver
[EXTRA]    Configuring gdbserver
[EXTRA]    Building gdbserver
[EXTRA]    Installing gdbserver
[INFO ]  Installing gdbserver: done in 14.75s (at 77:34)
[INFO ]  =================================================================
[INFO ]  Installing ltrace
[EXTRA]    Copying sources to build dir
[EXTRA]    Configuring ltrace
[EXTRA]    Building ltrace
[EXTRA]    Installing ltrace
[INFO ]  Installing ltrace: done in 5.92s (at 77:40)
[INFO ]  =================================================================
[INFO ]  Installing strace
[EXTRA]    Configuring strace
[EXTRA]    Building strace
[EXTRA]    Installing strace
[INFO ]  Installing strace: done in 24.17s (at 78:04)
[INFO ]  =================================================================
[INFO ]  Cleaning-up the toolchain's directory
[INFO ]    Stripping all toolchain executables
[EXTRA]    Installing the populate helper
[EXTRA]    Installing a cross-ldd helper
[EXTRA]    Creating toolchain aliases
[EXTRA]    Removing access to the build system tools
[INFO ]  Cleaning-up the toolchain's directory: done in 2.28s (at 78:07)
[INFO ]  Build completed at 20120524.155653
[INFO ]  (elapsed: 78:06.56)
[INFO ]  Finishing installation (may take a few seconds)...
[78:07] / [email protected]:/work/crosstool/crosstool_build#

 

說明做的編譯器真的成功了,應該可以小小的高興一下。

建立連結,新增環境變數:

1.  sudo vim  /etc/profile,在其中檔案的末尾新增這樣一行:PATH=$PATH:/work/hens/crosstool/tools/bin,其實是我的工具的路徑,可以根據實際需要來設定。

2.  source /etc/profile   使修改生效,不用重新登陸。

3.  arm-hens-linux-gnueabi-gcc -v  就會有如下的資訊

恭喜成功了。不過我這裡編譯製作的編譯工具鏈是基於於Linux-2.6.33.7來的,要是用作其他版本的要作相應的修改,這個以前面已經說到,這裡不再重複。