2.5. Compile Procedure

2.5.1. binutils-2.15

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.

2.5.2. Procedure Glue

Now we need to perform a couple of steps to prepare for the next phases of compilation.

2.5.3. gcc-3.4.3 Static

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
        

2.5.4. glibc-2.3.3 Toolchain

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
        
the first thing we need to do is to create a file named configparms and put the following line into this file:
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
        

2.5.5. Full gcc-3.4.3

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
        

2.5.6. glibc-2.3.3 for the Target

$ 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