热门关键字:  ubuntu  分区  函数  linux系统进程  Fedora

构造arm-linux交叉编译工具链(Tool Chain)

来源: 作者: 时间:2007-12-11 Tag: 点击:

Linux kernel package used: (ftp://ftp.kernel.org/pub/linux/kernel/v2.6/)
linux-2.6.17.tar.gz

GNU compiler sources: (ftp://ftp.gnu.org/gnu/)
binutils-2.17.tar.gz
gcc-3.4.6.tar.gz
glibc-2.3.6.tar.gz
glibc-linuxthreads-2.3.6.tar.gz

Patches used: (http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/)
33_all_pr15068-fix.patch
5090_all_divdi3-asm-fix.patch
6200_all_arm-glibc-2.3.6-ioperm.patch
6230_all_arm-glibc-2.3.6-socket-no-weak-lias.patch
gcc_eh.patch.cross

1. Preparation
Create project directory like this:
/root/scholar
|
|–toolchain
| |–binutils-2.17.tar.gz
| |–gcc-3.4.6.tar.gz
| |–glibc-2.3.6.tar.gz
| |–glibc-linuxthreads-2.3.6.tar.gz
|
|–patches
| |–33_all_pr15068-fix.patch
| |–5090_all_divdi3-asm-fix.patch
| |–6200_all_arm-glibc-2.3.6-ioperm.patch
| |–6230_all_arm-glibc-2.3.6-socket-no-weak-lias.patch
| |–gcc_eh.patch.cross
|
|–kernel
|–linux-2.6.17.tar.gz

export PREFIX=/usr/local/arm/scholar

2. Building binutils-2.17
tar -zxvf binutils-2.17.tar.gz
cd binutils-2.17
mkdir arm-linux
cd arm-linux
../configure –target=arm-linux –prefix=$PREFIX –program-prefix=arm-linux-
make
make install

3. Bootstrap GCC (First time compiling GCC without glibc, only pure-C is supported)
tar -zxvf gcc-3.4.6.tar.gz
patch -p1 -d gcc-3.4.6 < patches/33_all_pr15068-fix.patch
cd gcc-3.4.6
vi gcc/config/arm/t-linux (TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC -Dinhibit_libc -D__gthr_posix_h)
mkdir arm-linux
cd arm-linux
../configure –target=arm-linux –prefix=$PREFIX –program-prefix=arm-linux- –disable-threads –disable-shared –enable-languages=c
make
make install

最新评论共有 4 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册