You are not logged in.

#1 2008-09-10 01:55:59

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Building a kernel for the PS3 with a cross-compiling toolchain

I just put Arch on my PS3 after Fedora borked itself (RPM makes me go crazy also, but that's not important now tongue).

Anyway, I followed Erroneous' guide to get started and updated the wiki while I was on it. The crucial part - getting a kernel for this beast to run - proves to be a daunting task so far (well maybe not daunting, but let's just say my LFS days are far behind me tongue). The link Erroneous provides on the wiki to download his kernel does not work - in a browser it gives me a login screen, logging in as 'anonymous' doesn't work. Nor does just wget'ing it - it just keeps on trying and trying.

Anyway - I tried his first suggestion, to grab the toolchain provided here, but the thing does not want to compile - it borks on the very first binutils run. I included both the ./configure and make output for the sake of completeness (since my post exceeded the 64k limit with this code, I'll link to pastebin):

Pastebin entry

It's a whole lot of code, I know tongue. I googled the mktemp warning - somewhere higher up make says it will treat any warnings as errors - but no clear solutions so far. Then I found this thread about a cross-compiling toolchain provided by kth5. Someone in the same thread said 'to change it for 64 bit PPC and it would work' but I was a bit suspicious (the packages all have PPC32 in their name wink). As I installed those packages, patched the latest kernel together (both the 2.6.26.5 patch and the PS3 patch for 2.6.26 needed some adjusting), I finally bumped into this error:

[stijn@hermes linux-2.6.26]$ make
cc1: fout: -m64 not supported in this configuration
cc1: fout: -m64 not supported in this configuration
/home/stijn/src/ps3linux/kernel/linux-2.6.26/scripts/gcc-version.sh: line 31: printf: #: invalid number
/home/stijn/src/ps3linux/kernel/linux-2.6.26/scripts/gcc-version.sh: line 31: printf: #: invalid number
/bin/sh: line 0: [: too many arguments
cc1: fout: -m64 not supported in this configuration
cc1: fout: -m64 not supported in this configuration
/home/stijn/src/ps3linux/kernel/linux-2.6.26/scripts/gcc-version.sh: line 31: printf: #: invalid number
/home/stijn/src/ps3linux/kernel/linux-2.6.26/scripts/gcc-version.sh: line 31: printf: #: invalid number
cc1: fout: -m64 not supported in this configuration
cc1: fout: -m64 not supported in this configuration
cc1: fout: -m64 not supported in this configuration
/home/stijn/src/ps3linux/kernel/linux-2.6.26/scripts/gcc-version.sh: line 29: printf: #: invalid number
/home/stijn/src/ps3linux/kernel/linux-2.6.26/scripts/gcc-version.sh: line 29: printf: #: invalid number
/home/stijn/src/ps3linux/kernel/linux-2.6.26/scripts/gcc-version.sh: line 29: printf: #: invalid number
*** 2.6 kernels no longer build correctly with old versions of binutils.
*** Please upgrade your binutils to 2.12.1 or newer
make: *** [checkbin] Fout 1
[stijn@hermes linux-2.6.26]$ pacman -Q|grep binutils-ppc32
crossbinutils-ppc32 2.18.50.0.5-2

First off it seems obvious to me this toolchain only seems to do PPC32 (which was to be expected); I haven't looked into the 'invalid number' reports yet. The binutils complaint seems a bit bizarre too, since the binutils that should be used are 2.18.50 (the regular i686 Arch is plain 2.18, so both are recent). The location of the PPC toolchain is in $PATH (I re-exported it), so that shouldn't be a problem.

[stijn@hermes linux-2.6.26]$ ls /opt/cross/powerpc-unknown-linux-gnu/
bin  include  info  lib  libexec  man  powerpc-unknown-linux-gnu  share  usr
[stijn@hermes linux-2.6.26]$ echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin:/home/stijn/scripts:/opt/cross/powerpc-unknown-linux-gnu/bin/

This is how the beginning of the kernel's Makefile looks:

[stijn@hermes linux-2.6.26]$ head Makefile 
ARCH=powerpc
CROSS_COMPILE=powerpc-unknown-linux-gnu-
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 26
EXTRAVERSION = .5
NAME = Rotary Wombat

# *DOCUMENTATION*
# To see a list of typical targets execute "make help"

Any help would be greatly appreciated, although it looks to me like I'll have to build a toolchain from scratch smile.

Last edited by B (2008-09-10 02:27:50)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#2 2008-09-10 09:03:10

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Building a kernel for the PS3 with a cross-compiling toolchain

Ok - I just wanted to say Erroneous provided me with a working link to his kernel:

http://theerroneous.net/kernel26-ps3-2. … pkg.tar.gz

I'll put that on shortly and see how far we get, but I think we do need a fresh toolchain cool. CLFS here I come! big_smile


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2008-09-12 15:59:51

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Building a kernel for the PS3 with a cross-compiling toolchain

Erroneous' kernel works fine for those interested, I am currently building a 64 bit PPC cross-compiling toolchain for the PS3 based on the PKGBUILDs for the 32 bit PPC cross-compiling packages provided by kth5. I'm also aiming to build newlib and libspe(2) packages.

More updates to follow smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#4 2008-09-25 16:40:14

konni
Member
From: berlin
Registered: 2008-09-25
Posts: 99

Re: Building a kernel for the PS3 with a cross-compiling toolchain

mhhm... i adapted the pkgbuilds for the cbea-sdk package to ppc and compile with ppu-gcc on the ps3. works fine for the latest git-versions. and i can even have loadable module support which doesnt work with the toolchain.

Offline

Board footer

Powered by FluxBB