查看完整版本: 一步一步建立基于ARM+Linux的cross toolchain

wdefu 2007-3-10 10:00

一步一步建立基于ARM+Linux的cross toolchain

[size=3][color=#000000][font=宋体]一步一步建立基于[/font][font=Times New Roman]ARM+Linux[/font][font=宋体]的[/font][font=Times New Roman]cross toolchain[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]        [/font][font=宋体]声明:本文在参考网上资料的基础上,以梁元恩的《如何为嵌入式开发建立交叉编译环境》为蓝本修改而成。对于自己在建立过程中遇到的问题进行了详细的说明,本文随自己学习的深入会进行相应的更新。[/font][/color][/size]
[align=center][align=center][size=3][color=#000000][/color][/size][/align][/align][size=3][color=#000000][font=Times New Roman]1 [/font][font=宋体]引言[/font][/color][/size]
[size=3][color=#000000][font=宋体]由于一般嵌入式开发系统存储容量有限,在裁减和定制[/font][font=Times New Roman]Linux[/font][font=宋体],运用于嵌入式系统前,通常需要在[/font][font=Times New Roman]PC[/font][font=宋体]机上建立一个用于目标机的交叉编译环境,也就是将各种二进制工具程序集成为工具链,其中包括如[/font][font=Times New Roman]GNU[/font][font=宋体]的链接器([/font][font=Times New Roman]ld[/font][font=宋体])、[/font][font=Times New Roman]GNU[/font][font=宋体]的汇编器([/font][font=Times New Roman]as[/font][font=宋体])、[/font][font=Times New Roman]ar[/font][font=宋体](产生修改和解开一个存档文件)、[/font][font=Times New Roman]C[/font][font=宋体]编译器([/font][font=Times New Roman]gcc[/font][font=宋体])以及[/font][font=Times New Roman]C[/font][font=宋体]链接库([/font][font=Times New Roman]glibc[/font][font=宋体])。本文以在[/font][font=Times New Roman]Linux[/font][font=宋体]系统上针对目标机[/font][font=Times New Roman]arm[/font][font=宋体]为例,介绍了跨平台开发工具链的建立过程。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]2 [/font][font=宋体]基本概念[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]2.1 [/font][font=宋体]什么是交叉编译?[/font][/color][/size]
[size=3][color=#000000][font=宋体]简单地说,交叉编译就是在一个平台上生成在另一个平台上执行的代码。这里的平台包括体系结构([/font][font=Times New Roman]Architecture[/font][font=宋体])和操作系统([/font][font=Times New Roman]OS[/font][font=宋体])。同一个体系结构可以运行不同的操作系统,同样,同一个操作系统也可以在不同的体系结构上运行。举例来说,[/font][font=Times New Roman]x86 Linux[/font][font=宋体]平台是[/font][font=Times New Roman]Intel x86 [/font][font=宋体]体系结构和[/font][font=Times New Roman]Linux for x86[/font][font=宋体]操作系统的统称。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]2.2 [/font][font=宋体]为什么要用交叉编译?[/font][/color][/size]
[size=3][color=#000000][font=宋体]原因有两个。一是目标平台所需要的[/font][font=Times New Roman]bootloader[/font][font=宋体]以及[/font][font=Times New Roman]OS[/font][font=宋体]核心还没有建立时,需要作交叉编译。二是目标机设备不具备一定的处理器能力和存储空间,即单独在目标板上无法完成程序开发,所以只好求助宿主机。这样可以在宿主机上对即将在目标机上运行的应用程序进行编译,生成可以在目标机上运行的代码格式,然后移植到目标板上,也就是目前嵌入式程序开发的[/font][font=Times New Roman]Host/Target[/font][font=宋体]模式。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]2.3 [/font][font=宋体]对于[/font][font=Times New Roman]i386[/font][font=宋体]的理解[/font][/color][/size]
[size=3][color=#000000][font=宋体]如果单纯说[/font][font=Times New Roman]i386[/font][font=宋体]、[/font][font=Times New Roman]i686[/font][font=宋体],就是指平时所说的[/font][font=Times New Roman]CPU[/font][font=宋体]类型。从[/font][font=Times New Roman]Linux[/font][font=宋体]内核设计上讲,[/font][font=Times New Roman]i386[/font][font=宋体]是架构,[/font][font=Times New Roman]i486/586/686[/font][font=宋体]这些[/font][font=Times New Roman]CPU[/font][font=宋体]的架构都是[/font][font=Times New Roman]i386[/font][font=宋体],所以很多[/font][font=Times New Roman]linux[/font][font=宋体]方面的设计都是基于[/font][font=Times New Roman]i386[/font][font=宋体]。简单地说,[/font][font=Times New Roman]i386[/font][font=宋体]跟[/font][font=Times New Roman]ppc,alpha,arm[/font][font=宋体]等放在一起时就是指架构,跟[/font][font=Times New Roman]i586[/font][font=宋体],[/font][font=Times New Roman]i686[/font][font=宋体]放在一起指处理器型号,一个是横向的,一个是纵向的。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]3 [/font][font=宋体]建立过程[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]3.1 [/font][font=宋体]选定软件版本[/font][/color][/size]
[size=3][color=#000000][font=宋体]要想选用适当的版本,以保证建立的工具链可用,就必须找到适合主机和目标板的组合。这些可以自己测试,也可以从网上寻找已经测试过的版本组合,即[/font][font=Times New Roman]binutils[/font][font=宋体]、[/font][font=Times New Roman]gcc[/font][font=宋体]、[/font][font=Times New Roman]glibc[/font][font=宋体]的版本组合。我用的宿主机为[/font][font=Times New Roman]redhat-9.0[/font][font=宋体],目标机[/font][font=Times New Roman]arm[/font][font=宋体],选择的版本如下:[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]binutils-2.11.2.tar.gz  [/font][font=宋体]包含有[/font][font=Times New Roman]ld[/font][font=宋体]、[/font][font=Times New Roman]ar[/font][font=宋体]、[/font][font=Times New Roman]as[/font][font=宋体]等一些产生或者处理二进制文件的工具。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]gcc-core-2.95.3.tar.gz  [/font][font=宋体]包含[/font][font=Times New Roman]GCC[/font][font=宋体]的主体部分。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]gcc-g++2.95.3.tar.gz  [/font][font=宋体]可以使[/font][font=Times New Roman]GCC[/font][font=宋体]编译[/font][font=Times New Roman]C++[/font][font=宋体]程序。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]glibc-2.2.4.tar.gz  libc[/font][font=宋体]是很多用户层应用都要用到的库,即[/font][font=Times New Roman]C[/font][font=宋体]链接库。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]glibc-linuxthreads-2.2.4.tar.gz  libc[/font][font=宋体]用于支持[/font][font=Times New Roman]Posix[/font][font=宋体]线程单独发布的压缩包。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]linux-2.4.21.tar.gz+rmk1  Linux[/font][font=宋体]的内核及其支持[/font][font=Times New Roman]ARM[/font][font=宋体]的补丁包。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[font=宋体][size=3][color=#000000]你可以尝试选定更新的版本,编译无法通过时,依次使用较旧的版本。即时发现新版本组合能够编译成功,仍然需要测试建立的工具链是否可以使用。[/color][/size][/font]
[size=3][color=#000000][font=宋体]你可以从[/font][font=Times New Roman]FTP[/font][font=宋体]网站[/font][/color][url=ftp://ftp.gnu.org/gnu/][font=Times New Roman][color=#0044b6]ftp://ftp.gnu.org/gnu/[/color][/font][/url][color=#000000][font=宋体]或者任何其他的镜像网站下载[/font][font=Times New Roman]GNU[/font][font=宋体]工具链的各个组件:[/font][font=Times New Roman]binutils[/font][font=宋体]包位于[/font][font=Times New Roman]binutils[/font][font=宋体]目录,[/font][font=Times New Roman]gcc[/font][font=宋体]包位于[/font][font=Times New Roman]gcc[/font][font=宋体]目录,而[/font][font=Times New Roman]glibc[/font][font=宋体]包与[/font][font=Times New Roman]glibc-linuxthreads[/font][font=宋体]包放在[/font][font=Times New Roman]glibc[/font][font=宋体]目录。下面给出上面选用的各个版本的下载路径。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]binutils-2.11.2.tar.gz [/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]ftp://ftp.gnu.org/gnu/binutils/binutils-2.11.2.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]gcc-core-2.95.3.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/gcc-core-2.95.3.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]gcc-g++2.95.3.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/gcc-g++-2.95.3.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]glibc-2.2.4.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]ftp://ftp.gnu.org/gnu/glibc/glibc-2.2.4.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]glibc-linuxthreads-2.2.4.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.2.4.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]linux-2.4.21.tar.gz+rmk1[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]ftp://ftp.kernle.org/pub/linux/kernel/v2.4/linux-2.4.21.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]ftp://ftp.arm.linux.org.uk/pub/linux/arm/kernel/v2.4/patch-2.4.21-rmk1.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]3.2   [/font][font=宋体]建立工作目录[/font][/color][/size]
[size=3][color=#000000][font=宋体]我的用户名为[/font][font=Times New Roman]lqm[/font][font=宋体],所以所有的工作都在[/font][font=Times New Roman]/home/lqm[/font][font=宋体]下面建立完成。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$cd /home/lqm              [/font][font=宋体]进入工作目录[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]$pwd                     [/font][font=宋体]查看当前目录[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]/home/lqm[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$mkdir embedded-system      [/font][font=宋体]创建工具链文件夹[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]$ls                        [/font][font=宋体]查看[/font][font=Times New Roman]/home/lqm[/font][font=宋体]建立的所有文件[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]embedded-system[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=宋体]现在已经建立了顶层文件夹[/font][font=Times New Roman]embedded-system[/font][font=宋体],下面在此文件夹下建立如下几个目录:[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]setup-dir  [/font][font=宋体]存放下载的压缩包[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]src-dir  [/font][font=宋体]存放[/font][font=Times New Roman]binutils[/font][font=宋体]、[/font][font=Times New Roman]gcc[/font][font=宋体]、[/font][font=Times New Roman]glibc[/font][font=宋体]解压之后的源文件[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]kernel  [/font][font=宋体]存放内核文件,对内核的配置和编译工作也在此完成[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]build-dir  [/font][font=宋体]编译[/font][font=Times New Roman]src-dir[/font][font=宋体]下面的源文件。这是[/font][font=Times New Roman]GNU[/font][font=宋体]推荐的源文件目录与编译目录分离的做法。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]tool-chain  [/font][font=宋体]交叉编译工具链的安装位置[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]program [/font][font=宋体]存放编写程序[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]doc  [/font][font=宋体]说明文档和脚本文件[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[font=宋体][size=3][color=#000000]下面建立目录,并且下载源文件。[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$pwd[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]/home/lqm/[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd embedded-system[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$mkdir setup-dir src-dir kernel build-dir tool-chain program doc[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$ls[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]build-dir doc kernel program setup-dir src-dir tool-chain[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd setup-dir[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.11.2.tar.gz   [/font][font=宋体]下载源文件[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]$wget ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/gcc-core-2.95.3.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$wget ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/gcc-g++-2.95.3.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$wget ftp://ftp.gnu.org/gnu/glibc/glibc-2.2.4.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$wget ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.2.4.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.21.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$wget ftp://ftp.arm.linux.org.uk/pub/linux/arm/kernel/v2.4/ patch-2.4.21-rmk1.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$ls[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]binutils-2.11.2.tar.gz gcc-g++-2.95.3.tar.gz glibc-linuxthreads-2.2.4.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]patch-2.4.21-rmk1.gz gcc-core-2.95.3.tar.gz glibc-2.2.4.tar.gz linux-2.4.21.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd ../build-dir[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$mkdir build-binutils build-gcc build-glibc  [/font][font=宋体]建立编译目录[/font][font=Times New Roman] [/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]3.3     [/font][font=宋体]输出环境变量[/font][/color][/size]
[size=3][color=#000000][font=宋体]在建立与使用某些工具程序时,可能会用到这些目录的路径,如果设计一个简短的命令脚本,设定适当的环境变量,则可以简化操作过程。下面就建立命令脚本[/font][font=Times New Roman]hjbl[/font][font=宋体]:[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$pwd[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]/home/lqm/embedded-system/build-dir[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd ../doc[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$mkdir scripts[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd scripts[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$emacs hjbl   [/font][font=宋体]用文本编辑器[/font][font=Times New Roman]emacs[/font][font=宋体]编译环境变量脚本[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=宋体]在随后打开的[/font][font=Times New Roman]emacs[/font][font=宋体]编辑窗口中输入下面内容(如果在命令行界面下,则必须要用到[/font][font=Times New Roman]vi[/font][font=宋体]文本编辑器,[/font][font=Times New Roman]emacs[/font][font=宋体]则不可以):[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]export  PRJROOT=/home/lqm/embedded-system[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]export  TARGET=arm-linux[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]export  PREFIX=$PRJROOT/tool-chain[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]export  TARGET_PREFIX=$PREFIX/$TARGET[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]export  PATH=$PREFIX/bin:$PATH[/color][/size][/font]
[size=3][color=#000000][font=宋体]保存后关闭[/font][font=Times New Roman]emacs[/font][font=宋体]窗口,如果要在目前的窗口中执行此脚本,即让环境变量生效,还需要执行下面的语句:[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$. hjbl([/font][font=宋体]注意:在点和[/font][font=Times New Roman]hjbl[/font][font=宋体]之间有一个空格[/font][font=Times New Roman])[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]$cd $PRJROOT  [/font][font=宋体]验证环境变量是否生效[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]$ls[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]build-dir doc kernel program setup-dir src-dir tool-chain[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=宋体]该环境变量的作用时间仅仅在[/font][font=Times New Roman]Terminal[/font][font=宋体]当前窗口,如果将窗口关闭,开启一个新的窗口,则环境变量实效,需要重新执行下面的命令:[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]$. /home/lqm/embedded-system/doc/scripts/hjbl[/color][/size][/font]
[font=宋体][size=3][color=#000000]说明:[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]TARGET[/font][font=宋体]变量用来定义目标板的类型,以后会根据此目标板的类型来建立工具链。参看表[/font][font=Times New Roman]1[/font][font=宋体]。目标板的定义与主机的类型是没有关系的,但是如果更改[/font][font=Times New Roman]TARGET[/font][font=宋体]的值,[/font][font=Times New Roman]GNU[/font][font=宋体]工具链必须重新建立一次。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]PREFIX[/font][font=宋体]变量提供了指针,指向目标板工具程序将被安装的目录。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]TARGET_PREFIX[/font][font=宋体]变量指向与目标板相关的头文件和链接库将被安装的目录。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]PATH[/font][font=宋体]变量指向二进制文件(可执行文件)将被安装的目录。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]                    [/font][font=宋体]表[/font][font=Times New Roman]1 TARGET[/font][font=宋体]变量值[/font][/color][/size]
[font=宋体][size=3][color=#000000]实际的目标板[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]TARGET[/font][font=宋体]变量值[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]PowerPC[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]powerpc-linux[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]ARM[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]arm-linux[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]MIPS(big endian)[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]mips-linux[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]MIPS(little endian)[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]mipsel-linux[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]SuperH 4[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]sh4-linux[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]3.4  [/font][font=宋体]内核头文件的配置[/font][/color][/size]
[font=宋体][size=3][color=#000000]内核头文件的配置是建立工具链的第一步。它与后面将要执行的其他步骤有着类似性,大多需要执行下面几步操作:[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]1[/font][font=宋体]、[/font][font=Times New Roman]  [/font][font=宋体]解压缩包[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]2[/font][font=宋体]、[/font][font=Times New Roman]  [/font][font=宋体]为跨平台开发设定包的配置[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]3[/font][font=宋体]、[/font][font=Times New Roman]  [/font][font=宋体]建立包[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]4[/font][font=宋体]、[/font][font=Times New Roman]  [/font][font=宋体]安装包[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$pwd[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]/home/lqm/embedded-system/[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd kernel[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$tar xvzf ../setup-dir/ linux-2.4.21.tar.gz                [/font][font=宋体]解压缩[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]$gunzip ../setup-dir/ patch-2.4.21-rmk1.gz [/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$cd linux-2.4.21[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]$patch –p1 < ../../setup-dir/patch-2.4.21-rmk1            [/font][font=宋体]给[/font][font=Times New Roman]Linux[/font][font=宋体]内核打补丁[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]$make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig   [/font][font=宋体]配置[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]$make dep[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=宋体]变量[/font][font=Times New Roman]ARCH[/font][font=宋体]和[/font][font=Times New Roman]CROSS_COMPILE[/font][font=宋体]的值与目标板的架构类型有关。如果使用[/font][font=Times New Roman]PPC[/font][font=宋体]目标板,则[/font][font=Times New Roman]ARCH=ppc CROSS_COMPILE=ppc-linux-[/font][font=宋体]。如果使用[/font][font=Times New Roman]i386[/font][font=宋体]目标板,则[/font][font=Times New Roman]ARCH=i386 CROSS_COMPILE=i386-linux-[/font][font=宋体]。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]make menuconfig[/font][font=宋体]是以文本菜单方式配置。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]make xconfig[/font][font=宋体]是以图形界面方式配置。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]       make config[/font][font=宋体]是纯文本方式界面配置。[/font][/color][/size]
[size=3][color=#000000][font=宋体]一般选择[/font][font=Times New Roman]make menuconfig[/font][font=宋体],注意在选项[/font][font=Times New Roman]System Types[/font][font=宋体]中选择正确的硬件类型。配置完退出并保存,检查一下的内核目录中的[/font][font=Times New Roman] kernel/linux-2.4.21/include/linux/version.h [/font][font=宋体]和[/font][font=Times New Roman]autoconf.h [/font][font=宋体]文件是不是生成了,这是编译[/font][font=Times New Roman]glibc[/font][font=宋体]是要用到。[/font][font=Times New Roman]version.h [/font][font=宋体]和[/font][font=Times New Roman] autoconf.h [/font][font=宋体]文件的存在,说明你生成了正确的头文件。[/font][/color][/size]
[size=3][color=#000000][font=宋体]然后,建立工具链需要的[/font][font=Times New Roman]include[/font][font=宋体]目录,并将内核头文件复制过去。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd include[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$ln -s asm-arm asm #[/font][font=宋体]可以查看一下,经过编译可以自动生成。如果已经生成连接,则不必写[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]$cd asm[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$ln -s arch-epxa arch  #[/font][font=宋体]同上说明[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]$ln -s proc-armv proc  #[/font][font=宋体]同上说明[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]                    #[/font][font=宋体]这些是针对[/font][font=Times New Roman]makefile[/font][font=宋体]文件作出的修改[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]$mkdir –p $TARGET_PREFIX/include[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cp –r $PRJROOT/kernel/linux-2.4.21/include/linux $TARGET_PREFIX/include[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cp –r $PRJROOT/kernrl/linux-2.4.21/include/asm-arm $TARGET_PREFIX/include/asm[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=宋体][size=3][color=#000000]注意:[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]1[/font][font=宋体]、不必再每次重新设定内核配置之后重建工具链,除非你变更了处理器或系统的类型。工具链只需要一组可供目标板使用的有效头文件即可,这些头文件在前面的程序中早就已经提供了。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]2[/font][font=宋体]、[/font][font=Times New Roman]asm-linux[/font][font=宋体]文件夹放到目标文件夹[/font][font=Times New Roman]$TARGET_PREFIX/include/[/font][font=宋体]时要更改名称为[/font][font=Times New Roman]asm[/font][font=宋体],因为配置文件的[/font][font=Times New Roman]include[/font][font=宋体]包含都是[/font][font=Times New Roman]<asm/*.h>[/font][font=宋体]方式。这也是交叉编译的不同之处。否则就会出现类似下面的错误提示:[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]   .........[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]    done[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]    _udivsi3[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]    _divsi3[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]    _umodsi3[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]    _modsi3[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]    _dwmd_lnx[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]    libgcc1.s:438:asm/unistd.h:No such file or directory[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]make [1] *** [libgcc1-asm.a] error 1[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]3.5  binutils([/font][font=宋体]二进制工具程序[/font][font=Times New Roman])[/font][font=宋体]的设置[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]    binutils[/font][font=宋体]包中的工具常用来操作二进制目标文件。该包中最重要的两个工具就是[/font][font=Times New Roman]GNU[/font][font=宋体]汇编器[/font][font=Times New Roman]as[/font][font=宋体]和链接器[/font][font=Times New Roman]ld[/font][font=宋体]。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/src-dir[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$tar xvzf ../setup-dir/binutils-2.11.2.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/build-dir/build-binutils[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$../../src-dir/binutils-2.11.2/configure --target=$TARGET --prefix=$PREFIX[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$make[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$make install[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$ls $PREFIX/bin           [/font][font=宋体]验证安装的结果是否正确[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]arm-linux-addr2line  arm-linux-ld  arm-linux-readelf[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]arm-linux-ar  arm-linux-nm  arm-linux-size[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]arm-linux-as  arm-linux-objcopy  arm-linux-strings[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]arm-linux-c++filt  arm-linux-objdump  arm-linux-strip[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]arm-linux-gasp  arm-linux-ranlib[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]    [/font][font=宋体]注意:每个工具的文件名的前缀都是前面为[/font][font=Times New Roman]TARGET[/font][font=宋体]变量设定的值。如果目标板是[/font][font=Times New Roman]i386-linux[/font][font=宋体],那么这些工具的文件名前缀就会是[/font][font=Times New Roman]i386-linux-[/font][font=宋体]。这样就可以根据目标板类型找到正确的工具程序。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]3.6  [/font][font=宋体]初始编译器的建立[/font][/color][/size]
[size=3][color=#000000][font=宋体]开始只能建立支持[/font][font=Times New Roman]C[/font][font=宋体]语言的引导编译器,因为缺少[/font][font=Times New Roman]C[/font][font=宋体]链接库([/font][font=Times New Roman]glibc[/font][font=宋体])的支持。等到[/font][font=Times New Roman]glibc[/font][font=宋体]编译好之后,可以重新编译[/font][font=Times New Roman]gcc[/font][font=宋体]并提供完整的[/font][font=Times New Roman]C++[/font][font=宋体]支持。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/setup-dir[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$mv gcc-core-2.95.3.tar.gz gcc-2.95.3.tar.gz  #[/font][font=宋体]重命名[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/src-dir[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$tar xvzf ../setup-dir/gcc-2.95.3.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/build-dir/build-gcc[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$../../src-dir/gcc-2.95.3/configure --target=$TARGET --prefix=$PREFIX --without-headers
--enable-languages=c[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]    [/font][font=宋体]因为是交叉编译器,还不需要目标板的系统头文件,所以需要使用[/font][font=Times New Roman] --without-headers[/font][font=宋体]这个选项。[/font][font=Times New Roman]--enable-language=c[/font][font=宋体]用来告诉配置脚本,需要产生的编译器支持何种语言,现在只能支持[/font][font=Times New Roman]C[/font][font=宋体]语言。[/font][font=Times New Roman]--disable-threads[/font][font=宋体]是因为[/font][font=Times New Roman]threads[/font][font=宋体]需要[/font][font=Times New Roman]glibc[/font][font=宋体]的支持。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]    [/font][font=宋体]准备好了[/font][font=Times New Roman]Makefile[/font][font=宋体]文件,进行编译之前,需要修改[/font][font=Times New Roman]src-dir/gcc-2.95.3/gcc/config/arm/t-linux[/font][font=宋体]文件,在[/font][font=Times New Roman]TARGET_LIBGCC2_CFLAGS[/font][font=宋体]中添加两个定义:[/font][font=Times New Roman]-Dinhibit_libc -D__gthr_posix_h[/font][font=宋体],否则会报错。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$make[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$make install[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]3.7  [/font][font=宋体]建立[/font][font=Times New Roman]C[/font][font=宋体]库([/font][font=Times New Roman]glibc[/font][font=宋体])[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]    [/font][font=宋体]这一步是最为繁琐的过程。目标板必须靠它来执行或者是开发大部分的应用程序。[/font][font=Times New Roman]glibc[/font][font=宋体]套件常被称为[/font][font=Times New Roman]C[/font][font=宋体]链接库,但是[/font][font=Times New Roman]glibc[/font][font=宋体]实际产生很多链接库,其中之一是[/font][font=Times New Roman]C[/font][font=宋体]链接库[/font][font=Times New Roman]libc[/font][font=宋体]。因为嵌入式系统的限制,标准[/font][font=Times New Roman]GNU C[/font][font=宋体]链接库显得太大,不适合应用在目标板上。所以需要寻找[/font][font=Times New Roman]C[/font][font=宋体]链接库的替代品,比如[/font][font=Times New Roman]uClibc[/font][font=宋体]。在这里,现以标准[/font][font=Times New Roman]GNU C[/font][font=宋体]为例建立工具链。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/src-dir[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$tar xvzf ../setup-dir/glibc-2.2.4.tar.gz[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$tar xvzf ../setup-dir/glibc-linuxthreads-2.2.4.tar.gz --directory=glibc-2.2.4[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/build-dir/build-glibc[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$CC=arm-linux-gcc ../../src-dir/glibc-2.2.4/configure --host=$TARGET --prefix=”/usr”
--enable-add-ons --with-headers=$TARGET_PREFIX/include[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$make[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$make install_root=$TARGET_PREFIX prefix=”” install[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=宋体]在这里设定了[/font][font=Times New Roman]install_root[/font][font=宋体]变量,指向链接库组件目前所要安装的目录。这样可以让链接库及其头文件安装到通过[/font][font=Times New Roman]TARGET_PREFIX[/font][font=宋体]指定的与目标板有关的目录,而不是建立系统本身的[/font][font=Times New Roman]/usr[/font][font=宋体]目录。因为之前使用[/font][font=Times New Roman]--prefix[/font][font=宋体]选项来设定[/font][font=Times New Roman]prefix[/font][font=宋体]变量的值,而且[/font][font=Times New Roman]prefix[/font][font=宋体]的值会被附加到[/font][font=Times New Roman]install_root[/font][font=宋体]的值之后,成为链接库组件的安装目录,所以需要重新设定[/font][font=Times New Roman]prefix[/font][font=宋体]的值。这样所有的[/font][font=Times New Roman]glibc[/font][font=宋体]组件将会安装到[/font][font=Times New Roman]$TARGET_PREFIX[/font][font=宋体]指定的目录下。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $TARGET_PREFIX/lib[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cp ./libc.so ./libc.so.orig[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=宋体]编辑文件[/font][font=Times New Roman]libc.so[/font][font=宋体],更改如下:[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]/* GNU ld script[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]  Use the shared library,but some functions are only in[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]  the static library,so try that secondarily.*/[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]GROUP(libc.so.6 libc_nonshared.a)[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]3.8  [/font][font=宋体]完整编译器的设置[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]    [/font][font=宋体]现在可以为目标板安装支持[/font][font=Times New Roman]C[/font][font=宋体]和[/font][font=Times New Roman]C++[/font][font=宋体]的完整编译器了。这个步骤相对于前面来建立过程要简单一些。[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/build-dir/build-gcc[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$../../src-dir/gcc-2.95.3/configure --target=$TARGET --prefix=$PREFIX
--enable-languages=c,c++[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$make all[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$make install[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]3.9  [/font][font=宋体]完成工具链的设置[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $TARGET_PREFIX/bin[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$file as ar gcc ld nm ranlib strip   [/font][font=宋体]查看文件是否为二进制文件[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$arm-linux-gcc -print-search-dirs  [/font][font=宋体]查看缺省的搜寻路径[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]$mv as ar gcc ld nm ranlib strip $PREFIX/lib/gcc-lib/arm-linux/2.95.3  [/font][font=宋体]转移文件[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$for file in as ar gcc ld nm ranlib strip[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]>do[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]>ln -s $PREFIX/lib/gcc-lib/arm-linux/2.95.3/$file[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]>done[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]3.10  [/font][font=宋体]使用工具链[/font][/color][/size]
[size=3][color=#000000][font=宋体]下面编写一个简单的[/font][font=Times New Roman]C[/font][font=宋体]程序,使用建立的工具链。、[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$cd $PRJROOT/program[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$emacs hello.c[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[size=3][color=#000000][font=宋体]在文本编辑器[/font][font=Times New Roman]emacs[/font][font=宋体]中编写:[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]#include <stdio.h>[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]int main()[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]{[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]       int i;[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]       for(i=1;i<9;i++)[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]              printf(“Hello World %d times!\n”,i);[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]}[/color][/size][/font]
[font=宋体][size=3][color=#000000]保存退出[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]--------------------------------------------------------------------------------[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$gcc -g hello.c -o hello[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$gdb[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000](gdb)file hello[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000](gdb)l[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]#include <stdio.h>[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]int main()[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]{[/color][/size][/font]
[size=3][color=#000000][font=Times New Roman]       int i;[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]       for(i=1;i<9;i++)[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]              printf(“Hello World %d times!\n”,i);[/font][/color][/size]
[font=Times New Roman][size=3][color=#000000]}[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000](gdb)r[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000](gdb)q[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$arm-linux-gcc -g hello.c -o hello-linux[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]$file hello-linux[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]hello-linux:ELF 32-bit LSB executable,ARM,version 1(ARM),for GNU/Linux 2.0.0,dynamically linked(uses shared libs),not stripped[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000]************************************************************[/color][/size][/font]
[size=3][color=#000000][font=宋体]上面的输出说明你编译了一个能在[/font][font=Times New Roman] arm [/font][font=宋体]体系结构下运行的[/font][font=Times New Roman] hello-linux[/font][font=宋体],证明你的编译工具做成功了。[/font][/color][/size]
[size=3][color=#000000][font=Times New Roman]4 [/font][font=宋体]总结[/font][/color][/size]
[font=宋体][size=3][color=#000000]通过上面的操作,已经能够建立全功能的跨平台开发工具链,在以后的嵌入式开发中将会经常用到。[/color][/size][/font]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
[font=Times New Roman][size=3][color=#000000] [/color][/size][/font]
页: [1]
查看完整版本: 一步一步建立基于ARM+Linux的cross toolchain