PDA

View Full Version : Setting up a PowerPC compiler under linux and compiling code



mojobojo
05-10-2011, 09:42 AM
Sorry Windows users, this is a job for linux. This is for under pretty much any version of Ubuntu. If you are not on Ubuntu or any Debian based OS you will need to install some packages manually.

Prerequisites
You must have gcc and make installed before continuing

sudo apt-get install gcc make

First you must get the proper packages


sudo apt-get install libgmp3-dev libmpfr-dev texinfo git-core gettext build-essential


Continue on past this to "Clone free60s git" if you are using Ubuntu.

Building gmp and mpfr manually.

gmp first


cd /tmp/
wget http://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.gz
tar xvf gmp-4.3.2.tar.gz
cd gmp-4.3.2
./configure
sudo make install

then mpfr


cd /tmp/
wget http://ftp.gnu.org/gnu/mpfr/mpfr-3.0.0.tar.gz
tar xvf mpfr-3.0.0.tar.gz
cd mpfr-3.0.0
./configure
sudo make install


Clone free60s git

git clone git://free60.git.sourceforge.net/gitroot/free60/free60


Navigate to the toochain dir

cd free60/toolchain


Build the toolchain as superuser

sudo ./build-xenon-toolchain toolchain


When its done open up .bashrc in gedit

gedit ~/.bashrc

Add these lines to the bottom

export DEVKITXENON="/usr/local/xenon"
export PATH="$PATH:$DEVKITXENON/bin:$DEVKITXENON/usr/bin"


Close terminal and open it back up for the changes to take effect.

Compile your assembly code

xenon-as -be -many asmcode.S -o out.elf

Output it as binary

xenon-objcopy out.elf -O binary out.bin

pureIso
05-11-2011, 03:28 AM
Can you please show a simple hello world programming and compile and results please :)

mojobojo
05-12-2011, 12:12 AM
Can you please show a simple hello world programming and compile and results please :)

Credit goes to Tuxuser @ libxenon.org (http://www.libxenon.org/viewtopic.php?f=8&t=17#p34). The other source "xenontemp" is somthing I wrote to request the temperature readout from the SMC. link (http://www.libxenon.org/viewtopic.php?f=23&t=41#p124)