在RHEL6.0下利用crosstool-ng编译ARMv4t交叉工具链
主机环境:
RHEL6.0
kernel 2.6.32-220.2.1.el6.i686
gcc-4.4.6
1.下载crosstool-ng
2.检查以下相关是否安装
bison flex texinfo automake libtool ncurses-devel gcc-java gcc-c++ svn expat-devel python-devel glibc-static
3.crosstool-ng的安装
cd /work/rhel/
mkdir crosstoolng
tar xvjf ~/Downloads/crosstool-ng-1.13.2.tar.bz2 -C .
cd crosstool-ng-1.13.2/
#下载和安装补丁
wget download/crosstool-ng/01-fixes/1.13.2/000-cc_gcc_Apply_CT_CC_GCC_DISABLE_PCH_to_do_cc_core_.patch
wget download/crosstool-ng/01-fixes/1.13.2/001-scripts_functions_extract_portable_call_for_old_and_defective_tars.patch
wget download/crosstool-ng/01-fixes/1.13.2/002-scripts_use_CT_CONFIG_SHELL_instead_of_CT_SHELL.patch
patch -p1 < 000-cc_gcc_Apply_CT_CC_GCC_DISABLE_PCH_to_do_cc_core_.patch
patch -p1 < 001-scripts_functions_extract_portable_call_for_old_and_defective_tars.patch
patch -p1 < 002-scripts_use_CT_CONFIG_SHELL_instead_of_CT_SHELL.patch
./configure --prefix=/work/rhel/crosstoolng
make
make install
#设置环境变量
#sudo cp ct-ng.comp /etc/bash_completion.d/
echo "PATH=$PATH:/work/rhel/crosstoolng/bin" >> ~/.bashrc
source ~/.bashrc
4.交叉工具链的配置
cd /work/rhel/crosstoolng/
mkdir build_toolchain
ct-ng arm-unknown-linux-gnueabi
ct-ng menuconfig #配置
./bin/ct-ng build
问题解决:
[ERROR] Static linking impossible on the host system 'i686-build_pc-linux-gnu'
方法:安装安装glibc-static
阅读(1586) | 评论(0) | 转发(0) |