# SGUG Build Process Notes
Random notes:
chroot setup:
* Add user and group `sgug` with ID 31310
* Make `/opt/sgugbuild`
* Untar `irix-6522-2.tar` in `/opt/sgugbuild` to create new buildroot
* Edit `/opt/sgugbuild/etc/{passwd,group}` to add `sgug` user/group with same 31310 ID
in the chroot:
* Untar sgug selfhoster 0.0.7 in /opt/sgugbuild/usr
* fix libdicl with fixed version that doesn't depend on /proc (because it won't exist in the chroot)
* use `sudo chroot --userspec=sgug:sgug /opt/sgugbuild/usr` for entering the chroot
outside bootstrap setup, ccache/distcc:
* Make clang symlinks to distcc to mips64-sgi-irix6.5-gnuabin32-clang and -clang++
* start distccd: `DISTCCD_PATH=/opt/irix/sgug/llvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin distccd -j32 --allow-private --daemon --enable-tcp-insecure`
* (clang 14 pre4-1 or higher needed, which has the right symlinks packaged for clang itself)
* TODO: investigate pump mode
```
export CC="ccache mips64-sgi-irix6.5-gnuabin32-clang"
export CXX="ccache mips64-sgi-irix6.5-gnuabin32-clang++"
export LD=ld.lld
export CCACHE_PREFIX=distcc
export DISCC_HOSTS=frost/32
rpmbuild --nocheck -ba tar.spec
```