Thursday, July 17, 2008
EFIKA Cross Compiler
These are some rough notes on building a powerpc cross compiler.
I have not yet worked out if AROS needs an powerpoc-eabi or powerpc-elf cross compiler, so I have build an -eabi version.
This set of notes should help you build a currently up to date when written gcc-4.3.0 cross compiler.
My host machine is an AMD64 Ubuntu 8.04 linux machine. For Ubuntu users, make sure /bin/sh is symlinked to bash and not dash.
Pick a base directory ( I’m using ~/cross ) and pick an output prefix ( I’m using /opt/efika ).
You will need;
binutils-2.18
gcc-core-4.3.0
newlib-1.16.0
gdb-6.8
gmp-4.2.2
mpfr-2.3.1
Start with some basic setup
1 - untar all of them into a base directory,
Compile and build binutils
2 - mkdir build-binutils
3 - cd build-binutils
4 - ../binutils-2.18.0/configure --prefix=/opt/efika --target=powerpc-eabi --disable-nls
5 - echo “MAKEINFO = :” >> Makefile
6 - make
7 - sudo make install
8 - export PATH=$PATH:/opt/efika/bin
Step 5 works around a known bug in binutils 2.18 regarding makeinfo
Compile and build the bootstrap gcc
Optionally for AROS, I here apply the paramstack patch against gcc. (check aros/contrib/gnu/gcc for patches)
1 - cd gcc-4.3.0
2 - ln -s ../gmp-4.2.2 gmp
3 - ln -s ../mpfr-2.3.1 mpfr
4 - ln -s ../newlib-1.16.0 newlib
5 - cd ..
6 - mkdir build-gcc
7 - cd build_gcc
8 - ../gcc-4.3.0/configure --prefix=/opt/efika --target=powerpc-eabi --without-headers --with-newlib --with-gnu-as --with-gnu-ld --disable-nls
9 - make all-gcc
10 - sudo make install
Time to build newlib
1 - mkdir build-newlib
2 - ../newlib-1.16.0/configure --target=powerpc-eabi --prefix=/opt/efika --disable-nls
3 - echo “MAKEINFO = :” >> Makefile
4 - export PATH=/opt/efika/bin:$PATH
5 - make
6 - sudo make install
You can see the same bug here in newlib as was present in binutils.
With newlib installed you need to build the proper gcc (here I am targetting the 603e cpu as default)
1 - cd build-gcc
2 - rm -rf *
3 - rm ../gcc-4.3.0/newlib
4 - ../gcc-4.3.0/configure --target=powerpc-eabi --prefix=/opt/efika --with-newlib --with-gnu-as --with-gnu-ld --disable-nls --with-cpu=603e --enable-long-long
5 - echo “MAKEINFO = :” >> Makefile
6 - make all
7 - sudo make install
The “--with-gnu-as”, “--with-gnu-ld” helps the build process and stops it looking for a different linker/assembler.
The last step is to build the debugger
1 - mkdir build-gdb
2 - ../gdb-6.5/configure --prefix=/opt/efika --target=powerpc-eabi --disable-nls --enable-sim-powerpc --enable-sim-stdio
3 - make all
4 - sudo make install
You should now have a working cross compiler inside of /opt/efika, you may wish to go off and build some packages like glibc or anything else you may want.
Filed Under : Computers • Development • AROS / EFIKA •
Comments are closed There are no comments on this entry.