[distcc] Using distcc with cross compilers

Martin Pool mbp at samba.org
Fri Aug 8 02:24:17 GMT 2003


On  7 Aug 2003, Carter Sanders <general at cartersanders.com> wrote:
> Sorry if this is a repost - I haven't seen the last one and I think the 
> authorized didn't let it through.
> 
> My company has a pretty complicated build system that builds cross 
> compilers with gcc at build time and then invokes them to create builds 
> for various embedded platforms. Consequently, a majority of our build 
> time involve calls to the cross compilers rather than native gcc 
> invocations.
> 
> Is distcc adaptable for this sort of application? My initial read is 
> that if I have a different distcc daemon running with DISTCCPATH=<cross 
> compiler path> for each platform, I should be OK. Has anybody tried
> this?

Hi Carter,

Yes, you should be able to do this with distcc.  It is somewhat
similar to the gcc bootstrap process, so you can read the archive
threads about that.

There seem to be two main things you need to work out:

1 - You need to make the newly built compiler available on all
machines.  There are various ways: NFS-mounting the directory into
which it is installed, or using rsync or scp to copy it to all
machines.  distcc won't do it for you, but it should be possible with
a couple of lines in your makefile.

Note that gcc embeds some configuration directories into the binary.
You must install it into the configured directory for it to be able to
find its support files.  Of course this can be something like

  ./configure --prefix=${buildtopdir}/prefix/

if that is shared by NFS.

2 - You need to make sure distcc invokes the right compiler.  How this
happens depends a bit on #1.  Hopefully you have built the compiler
with a fully-qualified name (e.g. ia64-linux-gcc), so once it's copied
to the destination machines you just need to make sure it's found on
the right path.  One way is to set up different daemons as you say,
but probably a better way is to just pass a full path from the client:

  distcc ${buildtopdir}/prefix/bin/ia64-linux-gcc -c hello.c

The daemon will use the nominated path.

-- 
Martin 



More information about the distcc mailing list