Next Previous Contents

4. Compiling Stages

First we need to build binutils for crosscompiling. They are the really small utilities that do big things :)


Straight from PARISC-LINUX Website

Determine the host system setup:

In the next few steps, you'll be configuring and building the toolchain. It needs to be told the system you'll be hosting (running) the tools on. For Intel-based Linux machines, the name is i386-linux. For HPUX machines with PA-RISC processors, the name is hppa-hpux. For Alpha-based Linux machines, the name is alpha-linux. If you want to host your tools on a different architecture, and can't determine your machine name, let us know.


We are going to set $MACH to represent our host system.

We have already set aside two directories for building our toolchain. If you remember our directories reside in $HOME or at any other location you have used.
./build is where our build object files go and
./parisc is where our finished toolchain will reside

4.1 Building Binutils

N.B. If you want nls support (i.e. non-native English speaker) then remove the "--disable-nls" option.

N.B. Optionally on SMP xc boxes, you can try "make -j8" and thus allowing make to start multiple compile threads across CPU's. Though this sometimes obscures the exact location of errors when the build fails.

4.2 Partial GCC Build (C Compiler only)

At this point we are about to compile a simple C cross compiler, but we will require some of the binutils we built above. Take note that we preface the regular $PATH with the path of our newly built toolchain, this means that if you are not cross compiling then you will always be using the freshly built binaries (path order precedence).

4.3 Kernel Dependancies and headers

Note that the next phase requires that you _know_ the CPU type of your target machine. This is required to get the right kernel/glibc setup.

4.4 Building Glibc

Sometimes Glibc builds... sometimes it doesn't. Sometimes it's just magic. Applying the following recipe should give good results. Note the use of '--enable-hacker-mode' so don't complain if other things complain (Thanks go to JDA for this bit of the recipe).

Symlink the appropriate headers:

4.5 Fully building GCC

Tada!
You now have a fully built cross compiler for PARISC!

If you want to build a 64bit cross compiler (to build 64bit kernels), go again through steps 4.1 and 4.2, replacing '--target=hppa-linux' by '--target=hppa64-linux'.


Next Previous Contents