Search:  
Gentoo Wiki

HOWTO_spu-elf-gcc_toolchain

This guide tells you how to make a working spu-elf-gcc toolchain on a CELL BE / Playstation3 As of december 20 2007 the stage4 on ps3 comes with crossdev already installed


Code: Fetching the correct overlay (requires layman installed and configured)
 
  emerge layman
  
Note: It is imperative that you follow the instructions given at the end of this ebuild

Next step is to install the needed overlays

Code: Fetching the correct overlay (requires layman installed and configured)
 
  layman -f
  layman -a cell
  layman -a toolchain
  

Because crossdev does not traverse directories yet and the binutils folder in toolchain comes with outdated ebuilds we have to remove that directory.

Code: Fetching the correct overlay (requires layman installed and configured)
 
  rm -rf /usr/portage/local/layman/toolchain/binutils
  

A final thing to do before we start is to add the neccesary information to make.conf


Code: Settig up /etc/make.conf so we can compile alpha versions of gcc
 
  echo "PORTDIR_OVERLAY=\"\$PORTDIR_OVERLAY /usr/local/portage\"" >> /etc/make.conf
  echo "I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1" >> /etc/make.conf 
  

So now we are all set keep in mind newer versions may exist


Code: Make the toolchain
 
    crossdev --g 4.3.0_alpha20071214 --b 2.18-r1 spu-elf
  

You should now have a working toolchain to test do the following


Code: spu test example
 
    mkdir test
    cd test
    touch test.c
    echo -e "#include <stdio.h> \n int main() { printf(\"Hello world\\\n\");}" > test.c
    spu-elf-gcc test.c -o test
    ./test
   cd ..
   rm -rf test
 
Retrieved from "http://www.gentoo-wiki.info/HOWTO_spu-elf-gcc_toolchain"

Last modified: Fri, 05 Sep 2008 10:37:00 +0000 Hits: 1,249