I'm trying to port my existing application (see bricks-os.org) to the PSX, yes, the good old Playstation One. Unfortunately the latest compiler I can find on the internet for the PSX is an old gcc 2.7.2.3, just too old for what I need.
So I was trying to use the iop compilers to do the job, that works, only it produces elf files, and the PSX needs to use ecoff format. I already tried recompiling the iop compilers, and building a new standard mips-r3000 compiler with ecoff support, but I can't get the cross-compilers to compile.
Gcc already supports MIPS R3000 (PSOne processoror), so there is no need to use the IOP version. If I'm not mistaken, the only part that is different with IOP gcc is the ability to output IRX files directly.You can just download the lastest version of gcc and compile it to support MIPS r3000.
As for the targets, there is atleast mips-idt-ecoff and maybe even mips-mips-ecoff. The following link suggests (although a bit old) to look in the GCC source for the list of supported targets: http://gcc.gnu.org/ml/gcc-help/2000-03/msg00060.html
## GCC 4.3.2, needs GMP?
#tar -jxf gcc-4.3.2.tar.bz2.tar
#cd gcc-4.3.2
## GCC 3.2.2
#tar -jxf gcc-3.2.2.tar.bz2.tar
cd gcc-3.2.2
## Create and enter the build directory.
mkdir "build-psx-stage1" && cd "build-psx-stage1" || { exit 1; }
## Configure the build.
../configure --prefix="$PS2DEV/psx" --target="mips-idt-ecoff" --enable-languas="c,c++" --with-newlib --without-headers || { exit 1; }
## Compile and install.
make clean && make -j 2 && make install && make clean || { exit 1; }
## Exit the build directory.
cd .. || { exit 1; }
I'm using this environment. First I tried the latest gcc (4.3.2) but it needs something I don't have (gmp?). So I tried to compile 3.2.2, that gives me the following error:
gcc -DHAVE_CONFIG_H -I. -I../../fastjar -I. -I. -I../../fastjar -I../../fastjar/../zlib -I../../fastjar/../include -W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -g -O2 -c ../../fastjar/jartool.c
gcc -DHAVE_CONFIG_H -I. -I../../fastjar -I. -I. -I../../fastjar -I../../fastjar/../zlib -I../../fastjar/../include -W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -g -O2 -c ../../fastjar/dostime.c
../../fastjar/jartool.c: In function `main':
../../fastjar/jartool.c:437: error: `S_IRGRP' undeclared (first use in this function)
../../fastjar/jartool.c:437: error: (Each undeclared identifier is reported only once
../../fastjar/jartool.c:437: error: for each function it appears in.)
../../fastjar/jartool.c:437: error: `S_IROTH' undeclared (first use in this function)
../../fastjar/jartool.c: In function `extract_jar':
../../fastjar/jartool.c:1427: error: too many arguments to function `mkdir'
../../fastjar/jartool.c: In function `help':
../../fastjar/jartool.c:1893: warning: string length `594' is greater than the length `509' ISO C89 compilers are required to support
make[1]: *** [jartool.o] Error 1
make[1]: *** Waiting for unfinished jobs....
What am I doing wrong?
EDIT:I just tried the latest 3x version of gcc (3.4.6). That one fails during the configure: "*** Configuration mips-idt-ecoff not supported"
3) The string length warning may indicate that the author of fastjar doesn't feel that following standards is important. This means the code may be very dependent on the exact system he or she was doing development on. That system probably existed back in 1999 so you may or may not want to replicate it. :)
What I'm trying to say is that perhaps the compiler isn't to blame here for your problems compiling that specific program.
I can't even get past the configure. Could this have something to do with file/directory rights? There's not really a message about what's going wrong. I also tried gcc 3.2.2. It gives me the same message.