QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4143|回复: 5

arm toolchain script

[复制链接]
发表于 2003-8-4 23:39:15 | 显示全部楼层 |阅读模式
i attach two arm toolchain build scripts here. anybody has interest can try them.

 楼主| 发表于 2003-8-4 23:40:50 | 显示全部楼层
ft, i attach them but failed. i have to post here.
build-toolchain
[code:1]
#!/bin/sh -e
PREFIX=/usr/local/arm
TARGET=arm-linux
TARGET_PREFIX=$PREFIX/$TARGET
KERNEL=/opt/hardhat/devkit/kernel/linux-2.4.19/
HOST=i686-pc-linux-gnu
PATH=$PATH:$PREFIX/bin

if [ "$KERNEL" = "" -o ! -f "$KERNEL/Documentation/arm/README" ]; then
  echo "You haven't changed KERNEL to point at a valid kernel tree"
  exit 1
fi
if [ ! -f binutils-2.14.tar.bz2 ]; then
  echo Binutils 2.14 seems to be missing
  exit 1
fi
if [ ! -f gcc-3.2.3.tar.bz2 ]; then
  echo GCC 3.2.3 seems to be missing
  exit 1
fi

mkdir -p $PREFIX
rm -rf binutils-2.14
tar jxf binutils-2.14.tar.bz2
mkdir -p build-binutils-2.14
pushd build-binutils-2.14
../binutils-2.14/configure --target=arm-linux --prefix=$PREFIX
make -j4
make install
popd
rm -rf binutils-2.14
rm -rf build-binutils-2.14

rm -rf gcc-3.2.3
rm -rf build-gcc-3.2.3
tar jxf gcc-3.2.3.tar.bz2
mkdir -p build-gcc-3.2.3
pushd build-gcc-3.2.3
perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1 -Dinhibit_libc -D__gthr_posix_h/' ../gcc-3.2.3/gcc/config/arm/t-linux
echo 'T_CFLAGS = -Dinhibit_libc -D__gthr_posix_h' >> ../gcc-3.2.3/gcc/config/arm/t-linux
../gcc-3.2.3/configure --target=arm-linux --prefix=$PREFIX $HOST --with-headers=$KERNEL/include --disable-shared --disable-threads --enable-languages="c"
make -j4
make install
popd
rm -rf build-gcc-3.2.3
rm -rf gcc-3.2.3
rm -rf glibc-2.3.1
rm -rf build-glibc-2.3.1
tar -zxf glibc-2.3.1.tar.gz
tar -C glibc-2.3.1 -zxf glibc-linuxthreads-2.3.1.tar.gz
mkdir -p build-glibc-2.3.1
pushd build-glibc-2.3.1
perl -pi -e 's/i386/arm*)\n\tlibc_cv_gcc_unwind_find_fde=yes\n\tarch_minimum_kernel=2.0.10\n\t;;\n   i386/' ../glibc-2.3.1/sysdeps/unix/sysv/linux/configure
perl -pi -e 's/weak_alias \(__old_sys_nerr/\/\/ $&/' ../glibc-2.3.1/sysdeps/unix/sysv/linux/arm/errlist.c
CC=/usr/local/arm/bin/arm-linux-gcc ../glibc-2.3.1/configure --host=$TARGET --with-headers=$KERNEL/include --enable-add-ons --enable-shared --prefix="/usr" --without-fp
make
make install_root=$TARGET_PREFIX prefix="" install
popd
rm -rf glibc-2.3.1
rm -rf build-glibc-2.3.1
echo "change file libc.so, the line with text /lib/libc.so.6 to libc.so.6 and the line /lib/libc_nonshared.a to libc_nonshared"
cp $TARGET_PREFIX/lib/libc.so $TARGET_PREFIX/lib/libc.so.org
[/code:1]
回复

使用道具 举报

 楼主| 发表于 2003-8-4 23:41:33 | 显示全部楼层
build-gcc
[code:1]
#!/bin/sh -e
PREFIX=/usr/local/arm
TARGET=arm-linux
TARGET_PREFIX=$PREFIX/$TARGET
KERNEL=/opt/hardhat/devkit/kernel/linux-2.4.19/
HOST=i686-pc-linux-gnu
PATH=$PATH:$PREFIX/bin

if [ "$KERNEL" = "" -o ! -f "$KERNEL/Documentation/arm/README" ]; then
  echo "You haven't changed KERNEL to point at a valid kernel tree"
  exit 1
fi
if [ ! -f gcc-3.2.3.tar.bz2 ]; then
  echo GCC 3.2.3 seems to be missing
  exit 1
fi

rm -rf gcc-3.2.3
tar jxf gcc-3.2.3.tar.bz2
rm -rf build-gcc-3.2.3
mkdir -p build-gcc-3.2.3
pushd build-gcc-3.2.3
../gcc-3.2.3/configure --host=$TARGET --prefix=$PREFIX --enable-languages=c,c++
perl -pi -e 's/int namelen/unsigned int namelen/' ../gcc-3.2.3/libjava/java/net/natInetAddress.cc
make -j4
make install
popd
rm -rf build-gcc-3.2.3
rm -rf gcc-3.2.3
[/code:1]
回复

使用道具 举报

发表于 2003-8-6 00:38:09 | 显示全部楼层
回家了,就一直没有来
好不容易来一次,就发现了好东西
谢谢你啊
我想问个非常低级的问题,就是arm toolchain build scripts 该怎么建立啊,需要用什么工具
回复

使用道具 举报

 楼主| 发表于 2003-8-6 03:09:40 | 显示全部楼层
this is two shell scripts. u save them as two files, then +x in file mode. then run it.
but before this, u need download binutils. glibc, gcc, with right version and patches. there are still problems u will meet. but i do not have time to well document it. bascially, u need
1) download all files 2) get a kernel 3) build toolchain use scripts and hack them when need, 4) test the built chain.      
回复

使用道具 举报

发表于 2003-8-22 18:06:52 | 显示全部楼层
Dragonfly老大,有个问题我觉得很奇怪。我只用过两种arm,一快板sa,一块是arm7。我从来没有在建立交叉编译器上遇到什么困难。编译的时候也只不过换换命令而已。所以我不大明白为什么要这样讨论交叉编译器。我想一定是我哪方面欠缺,或者大家普遍用的硬件不是我所知道的?我倒是希望碰到一些问题,但问题是没有。另,最近比较忙,有一段时间没上来,竟看见多了这一版,真高兴!以后要常来。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-21 22:21 , Processed in 0.038555 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表