| Instructions and Notes working with a KuroBox | |||
|---|---|---|---|
| <<< Previous | Chapter 2. Building the Cross Tools | Next >>> | Blog |
Move to the build directory...
$ cd ${BASE}/src/binutils/build-powerpc-603e
|
...configure...
$ ../binutils-2.15/configure
--prefix=${BASE}/toolchain/powerpc-603e-linux-gnu
--target=powerpc-603e-linux-gnu
--disable-nls
2>&1 | tee LOG.configure
|
...make...
$ make 2>&1 | tee LOG.make
|
...and install.
$ make install 2>&1 | tee LOG.install
|
In the configure step we specified that the target is a 603e and not an 8241. The reason for this is that the tools we're about to build have no idea about the PowerPC 8241; they do, however, know about the 603e. As it turns out, the PowerPC 8241 is just a bunch of extra stuff and peripherals built around a PowerPC 603e core. So the best thing to do is to tell the tools that we're targeting a 603e, this keeps the tools from targeting any generic PowerPC CPU.
Now we need to perform a couple of steps to prepare for the next phases of compilation.
First of all we need to add to our $PATH the location where the cross-binutils tools were just installed so that we can start using them. We don't have to add their location to the beginning of our $PATH because the tools are all prefixed with powerpc-603e-linux-gnu- and future compilation stages will know to look for tools with that prefix (thanks to the --target= configure option in future configurations). The following assumes you're using bash or something bash-like as your shell.
$ export PATH=${PATH}:${BASE}/toolchain/powerpc-603e-linux-gnu/bin
|
Now we need to prepare a set of include files culled from both the system include directory and the kernel include directory.
We start with the system include files:
$ cd ${BASE}/toolchain/powerpc-603e-linux-gnu/powerpc-603e-linux-gnu
$ cp -a /usr/include .
|
This copies a lot of files, most of which aren't needed, but it doesn't hurt that they're there. You could go through and prune if you like. The next compilation, gcc, will also look for a sys-include directory; I don't know why, but it needs to be there. It's simply a symlink to the include directory you just created:
$ ln -s include sys-include
|
Next we prepare the kernel include files:
$ cd ${BASE}/src/linux/linux-2.6.10
$ make include/linux/version.h
|
Then we copy these to the required location:
$ cd ${BASE}/toolchain/powerpc-603e-linux-gnu/powerpc-603e-linux-gnu/include
$ rm -fr linux asm
$ cp -a ${BASE}/src/linux/linux-2.6.10/include/asm-ppc asm
$ cp -a ${BASE}/src/linux/linux-2.6.10/include/asm-generic .
$ cp -a ${BASE}/src/linux/linux-2.6.10/include/linux .
|
In this step we create a small cross-gcc, just enough to build a small glibc which will allow us to then compile a full cross-gcc (which we then use to build a full cross-glibc):
$ cd ${BASE}/src/gcc/build-powerpc-603e-static
$ ../gcc-3.4.3/configure
--prefix=${BASE}/toolchain/powerpc-603e-linux-gnu
--target=powerpc-603e-linux-gnu
--with-cpu=603e
--disable-altivec
--enable-languages=c
--disable-threads
--disable-shared
--disable-shared-libgcc
--without-stabs
--without-dwarf2
--disable-multilib
--disable-nls
2>&1 | tee LOG.make
|
$ make 2>&1 | tee LOG.make
|
$ make install 2>&1 | tee LOG.install
|
Now we are about to compile a small set of libraries targeting the PowerPC 603e. After we change into the build directory,
$ cd ${BASE}/src/glibc/build-powerpc-603e-toolchain
|
gnulib := -lgcc
|
Now we're ready to configure...
$ ../glibc-2.3.3/configure
--prefix=${BASE}/toolchain/powerpc-603e-linux-gnu/powerpc-603e-linux-gnu
--build=i686-pc-linux-gnu
--host=powerpc-603e-linux-gnu
--enable-add-ons=linuxthreads
--disable-profile
--without-cvs
--disable-debug
--without-gd
--without-tls
--without-__thread
2>&1 | tee LOG.configure
|
$ make 2>&1 | tee LOG.make
|
$ make install 2>&1 | tee LOG.install
|
Now we're ready to build a full cross-compiler:
$ cd ${BASE}/src/gcc/build-powerpc-603e-full
|
$ ../gcc-3.4.3/configure
--prefix=${BASE}/target/powerpc-603e-linux-gnu
--target=powerpc-603e-linux-gnu
--with-cpu=603e
--disable-nls
--enable-long-long
--enable-c99
--enable-__cxa_atexit
--enable-threads=posix
--enable-languages=c,c++,objc,f77
--enable-symvers=gnu
--disable-altivec
2>&1 | tee LOG.configure
|
$ make 2>&1 | tee LOG.make
|
$ make install 2>&1 | tee LOG.install
$ make prefix=${BASE}/target/powerpc-603e-linux-gnu install 2>&1 | tee LOG.install.fulltarget
|
$ cd ${BASE}/src/build-powerpc-603e-target
|
$ ../glibc-2.3.3/configure
--prefix=/usr
--build=i686-pc-linux-gnu
--host=powerpc-603e-linux-gnu
--enable-add-ons=linuxthreads
2>&1 | tee LOG.configure
|
$ make 2>&1 | tee LOG.make
|
$ make install_root=${BASE}/target/powerpc-603e-linux-gnu/powerpc-603e-linux-gnu install 2>&1 | tee LOG.install
|
| <<< Previous | Home | Next >>> |
| File Layout | Up | Conclusion |