Using distcc with 9.2.0 configured as a cross-compiler

onre

SYS 64738
Feb 8, 2019
123
72
28
Toijala, Finland
So, I got this working, bringing major speedups. Latest distcc release compiles on IRIX and works just fine. Step-by-step-ish guide:

1) Decide where you want to put things, let's call that $PREFIX.
2) Make a tarball from a live IRIX system with dirs /lib32, /usr/lib32 and /usr/include. Unpack this somewhere, let's call that place $IRIX.
3) Take sgug-rse binutils SRPM, unpack, apply the patches, compile to $PREFIX with these options:
Code:
./configure --prefix=$PREFIX --target=mips-sgi-irix6.5 --disable-werror --with-sysroot=$IRIX
4) Do a bit of preliminary setup for building the compiler.
Code:
ln -s $IRIX/usr/lib32 /usr/lib32  # yes, this is ugly, but the paths for the crt*.o are hardcoded in gcc. if you want, you can change them in the source.
ln -s $IRIX/usr/include $PREFIX/mips-sgi-irix6.5/sys-include
5) Unpack the compiler from sgug-rse SRPM, apply the patch and build it. Preferably use a separate directory for building to make it easier to recover from possible mistakes.
Code:
../gcc-9.2.0-20190812/configure --enable-obsolete --disable-multilib --prefix=$PREFIX --target=mips-sgi-irix6.5 --disable-nls --enable-languages=c,c++,lto --disable-libstdcxx --with-build-sysroot=$IRIX --enable-lto --enable-tls=no
6) Install distcc on the machine running the crosscompiler. The ones from Debian and Ubuntu seem to work, at least.
7) Start up distcc. Here's the script I use for mine, adjust paths, IPs and ports to taste.
Code:
#!/bin/bash

# this is $PREFIX/mips-sgi-irix6.5/bin - note, if distcc can't run, say, cc, just create symlinks in this dir
# and everything will work
export DISTCCD_PATH=~/irix-crossbuild/mips-sgi-irix6.5/bin 
# allow the 100.100.100.0/24 C class to access this - replace with whatever you have at home
distccd --daemon --allow 100.100.100.0/24 -p 8086
8) Compile distcc on IRIX. The build process may require Python to get the include server used by the pump mode working. If this is the case, you could install the one from ports.sgi.sh or compile one with @dexter1's excellent patches. This should be a straightforward build.
9) Set up environment on IRIX box.
Code:
export DISTCC_HOSTS=100.100.100.42:8086 # replace with your IP and port
10) Build something with make -j<x> where x can be found out by trying. My laptop running the cross-compiler has 4 cores and -j6 seems to produce best results.

Preprocessing is still done on the SGI side, so this will not be blazingly fast like native cross-compilation is. However, it does help quite a bit. Building bash 4.4 was sped up by close to 70 % on my Octane 2*360 MHz setup.

Have fun!
 
Last edited:
  • Like
Reactions: Elf

Unxmaal

Administrator
Feb 8, 2019
86
42
18
I've made a new branch "distcc_ct" for Compilertron that replicates the above in a docker container:


You can git clone this repo then run docker compose up to get distcc running with a gcc 9 that's compiled with IRIX headers.

This container's very much a WIP. It's monstrously large at over 5.5gb. I have done no optimizations, and everything's hard-coded for these versions. Pull Requests are encouraged. ;D
 
  • Like
Reactions: onre

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu