Cross Compiling: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
(first draft)
 
No edit summary
Line 20: Line 20:
</pre>
</pre>


* /home/user/crosstool-ng-1.10.0/ -> ""crostool-ng sources""
* /home/user/crosstool-ng-1.10.0/ -> '''crostool-ng sources'''
* /home/user/crosstool/ -> ""Crosstool install directory with binaries""
* /home/user/crosstool/ -> '''Crosstool install directory with binaries'''
* /home/user/toolchain/ -> ""Directory where the binary will be installed""
* /home/user/toolchain/ -> '''Directory where the binary will be installed'''
* /home/user/toolchain/powerpc/ -> ""Crosstool files generated in this tutorial for powerpc""
* /home/user/toolchain/powerpc/ -> '''Crosstool files generated in this tutorial for powerpc'''
* /home/user/toolchain/x-tools/ -> ""generated toolchain""
* /home/user/toolchain/x-tools/ -> '''generated toolchain'''
* /home/user/kernel -> ""Place were graf_chokolo's linux kernel tarball will be saved""
* /home/user/kernel -> '''Place were graf_chokolo's linux kernel tarball will be saved'''


Add enviromental variable
Add enviromental variable
Line 52: Line 52:
cd /home/user/toolchain/powerppc/
cd /home/user/toolchain/powerppc/
ct-ng menuconfig
ct-ng menuconfig
<pre>
</pre>


I added graf_chokolos kernell  
I added graf_chokolos kernell  
Line 65: Line 65:
cd /home/user/toolchain/powerppc/
cd /home/user/toolchain/powerppc/
ct-ng menuconfig
ct-ng menuconfig
<pre>
</pre>

Revision as of 10:07, 16 April 2011

Cross Compiling

This page shows how to cross compile for cellBE/ppc

Install required packages

sudo apt-get install build-essential gawk bison flex automake libtool cvs lzma ncurses-dev
sudo apt-get install texinfo patch g++ gcj

Create directories and compile crosstool

mkdir /home/user/crosstool
mkdir /home/user/kernel
mkdir -p /home/user/toolchain/mips
tar xvjf crosstool-ng-1.10.0.tar.bz2
cd crosstool-ng-1.10.0/
./configure --prefix=/home/user/crosstool/
make && make install
  • /home/user/crosstool-ng-1.10.0/ -> crostool-ng sources
  • /home/user/crosstool/ -> Crosstool install directory with binaries
  • /home/user/toolchain/ -> Directory where the binary will be installed
  • /home/user/toolchain/powerpc/ -> Crosstool files generated in this tutorial for powerpc
  • /home/user/toolchain/x-tools/ -> generated toolchain
  • /home/user/kernel -> Place were graf_chokolo's linux kernel tarball will be saved

Add enviromental variable

sudo gedit /etc/bash.bashrc

Add the following line at the end of the file

"export PATH="${PATH}:/home/user/crosstool/bin/"


Download graf_chokolo's kernel

cd /home/user/kernel
wget -O linux-2.6.tar.gz http://git.dukio.com/gitweb.cgi?p=linux-2.6\;a=snapshot\;h=HEAD\;sf=tgz

Copy the configuration file and modify it

cp /home/user/crosstool/lib/ct-ng-1.10.0/samples/powerpc64-unknown-linux-gnu/* /home/user/toolchain/powerppc/
mv crosstool.config .config
cd /home/user/toolchain/powerppc/
ct-ng menuconfig

I added graf_chokolos kernell

  • Operating System -> Linux Kernel version -> custom tarball
  • Operating System -> Path to custom tarball -> /home/user/kernel/linux-2.6.tar.gz

or

Configure the toolchain the way you want

cd /home/user/toolchain/powerppc/
ct-ng menuconfig