首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 系统运维 >

Ubuntu ARM交叉编译工具链打造过程

2012-10-20 
Ubuntu ARM交叉编译工具链制作过程本文主机环境为Ubuntu10.04.4桌面版内核:2.6.32GCC:4.4.3--------------

Ubuntu ARM交叉编译工具链制作过程

本文主机环境为Ubuntu10.04.4桌面版

内核:2.6.32

GCC:4.4.3

---------------------------------------------------转载请注明:xiaobin_hlj80---- 

Z.前期准备(使用root权限)

一、安装系统补丁

       1. 安装更新189个(2012-10-8)

二、网络

       1. 安装ssh,apt-get install ssh

          远程控制用

      2. 安装samba

         文件共享用

三、软件环境

    安装如下软件(apt-get install)

           1. bison

           2. flex

           3. libncurses5-dev

           4. build-essential(g++)

           5. gperf

           6. texinfo

           7. automake

           8. libtool

           9. gawk

               update-alternatives –config awk

          10. cvs

          11.subversion(svn)

          12. zlib1g-dev

          13.libexpat-dev(cross-gdb)

 

Y. 安装crosstool-ng

   1.解压缩

      # tar jxvf crosstool-ng-1.16.0.tar.bz2

   2.配置

     # ./configure --prefix=/usr/local/ctng

   3.生成

     # make

   4.安装

     # make install

 

 X. 配置crosstool-ng

     1. 增加安装路径到系统路径中

        export PATH=$PATH:/usr/local/ctng/bin

    2. 建立一个临时目录

        # cd ~

        root@xiaobin-pc:~# mkdir toolchain-build

 

3. 拷贝预配置文件到临时目录

    root@xiaobin-pc:/# cd /usr/local/ctng/lib/ct-ng.1.16.0/samples

    root@xiaobin-pc:/usr/local/ctng/lib/ct-ng.1.16.0/samples# cp arm-unknown-linux-gnueabi/* ~/toolchain-build/

    # cd ~

    root@xiaobin-pc:~# cd crosstool-build

    root@xiaobin-pc:~/toolchain-build# mvcrosstool.config .config

4. 执行菜单配置(menuconfig)

  此步为修改默认选项,以适应我们的目标板。

  (1) 更改shell为bash

     如果运行

     # ls -la /bin/sh

    看到链接的是 dash ,则请运行以下命令

    sudo dpkg-reconfigure dash

    选择 no 以删除 dash

 

  (2)root@xiaobin-pc:~/toolchain-build#ct-ng menuconfig

      a. Paths and misc options

        1)crosstool-NG behavior

          默认

        2)Paths

          默认

        3)Downloading

          默认

        4)Extracting

          默认

        5)Build behavior

          (2) Number of parallel jobs

        6)Logging

          默认

      b. Target options

        Target Architecture (arm)

        1)Generic target options

        2)Target optimizations

        3)arm other options

      c. Toolchain options

        1)General toolchain options

        2)Tuple completion and aliasing

        3)Toolchain type

        4)Build system

        5)Misc options

 

      d. Operating System

        Linux kernel version (2.6.32.59)

        1)Common kernel options

        2)linux other options

      e. Binary utilities

        Binuary format: (ELF)

        1)GNU binutils

           Binutils version (2.19.1a)

        2)elf2flt

      f. C compiler

        C compiler (gcc)

        gcc version (4.4.3)

        1)Additional supported languages

        2)gcc other options

        3)Optimisation features

        4)Settings for libraries running on target

        5)Misc. obscure options

 

      g. C-library

        C library (glibc)

        glibc version (2.9)

 

      h. Debug facilities

 

      i. Companion libraries

        GMP version (4.3.2)

        MPFR version (2.4.2)

        PPL version (0.10.2)

        CLooG/ppl version (0.15.9)

 

        1)libelf version needed to build for target

           libelf version (0.8.13)

        2)Companion libraries common options

      j. Companion tools

      k. Test suite

 

5. 下载文件

    此步是为了节省下载时间,我们使用下载工具把文件(bz2)下载下来,然后拷贝到$HOME/src(默认目录)下。

    (1) linux-2.6.32.59.tar.bz2

    (2) gcc-4.4.3.tar.bz2

    (3) binutils-2.19.1a.tar.bz2

    (4) mpfr-2.4.2.tar.bz2

    (5) gmp-4.3.2.tar.bz2

    (6) ppl-0.10.2.tar.bz2

    (7) gdb-6.8a.tar.bz2

    (8) expat-2.0.1.tar.gz

    (9) strace-4.5.19.tar.bz2

    (10) cloog-ppl-0.15.9.tar.gz

    (11) dmalloc-5.5.2.tgz

    (12) libelf-0.8.13

    (13) duma-2_5_15

    (14) ltrace_0.5.3.orig.tar.gz

    (15)ncurses-5.9.tar.gz

    (16) elf2flt-cvs-head.tar.gz

    (17)glibc-2.9.tar.bz2

    (18)glibc-ports-2.9.tar.bz2


6. 生成交叉编译环境

    root@xiaobin-pc:~/toolchain-build# ct-ngbuild


7. 测试

