host平台:
ubuntu 12.04
AMD 64
目标平台:
ARM920T
开发板 QQ2440
使用工具:
crosstool-ng
===============================================================================
创建/home/steven/arm-linux-crosstool作为本次交叉工具编译链的工作根目录。
解压下载的crosstool-ng-1.9.3
创建两个目录:
crosstool-ng-1.9.3-build 用于工作目录
crosstool-ng-1.9.3-install 用于安装ct-ng
cd crosstool-ng-1.9.3
./configure --prefix=/home/steven/arm-linux-crosstool/crosstool-ng-1.9.3-install
期间会不断提示找不到一些文件,需要什么,就安装什么就是了。
这么几个是有点特殊
1)makeinfo 找不到,安装texinfo
http://blog.chinaunix.net/uid-28708203-id-3589984.html
2)
Checking for 'aria2c'... no
Checking for 'curl'... no
Checking for 'wget'... /usr/bin/wget
Checking for 'cvs'... no
aria2c其实就是个下载工具,有了wget估计就够了 cvs却是必须的。
3)
Checking for 'ncurses/ncurses.h'... no
Checking for 'ncurses/curses.h'... no
Checking for 'ncurses.h'... no
Checking for 'curses.h'... no
sudo apt-get install libncurses5-dev
make;make install
/home/steven/arm-linux-crosstool/crosstool-ng-1.9.3-install/bin/ct-ng
这就是编译出的工具
sudo cp ct-ng /usr/bin/
=================================================================================
准备编译交叉编译工具:
cd /home/steven/arm-linux-crosstool/crosstool-ng-1.9.3-build
cp samples/arm-unknown-linux-gnueabi/* .
cp crosstool.config .config
------------------------------------------------------------------------------------------------------------------------
ct-ng menuconfig
配置按照http://blog.chinaunix.net/uid-20543672-id-94369.html 来配置
Target options --->
*** Target optimisations ***
(armv4t) Architecture level
(arm9tdmi) Emit assembly for CPU
(arm920t) Tune for CPU
-------------------------------------------------------------------------------------------------------------------------------
Paths and misc options --->
/home/steven/arm-linux-crosstool/tarballs Local tarballs directory 保存源码包路径
/home/steven/arm-linux-crosstool/crosstool-result Prefix directory 交叉编译器的安装路径
-----------------------------------------------------------------------------------------------------------------------------
增加编译时的并行进程数,以增加运行效率,加快编译。
Paths and misc options --->
*** Build behavior ***
(4) Number of parallel jobs
------------------------------------------------------------------------------------------------------------------------------------
关闭JAVA编译器,避免错误。
我这里用ubuntu 9.10编译JAVA编译器的时候会出错,也许是host的gcj的问题,反正我不用JAVA,所以就直接关闭了。如果有兄弟知道如何修正记得通知一声!!
C compiler --->
*** Additional supported languages: ***
[N] Java
------------------------------------------------------------------------------------------------------------------------------------------
ct-ng build
====================================================================================================================
编出来之后,使用的时候卡在一个错误上,”
交叉编译工具报错Fatal error: invalid -march= option: `armv4t'“解决方式如下:
http://blog.chinaunix.net/uid-28708203-id-3569219.html
====================================================================================================================
Stopping and restarting a build
If you want to stop the build after a step you are debugging, you can pass the
variable STOP to make:
ct-ng build STOP=some_step
Conversely, if you want to restart a build at a specific step you are
debugging, you can pass the RESTART variable to make:
ct-ng build RESTART=some_step
Alternatively, you can call make with the name of a step to just do that step:
ct-ng libc_headers
is equivalent to:
ct-ng build RESTART=libc_headers STOP=libc_headers
The shortcuts +step_name and step_name+ allow to respectively stop or restart
at that step. Thus:
ct-ng +libc_headers and: ct-ng libc_headers+
are equivalent to:
ct-ng build STOP=libc_headers and: ct-ng build RESTART=libc_headers
To obtain the list of acceptable steps, please call:
ct-ng list-steps
Note that in order to restart a build, you'll have to say 'Y' to the config
option CT_DEBUG_CT_SAVE_STEPS, and that the previous build effectively went
that far.
---------------------------------------------------------------------------------------------------------------------------------
阅读(1941) | 评论(0) | 转发(0) |