Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1015452
  • 博文数量: 244
  • 博客积分: 6820
  • 博客等级: 准将
  • 技术积分: 3020
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-09 21:33
文章分类

全部博文(244)

文章存档

2013年(1)

2012年(16)

2011年(132)

2010年(3)

2009年(12)

2008年(80)

我的朋友

分类: LINUX

2008-09-09 23:53:34

 
 
 
 
 
今天使用crosstool制作了arm-linux交叉编译工具链,并且成功编译和运行u-boot-1.3.0。
通过了解crosstool。
要制作的交叉编译工具链版本为3.3.2。
具体步骤如下:
下载crosstool-0.43.tar.gz
mkdir      /home/wxm/crosstool
cp     crosstool-0.43.tar.gz     /home/wxm/crosstool
cd     /home/wxm/crosstool
tar     -jxvf crosstool-0.43.tar.gz
mkdir downloads
下载源码包:
binutils-2.15.tar.bz2
gcc-3.3.2.tar.gz
glibc-2.3.2.tar.gz
glibc-linuxthreads-2.3.2.tar.gz
linux-2.6.9.tar.bz2
复制到  /home/wxm/crosstool/downloads
修改arm.dat
KERNELCONFIG=`pwd`/arm.config
TARGET=arm-linux
TARGET_CFLAGS="-O"
修改demo-arm.sh:            
#!/bin/sh
# This script has one line for each known working toolchain
# for this architecture.  Uncomment the one you want.
# Generated by generate-demo.pl from buildlogs/all.dats.txt
set -ex
TARBALLS_DIR=/home/wxm/crosstool/downloads     #下载的源码包存放的路径
RESULT_TOP=/home/wxm/crosstool/install                #交叉编译工具来链安装的路径
export TARBALLS_DIR RESULT_TOP
GCC_LANGUAGES="c,c++"
export GCC_LANGUAGES
# Really, you should do the mkdir before running this,
# and chown /opt/crosstool to yourself so you don't need to run as root.
mkdir -p $RESULT_TOP
#eval `cat arm.dat gcc-2.95.3-glibc-2.1.3.dat` sh all.sh --notest
#eval `cat arm.dat gcc-2.95.3-glibc-2.2.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-2.95.3-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.2.3-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.2.3-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.2.3-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.3.6-glibc-2.2.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.3.6-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.3.6-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.3.6-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.4.5-glibc-2.2.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.4.5-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.4.5-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.4.5-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.4.5-glibc-2.3.5.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.4.5-glibc-2.3.5-tls.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest
#eval `cat arm.dat gcc-3.4.5-glibc-2.3.6-tls.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.0.2-glibc-2.2.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.0.2-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.0.2-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.0.2-glibc-2.3.5.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.0.2-glibc-2.3.5-tls.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.0.2-glibc-2.3.6.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.0.2-glibc-2.3.6-tls.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.1.0-glibc-2.2.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.1.0-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm.dat gcc-4.1.0-glibc-2.3.2-tls.dat` sh all.sh --notest  #注释
eval `cat arm.dat gcc-3.3.2-glibc-2.3.2.dat` sh all.sh --notest     #添加此行
echo Done.
修改gcc-3.3.2-glibc-2.3.2.dat
BINUTILS_DIR=binutils-2.15
GCC_DIR=gcc-3.3.2
GLIBC_DIR=glibc-2.3.2
LINUX_DIR=linux-2.6.9
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
执行./demo-arm.sh
阅读(2261) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-06-28 15:00:42

回复 网友276886358@qq.com: 你遇到的问题是因为没有安装 patch 命令。 解决方法: sudo apt-get install patch 之后再执行: ./demo-arm.sh 即可解决。

276886358@qq.com2008-09-15 11:59:45

你好,我也在学习交叉编译,步骤也和你做的一样,但是最后出现点问题不知道什么原因,能帮我分析下吗? 最后出现这样的提示: applying patch /home/ljd/downloads/crosstool-0.43/patches/glibc-2.3.2/arm-asm-clobber.patch getandpatch.sh: 1: patch: not found patch /home/ljd/downloads/crosstool-0.43/patches/glibc-2.3.2/arm-asm-clobber.patch failed