![]() |
There are now at least 4 great ways to build a gcc cross
compiler for Windows and Playstation.
Which Target?There are two trains of thought on this. Jon Rocatis built his amiga tools targeted at mips-unknown-ecoff with all the default options. I tried this with the cygnus toolchain and the finished compiler works but you need to use some funny options. When you build the compiler, you also (try to) build libgcc which you dont need. You have to make the psx linker link little endian objects using gcc and ld with the -EL flag. Also I have to specify a start symbol to the linker using -e _start.Perhaps a better way (as yet untested) is to use the playstation gcc patch which defines a mips-sony-psx target. You use gnu patch (part of the cywin32 binary distribution) to apply the patch (really meant for linux) to the distribution or you can look at the patch file and do the editing yourself. There is also a debugger patch; the debugger protocol strings are quite a revelation! There's a cross-gcc mailing list (archives here). There is also an interesting cross-gcc FAQ which has pointers to patches for a cross compiler.Using C++libps doesn't support C++. libgcc does. If you use the c++ compiler you've just built, you need to write functions for __builtin_new, __builtin_delete, __builtin_vec_new and __builtin_vec_delete so new and delete will work. There is an example file here.You might also have to add code to the start and end of main() to call global constructors. There is an example file here, all this stuff suggested by libgcc so you can sort it out if it doesn't work. |