Building the Cell SDK from upstream
This guide follows that at Jeremy Kerr's place.
However, this is for GCC 4.8, binutils 2.23.2, and newlib-2.0.0.
Be forewarned that this is (my memory and logs of) how I really did it, not how it perhaps ought to be done.
Build GNU binutils
- Get binutils from its download site
tar -xzf binutils-2.23.2.tar.gz
mkdir binutils-2.23.2-spu
cd binutils-2.23.2-spu
./configure --enable-lto --disable-werror --program-prefix=spu- --target=spu-elf
make
make install
(I actually used DESTDIR=make install to install it to a different location and manage it using something like stow)
Build GCC the first time
tar -xjf gcc-4.8.0.tar.bz2
mkdir gcc-4.8.0-spu
cd gcc-4.8.0-spu
../gcc-4.8.0/configure --enable-lto --build=powerpc-unknown-linux-gnu --host=powerpc-unknown-linux-gnu --program-suffix=-4.8 --enable-threads=posix --disable-libgcj --enable-languages=c,c++ --disable-threads --disable-checking --with-system-zlib --disable-libssp --program-prefix=spu- --target=spu --with-as=/usr/local/bin/spu-as --with-ld=/usr/local/bin/spu-ld(I should have excluded c++; it's not supported anyway)
make all-gcc
make install
Build newlib (libc)
- Get newlib from their site
tar -xzf newlib-2.0.0.tar.gz
mkdir newlib-2.0.0-spu
cd newlib-2.0.0-spu
CFLAGS='-Os -pipe -mea32' CXXFLAGS='-Os -pipe -mea32' ../newlib-2.0.0/configure --enable-lto --target=spu
make
make install
Rebuild GCC with libc
mkdir gcc-4.8.0-spu-full
cd gcc-4.8.0-spu-full
../gcc-4.8.0/configure --enable-lto --disable-threads --disable-checking --with-system-zlib --enable-languages=c --disable-libssp --program-prefix=spu- --target=spu --program-suffix=-4.8 --with-as=/usr/local/bin/spu-as --with-ld=/usr/local/bin/spu-ld
make
make install
cd ${install_location}/lib/gcc
for file in /usr/local/spu/lib/*; do ln -s $file; done
The last step in the full GCC build is to ensure that the SPU crt1.o and friends can be found. If you don't do it, you'll end up with an error about not finding crt1.o and crti.o when you build any sort of SPE program. (I only tried with with a Hello World SPU program)
I also built gcc 4.8 for the PPU, but that's very similar.
I successfully built libspe2 using gcc 4.8 since it was a bit later than what Gentoo provided.
I also successfully built spu-tools, though they didn't run successfully.
Testing thus far is only with a Hello World program that outputs &dquot;PPU side!&dquot; on the PPU and &dquot;SPU side!&dquot; on the SPU.
Page last modified Thursday, 30-May-2013 21:32:00 EDT