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]
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]
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.