tHog

Cross compilation and DistCC

[2008-06-05] I'm installing Gentoo on an iMac G3, my first non-x86 unix machine. Here are some notes on how I've enabled it to use distcc on the x86 machines.

Building the cross-compilation tools

The Gentoo Wiki: How to cross compile points to crossdev, which doesn't work quite as expected. I wrote my own wrapper around it to get it basically working, and to enable some features I already use when building Gentoo packages. One is to set suitable CFLAGS and USE flags in order to use the same binaries on all x86 machines. Another is to compile on a ramdisk. End result: crossdev.sh.

Setting up distcc properly

The DistCC Cross-compiling Guide was simple and straightforward in comparison. Even to the point that I decided to write it up as a script. This needs to be run on the machine where you call the compiler -- the PPC machine, in my case. It's probably needed after each update of distcc, as it rewrites the symlinks.

Caveats

As with distcc in general, it's a good idea to have the same versions of gcc, binutils, linux-headers and glibc on all participating machines. I ran into some problems because the iMac had relatively old versions from the 2007.0 livecd, and I'd built the latest versions on other machines.


Risto A. Paju