I've been playing around with GCC 5 and I'm here to document my experience compiling it:
Library versions:
gmp-6.20
isl-0.18
mpc-1.1.0
mpfr-4.0.2
Binutils version 2.17
Bootstrap GCC: 4.7.4
There exist newer versions, but I'm not doing this because I want the full suite. I only want GCC5 to try against irix as/ld.
I used the didbs project by Daniel Hams to get patches and instructions/configure flags for all of these, though the lib builds are my own and were mostly carried out on MIPSPro 7.4.4m
Configure: ./configure --prefix=/opt/local/gcc5/ --libdir=/opt/local/gcc5/lib32 --disable-silent-rules --disable-nls --disable-multilib --enable-obsolete --enable-languages=c,c++ --disable-bootstrap --enable-shared --enable-static --enable-threads=posix --enable-tls=no --enable-lto --with-gmp=/usr/nekoware/ --with-gmp-lib=/usr/nekoware/lib32 --with-system-zlib LD=/opt/local/gcc-4.7.4/bin/ld AS=/opt/local/gcc-4.7.4/bin/as CC=/opt/local/gcc-4.7.4/bin/gcc CXX=/opt/local/gcc-4.7.4/bin/g++ CFLAGS=-O2 -mips4 CXXFLAGS=-O2 -mips4 CPPFLAGS='-I/usr/nekoware/include -I/usr/include' LDFLAGS='-L/usr/nekoware/lib32'
Other setup: The build box this is on only has 1.25G of RAM. This turned out to be not enough, so I added a 4g swap file to /var/tmp/moreswap and initialized it.
To run, type "gmake -j<number of CPUS+1>"
Afterwards, run the testsuite: "gmake check"
In my case, it only partially ran because it wants guile, autogen etc. I'm not going to install those. But someone else is free to tell me what they got and if my guide works.
Also, if some tests fail but you know how to fix them, or know libs/features I missed that are important, don't hesitate to let me know.
Pre-patched, MIPSIV source code:
http://irix.cc/gcc5-mipsiv-irix.tar.gz
Questions I got from people I discussed this with:
1.Will nekoware accept GCC builds?
GCC builds are gonna happen. It's just the nature of things. A native mipspro build of a similar version and functionality will trump a GCC build in most cases, but assuming no other exists, why not? Just need that to be documented, and generally, though not required, I'd like people to give mipspro a shot and if you're skilled enough, try patching it. Don't be afraid, compilers do smell fear!
2. Will you release a tardist of this?
Possibly, but probably not this build unless there's considerable demand and after further testing, and if I did, I'd want it to be standalone from nekoware or any other project, so I'd probably rebuild all the libs into their own directory.
I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast.
https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently.
https://codeberg.org/SolusRaion -- Code repos I control
Technical problems should be sent my way.