Openrisc Toolchain Development Factory
Home
Copyleft Rich D'Addio 2007
GCC (Part I)
So now we'll give new meaning to the term orthogonal!!
Let's go back to our base level directory and unpack our kernel --BTW this kernel is just
to get us some headers and paths. Don't worry about using it to build your real kernel
ralphie:/video/new_or32# bunzip2 linux-2.6.19.tar.bz2
then:
ralphie:/video/new_or32# tar -xvf linux-2.6.19.tar
now patch it:
ralphie:/video/new_or32# cd linux-2.6.19
ralphie:/video/new_or32# bzip2 -dc ../linux_2.6.19_or32_unified_simtested.bz2 |patch -p1
Ok time to fake a kernel:
ralphie:/video/new_or32# make menuconfig ARCH=or32
Just select or32 as your platform we just need headers and paths.
Now let's make an include directory under our toolchain for the Linux and architecture
specific includes:
ralphie:/video/new_or32# mkdir tools/or32-uclinux/include
ralphie:/video/new_or32# mkdir tools/or32-uclinux/include/asm
ralphie:/video/new_or32# mkdir tools/or32-uclinux/include/linux
Now we need to copy the headers:
ralphie:/video/new_or32# cp -f -dR linux-2.6.19/include/linux/*
/video/new_or32/tools/or32-uclinux/include/linux
ralphie:/video/new_or32# cp -f -dR linux-2.6.19/include/asm-or32/*
/video/new_or32/tools/or32-uclinux/include/asm
Now let the compiler know about the architecture and OS headers:
ralphie:/video/new_or32# cd /video/new_or32/tools/or32-uclinux
ralphie:/video/new_or32/tools/or32-uclinux# ln -s include sys-include
Ok so now lets go back to the base station:
ralphie:/video/new_or32/tools/or32-uclinux# cd ../../
And it is time to make yet another build directory this time for GCC:
ralphie:/video/new_or32/tools/or32-uclinux# mkdir b-gcc
Time to unpack the compiler beast:
ralphie:/video/new_or32/# bunzip2 gcc-3.4.4.tar.bz2
ralphie:/video/new_or32/# tar -xvf gcc-3.4.4.tar
And DON'T forget to patch it:
ralphie:/video/new_or32/# cd gcc-3.4.4
ralphie:/video/new_or32/gcc-3.4.4/# bzip2 -dc ../gcc-3.4.4-or32-unified.diff.bz2 |patch -p1
Back to base station:
ralphie:/video/new_or32/gcc-3.4.4/# cd ../
We are FINALLY just about ready to build it:
ralphie:/video/new_or32/gcc-3.4.4/# cd b-gcc
Let's configure it:
ralphie:/video/new_or32/b-gcc/# ../gcc-3.4.4/configure --target=or32-uclinux --prefix=/video/new_or32/tools/or32-uclinux --with-local-prefix=/video/new_or32/tools/or32-uclinux/or32-uclinux --with-gnu-as --with-gnu-ld --verbose --enable-languages=c
Lastly let's do it:
ralphie:/video/new_or32/b-gcc/# make all install
Oh before we leave let's change directories back to our linux directory and build enough
of the kernel to get a version header:
ralphie:/video/new_or32/b-gcc/# cd ../linux-2.6.20
ralphie:/video/new_or32/linux-2.6.20/# make vmlinux ARCH=or32 CROSS_COMPILE= \
/video/new_or32/tools/or32-uclinux/bin/or32-uclinux-
More skullduggery for you? Yes? Next No?Previous Start
Top