2005年5月5日

Build ARM ToolChain - II

Do the same building test with some updated sources.

Files needed:
binutils-2.14.tar.gz
gcc-3.2.1.tar.gz
glibc-2.2.3.tar.gz
glibc-linuxthreaders-2.2.3.tar.gz

1. Binutils
// Same with Compilation - I.

2. Bootstrap compiler GCC
#cd ${PROJECT-PATH}/build-tools/
#tar zxvf gcc-3.2.1.tar.gz
#cd ${PROJECT-PATH}/build-tools/build-boot-gcc
// Do not do the compilation under the original untar directory.
#../gcc-3.2.1/configure --target=arm-linux --prefix=${PROJECT-PATH}/tools --with-headers=/usr/include --with-newlib --enable-languages=c --disable-shared
// The gcc 3.2.1 won't be created successfully without the flag "--disable-shared" for configuring.
// Headers for "--with-headers" actually should be generated by glibc building first.

3. Glibc
#cd ${PROJECT-PATH}/build-tools/
#tar zxvf glibc-2.2.3.tar.gz
#tar -zxvf glibc-linuxthreaders-2.2.3.tar.gz \ > --directory=glibc-2.2.3
#cd ${PROJECT-PATH}/build-tools/build-glibc/
// Do not do the compilation under the original untar directory.
#CC=arm-linux-gcc ../glibc-2.2.3/configure --host=arm-linux --prefix=”/usr” --enable-add-ons --with-headers=${PROJECT-PATH}/tools/arm-linux/include –-disable-profile –-without-fp
#make
// If errors on "weak precede definition" are found, we can modify the execution order of:
// ${PROJECT-PATH}/build-tools/glibc-2.2.3/sysdeps/unix/sysv/linux/arm/errlst.c (42L)
// 1. weak_alias (__old_sys_nerr, _old_sys_nerr)
// 2. strong_alias (__old_sys_nerr, _old_sys_nerr);
// 3. /*weak_alias (__old_sys_nerr, _old_sys_nerr)*/
#make install_root=${PROJECT-PATH}/tools/arm-linux \ > prefix=”” install
// If the following errors are found:
// ./stdio.texi:3269: First argument to cross-reference may not be empty.
// ./stdio.texi:3270: First argument to cross-reference may not be empty.
// Directly modify build-tools/glibc-2.2.3/manual/stdio.texi, and remove @ref{} to pass the compilation.
// Then several libraries will be generated under tools/arm-linux/lib.
// Modify ${PROJECT-PATH}/tools/arm-linux/lib/libc.so to remove absolute path, GROUP( libc.so.6 libc_nonshared.a )

4. GCC Compiler
#cd ${PROJECT-PATH}/build-tools/build-gcc/
// Do not do the compilation under the original untar directory.
#../gcc-3.2.1/configure --target=arm-linux --prefix=${PROJECT-PATH}/tools --enable-languages=c,c++ --with-headers=${PROJECT-PATH}/tools/arm-linux/include --with-libs=${PROJECT-PATH}/tools/lib --with-float=soft --enable-threads
#make all
#make install

I cannot build KS8695P-2.4.16-rmk2 kernel successfully with my arm-linux-gcc v3.2.1 tool, and will suffer hardware fp and software fp compiling errors. Didn't solve the issue yet, maybe the kernel source is too old, should have a try on 2.4.18 later version.