![]() |
Stein: HowTo use a "distcc-farm" to crosscompile for the slug.I'll try to figure out a easy and seamless way of using "emerge" command at the slug to automaticly start cross-compile on gentoo desktop. Therby greatly reducing compile time on the slug. Setup a distcc host (gentoo desktop)
# emerge distcc
# emerge crossdev
The below text assumes that your slug's gentoo installation is big-endian with uclibc. You should use the same value you used for your CHOST in /etc/make.conf (on your slug).
# crossdev armeb-softfloat-linux-uclibc
Note: If the currently unmasked compiler is a different version than the one used on your slug, you will need to specify the gcc version you will be using on your slug.
Example:
# crossdev --gcc 3.4.6 armeb-softfloat-linux-uclibc
This won't always result in the exact gcc version, but it should be a binary-compatible version.
This didn't work for me. I first had to switch both compiler profiles to slug compatible versions by doing:
To get a list of available compilers do: # gcc-config -l ...
[1] armeb-softfloat-linux-uclibc-3.4.6
...
[5] x86_64-pc-linux-gnu-3.4.6
...
followed by:
# gcc-config armeb-softfloat-linux-uclibc-3.4.6 # gcc-config x86_64-pc-linux-gnu-3.4.6 And then continue with the steps noted above. Setup the slug
# emerge distcc
I find that -j2 works pretty good. Any more than that and a non-fattened slug will start swapping.
# distcc-config --set-hosts "<machine1>/count1 <machine2>/count2"
Replace <machineN> with the name (if it can be resolved) of a distcc host.
The /countN is optional, and can be used to limit the number of concurrent builds on a distcc host.
Example:
# distcc-config --set-hosts "192.168.0.3/2"
Note that localhost is NOT in the list. It will fall back to the local host if the remote one is down, but every other compilation should be done on a remote machine to ease the burden on the poor slug.
Here's a script that will correct it for you: DistccCrossCompileFixupScript
Check that it works
#include <stdio.h>
int main(int argc, const char** argv)
{
printf("Hello, World\n");
return 0;
}
# export PATH=/usr/lib/distcc/bin:$PATH
# DISTCC_VERBOSE=1 gcc -c hello.c -o hello.o
# gcc hello.o -o hello
# ./hello
Note that distcc will run the preprocessor and linker on the slug so it will not build remotely if your compilation line does linking as well.
Refs:
view ·
edit ·
print ·
history ·
Last edited by jaguarondi.
Based on work by jaguarondi, Benjamin Wiedmann, bernied, Kevin Harris, and Stein. Originally by Stein. Page last modified on May 07, 2007, at 11:56 PM
|