root@xiaobin-pc:~/toolchain-build# ct-ng build[INFO ]  Performing some trivial sanity checks[INFO ]  Build started 20121009.200246[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-unknown-linux-gnueabi[EXTRA]  Dumping internal crosstool-NG configuration: done in 0.33s (at 00:17)[INFO ]  =================================================================[INFO ]  Retrieving needed toolchain components' tarballs[INFO ]  Retrieving needed toolchain components' tarballs: done in 0.57s (at 00:18)[INFO ]  =================================================================[INFO ]  Extracting and patching toolchain components[INFO ]  Extracting and patching toolchain components: done in 2.30s (at 00:20)[INFO ]  =================================================================[INFO ]  Installing GMP for host[EXTRA]    Configuring GMP[EXTRA]    Building GMP[EXTRA]    Installing GMP[INFO ]  Installing GMP for host: done in 331.71s (at 05:52)[INFO ]  =================================================================[INFO ]  Installing MPFR for host[EXTRA]    Configuring MPFR[EXTRA]    Building MPFR[EXTRA]    Installing MPFR[INFO ]  Installing MPFR for host: done in 70.29s (at 07:02)[INFO ]  =================================================================[INFO ]  Installing PPL for host[EXTRA]    Configuring PPL[EXTRA]    Building PPL[EXTRA]    Installing PPL[INFO ]  Installing PPL for host: done in 666.86s (at 18:09)[INFO ]  =================================================================[INFO ]  Installing CLooG/PPL for host[EXTRA]    Configuring CLooG/ppl[EXTRA]    Building CLooG/ppl[EXTRA]    Installing CLooG/ppl[INFO ]  Installing CLooG/PPL for host: done in 18.87s (at 18:28)[INFO ]  =================================================================[INFO ]  Installing binutils for host[EXTRA]    Configuring binutils[EXTRA]    Building binutils[EXTRA]    Installing binutils[INFO ]  Installing binutils for host: done in 234.95s (at 22:23)[INFO ]  =================================================================[INFO ]  Installing pass-1 core C compiler[EXTRA]    Configuring core C compiler[EXTRA]    Building core C compiler[EXTRA]    Installing core C compiler[INFO ]  Installing pass-1 core C compiler: done in 509.17s (at 30:52)[INFO ]  =================================================================[INFO ]  Installing kernel headers[EXTRA]    Installing kernel headers[EXTRA]    Checking installed headers[INFO ]  Installing kernel headers: done in 15.55s (at 31:08)[INFO ]  =================================================================[INFO ]  Installing C library headers & start files[EXTRA]    Configuring C library[EXTRA]    Installing C library headers[EXTRA]    Installing C library start files[INFO ]  Installing C library headers & start files: done in 130.23s (at 33:18)[INFO ]  =================================================================[INFO ]  Installing pass-2 core C compiler[EXTRA]    Configuring core C compiler[EXTRA]    Building core C compiler[EXTRA]    Installing core C compiler[INFO ]  Installing pass-2 core C compiler: done in 569.12s (at 42:47)[INFO ]  =================================================================[INFO ]  Installing C library[EXTRA]    Configuring C library[EXTRA]    Building C library[EXTRA]    Installing C library[INFO ]  Installing C library: done in 2104.58s (at 77:52)[INFO ]  =================================================================[INFO ]  Installing final compiler[EXTRA]    Configuring final compiler[EXTRA]    Building final compiler[EXTRA]    Installing final compiler[INFO ]  Installing final compiler: done in 966.51s (at 93:59)[INFO ]  =================================================================[INFO ]  Installing libelf for the target[EXTRA]    Configuring libelf[EXTRA]    Building libelf[EXTRA]    Installing libelf[INFO ]  Installing libelf for the target: done in 15.31s (at 94:14)[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 276.20s (at 98:50)[INFO ]  =================================================================[INFO ]  Installing dmalloc[EXTRA]    Configuring dmalloc[EXTRA]    Building dmalloc[EXTRA]    Installing dmalloc[INFO ]  Installing dmalloc: done in 27.61s (at 99:18)[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 4.52s (at 99:22)[INFO ]  =================================================================[INFO ]  Installing cross-gdb[EXTRA]    Configuring cross-gdb[EXTRA]    Building cross-gdb[EXTRA]    Installing cross-gdb[INFO ]  Installing cross-gdb: done in 438.62s (at 106:41)[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 840.62s (at 120:42)[INFO ]  =================================================================[INFO ]  Installing gdbserver[EXTRA]    Configuring gdbserver[EXTRA]    Building gdbserver[EXTRA]    Installing gdbserver[INFO ]  Installing gdbserver: done in 26.35s (at 121:08)[INFO ]  =================================================================[INFO ]  Installing ltrace[EXTRA]    Copying sources to build dir[EXTRA]    Configuring ltrace[EXTRA]    Building ltrace[EXTRA]    Installing ltrace[INFO ]  Installing ltrace: done in 9.97s (at 121:18)[INFO ]  =================================================================[INFO ]  Installing strace[EXTRA]    Configuring strace[EXTRA]    Building strace[EXTRA]    Installing strace[INFO ]  Installing strace: done in 42.10s (at 122:00)[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 6.30s (at 122:07)[INFO ]  Build completed at 20121009.220452[INFO ]  (elapsed: 122:05.45)[INFO ]  Finishing installation (may take a few seconds)...[122:07] / root@xiaobin-pc:~/toolchain-build#




热点排行