It seems that ps2 toolchain just wont build on a gcc4 system by default, but there is a fix. I haven't merged this into subversion yet as I dont know how the toolchain is structured for the ps2, ill leave that to someone else ;)
The problem is from 3.4 onwards they decprecated the use of casted lvalues which a few bits of the gcc source used. You need to do two things, update the copy of obstack.h and patch decl.c.
Copy that patch into the file decl.c.patch inside the ps2toolchain folder.
And then I just modified toolchain.sh to do copying and patching, e.g. at line 155 I added:
Nice work Tyranid, now we can all avoid the hassle of switching back to gcc 3.3 every time we need to build the toolchains. I hope someone gets this fix into the toolchain patches soon :-)
In fact, I've got an error during building again ...
But I didn't started the building (by running the toolchain.sh) from scratch. Instead I re-runned the toolchain.sh from my previous attempt (before replacing the file) which gave the a building/compiling error... It may not be conclusive. I should start from scratch. The error now might be due to any previous trash I had from the first attempt (before replacing the file)
I'll try next weekend probably. Too little time lately :(
Thanks for asking.
I'll post as soon I get new results.
In fact, today I was going to post the results of my last attempt with Cygwin.
It gave me the same error, after installing from scratch everything (the cygwin itself, checking out the svn sources and building the toolchain - I made this on a virtual machine). If anyone is interested, i'll post here the verbose output of it.
From this experience I conclude that the gcc-3.2.2.patch replacement suggested by sneeze doesn't work on the GCC 3.4.4-3 the latest Cygwin has. But now, with the new toolchain i'm going to try again.
Painful hours (why is cygwin building so slow?) of building are waiting me :)
bwt : I managed to build (in a snap) the previous toolchain last week under Debian linux (running under Virtual PC). No need to patch anything, no problem at all :)
But I think I'll prefer to work in a cygwin environment, I guess.
I'll post the results ASAP.
$ ./toolchain.sh
: command not founde 4:
: command not founde 8:
: command not founde 13:
: command not founde 17:
: command not founde 22:
: command not founde 26:
'/toolchain.sh: line 42: syntax error near unexpected token `in
'/toolchain.sh: line 42: ` case "$1" in
I checked the differences between this and the previous version with WinMerge and it gives the warning : "These files uses different carriage return types". Might this be the problem ?
Well, it didn't worked on Cygwin. I got rid of one of those line end two characters and just leaving the LF one, just like in the previous toolchain versions.
The building now starts under Cygwin but it fails.
Well, maybe i'll try your patch, just maybe.
And BTW, congratulations for your interesting presentation on BP2007!
I quite new to PS2 delopment (just finally buit the toolchain on Linux and in the mean while looked at the SDK examples, tutorials and built some using a precompiled Win32 for Cygwin) but it seems that the PSP is a bit more documented... Just my impression ?
Why my obcession about documentation when anyone can look at the examples ? Quite simple : Documentation is essecial for true knowledge and correct way of doing thigs. Anyone can look at the examples and figure how things works, but it's depending on our understanding and interpretation of it, not the direct explanation. Also, no example is ever complete compared to a reference document.