[arm@localhost tchain3.4.4]#cd ${KERNEL} [arm@localhost kernel]#tar xvfz linux2.6.14.1.tar.gz [arm@localhost kernel]#cd linux2.6.14.1
[arm@localhost linux2.6.14.1]#make ARCH=arm menuconfig [arm@localhost linux2.6.14.1]#make
Copy the kernel headers
[arm@localhost kernel]#su root
[root@localhost kernel]#mkdir p ${SYSROOT}/usr/include
[root@localhost kernel]#cp a include/linux ${SYSROOT}/usr/include/linux [root@localhost kernel]#cp a include/asmi386 ${SYSROOT}/usr/include/asm [root@localhost kernel]#cp a include/asmgeneric ${SYSROOT}/usr/include/asmgeneric [root@localhost kernel]#exit
[arm@localhost kernel]#
Translation compiled glibc header files
[arm@localhost kernel]#cd ${SRC}
[arm@localhost chain3.4.4]#tar xvfz glibc2.3.5.tar.gz [arm@localhost chain3.4.4]#patch d glibc2.3.5 p1 < ioperm.c.diff [arm@localhost glibc2.3.5]#cd glibc2.3.5
[arm@localhost glibc2.3.5]#tar xvfz ../glibclinuxthreads2.3.5.tar.gz [arm@localhost chain3.4.4]#cd ..
[arm@localhost chain3.4.4]#mkdir BUILD/glibc2.3.5headers [arm@localhost chain3.4.4]#cd BUILD/glibc2.3.5headers
[arm@localhost glibc2.3.5headers]#../../glibc2.3.5/configure prefix=/usr host=${TARGET} \
enableaddons=linuxthreads –withheaders=${SYSROOT}/usr/include [arm@localhost glibc2.3.5headers]#su root
[root@localhost glibc2.3.5headers]#make crosscompiling=yes install_root=${SYSROOT} installheaders [root@localhost glibc2.3.5headers]#touch ${SYSROOT}/usr/include/gnu/stubs.h
[root@localhost glibc2.3.5headers]#touch ${SYSROOT}/usr/include/bits/stdio_lim.h [root@localhost glibc2.3.5headers]#exit
[arm@localhost glibc2.3.5headers]#
Note: prefix = / usr: gcc is looking for the library search path.
Compile gcc first stage
[arm@localhost glibc2.3.5headers]#cd ${SRC} [arm@localhost chain3.4.4]#tar xjvf gcc3.4.4.tar.bz2 [arm@localhost chain3.4.4]#patch d gcc3.4.4 p1 < flow.c.diff [arm@localhost chain3.4.4]#patch d gcc3.4.4 p1 < tlinux.diff [arm@localhost chain3.4.4]#mkdir p BUILD/gcc3.4.4stage1 [arm@localhost chain3.4.4]#cd BUILD/gcc3.4.4stage1
[arm@localhost gcc3.4.4stage1]#../../gcc3.4.4/configure prefix=${PREFIX} target=${TARGET} \
enablelanguages=c withsysroot=${SYSROOT}
Note: You can not add "disableshared" option. [Arm @ localhost gcc3.4.4stage1] #make allgcc [arm @ localhost gcc3.4.4stage1] #su root [root @ localhost gcc3.4.4stage1] #make installgcc [root @ localhost gcc3.4.4stage1] #exit [arm @ localhost gcc3.4.4stage1] #
Complete compilation glibc
[arm@localhost gcc3.4.4stage1] #cd ${SRC} [arm@localhost tchain3.4.4]#mkdir BUILD/glibc2.3.5 [arm@localhost tchain3.4.4]#cd BUILD/glibc2.3.5
[arm@localhost glibc2.3.5]#BUILD_CC=gcc CC=${CROSS_COMPILE}gcc AR=${CROSS_COMPILE}ar \ RANLIB=${CROSS_COMPILE}ranlib AS=${CROSS_COMPILE}as LD=${CROSS_COMPILE}ld \
../../glibc2.3.5/configure prefix=/usr build=i386redhatlinux host=armunknownlinuxgnu \
target=armunknownlinuxgnu without thread enableaddons=linuxthreads \
withheaders=${SYSROOT}/usr/include
Description:
prefix: specify the installation path.
target: Specifies the target platform.
host: Specifies the current platform.
build: Specifies the compiler platform.
withsysroot: compiler is used to specify the required header files and libraries.
enableaddons: add other libraries, such as threading libraries.
enablelanguages: Specifies the language supported by gcc.
[arm@localhost glibc2.3.5]#make [arm@localhost glibc2.3.5]#su root
[root@localhost glibc2.3.5]#make install_root=${SYSROOT} install [root@localhost glibc2.3.5]#exit
[arm@localhost glibc2.3.5]#
Complete compilation gcc
[arm@localhost glibc2.3.5]#cd ${SRC} [arm@localhost tchain3.4.4]#mkdir BUILD/gcc3.4.4 [arm@localhost tchain3.4.4]#cd BUILD/gcc3.4.4
[arm@localhost gcc3.4.4]#../../gcc3.4.4/configure prefix=${PREFIX} target=${TARGET} \
enablelanguages=c withsysroot=${SYSROOT} [arm@localhost gcc3.4.4]#make
[arm@localhost gcc3.4.4]#su root [root@localhost gcc3.4.4]#make install [root@localhost gcc3.4.4]#exit [arm@localhost gcc3.4.4]#