Setting up DistCC with crosscompile for your KuroBox
My desktop system is a x86 AthlonXP 2600 system. Therefore this howto will be specific to cross-compiling on a x86 host for a powerpc target. Theoretically this should work for any host architecture provided that you make the appropriate adjustments.
First things first:
Keep in mind that my Kuro Box uses U-boot and runs a 2.6 kernel. Furthermore I use gcc4.1.1 and glibc-2.4.
Even if you dont use U-boot and run the stock 2.4 kernel, you could still crosscompile, but since you need the same gcc and glibc version on both system, I can imagine this could be quite a hassle on a up to date gentoo system.
On both your desktop system and your kuro box, the gcc and glibc versions should be mostly identical. What I mean by that is as follows:
- Host: glibc-2.4 Kuro: glibc-2.4-r1 OK
- Host: glibc-2.4 Kuro: glibc-2.3 NOT OK
Ok, once that is out of the way, emerge distcc on both the kuro and your desktop. Just follow the gentoo distcc guide: Gentoo DistCC Guide
Once that is out of the way, emerge crossdev on your desktop system. Just follow the guide on gentoo.org for details: Cross-compiling with DistCC
The thing to remember here is as follows: When considering the cross-compiling howto, replace every instance of "sparc-unknown-linux-gnu" with "powerpc-unknown-linux-gnu".
Furthermore, the crossdev instructions only apply to your desktop, not the kurobox! In other words, you can emerge and setup crossdev on all of your HOST PCs if you have more than one.
Crossdev is basically a tool which will install a cross-compiling environment in a portage overlay, e.g. /usr/local/portage.
Crossdev accepts different flags which allow you to define which gcc, glibc, binutils and linux-headers version you want to build for your cross-compilation toolchain.
These versions should be identical to the versions on your kuro-box.
In my case I had to run crossdev like so:
- crossdev -v --binutils 2.17 --gcc 4.1.1 --libc 2.4-r3 --kernel 2.6.16 --target powerpc-unknown-linux-gnu
This will step will take a while, since you are compiling a complete and separate toolchain.
Once it finishes, adjust your DISTCC_HOSTS on both your desktop and your kurobox, start the distcc daemons and fire away.
I would suggest to start with emerging something small and non-critical, like iptraf. That way you can see if compiles at all or not and you dont risk installing a buggy version of something important.