[distcc] Cross-Compiling

Eric Frias efrias at syncad.com
Fri Nov 12 22:05:03 GMT 2004


"Daniel Kegel" <dank at kegel.com> wrote:
> Also, "no problem" assumes you've figured out how to do it.
> There isn't a happy one-stop script like crosstool for this, AFAIK,
> and there *can't* be one that's quite as clean, because you have to
> copy files from the target machine.

I'm in the "if it ain't broke" camp too... I'm sure there are a lot of
things you can do to improve the build process, like setting up
tinderbox-type systems, but setting up 8 native compilers and 56
cross-compilers doesn't sound like my idea of fun.

There are two ways to use cross compilers with distcc -- one way is to have
the target machine be the client, doing all of the preprocessing and
linking.  If you do it this way (we do), the other machines in the compile
farm only need to have a cross-compiler that is able to convert preprocessed
source code into object code.  So you need gcc and gas, but you don't need
to have the full set of headers for the target platform, and you don't need
to create cross-linkers.

The other way I guess you could do it is to have some machine, maybe a linux
box, be the client for any build.  It would need to have a fully working
gcc, assembler, linker, and C library for each target machine.  This sounds
like a huge amount of work... I've never successfully built one, Dan can
correct me if I'm wrong.

Looking at the list of platforms, I can tell you that you're going to run
into problems making a cross-compiler for hpux -- I just discovered that
this week.  GNU's binutils doesn't have enough headers to build a
cross-assembler, though it might be possible with some minor hacking.  A
cross-linker for HP is currently impossible.

Right now we use distcc the simple way I mentioned above, having cygwin
boxes build object files for both sparc-solaris and x86-linux (hopefully HP
in the near future).  It works great, but it took a fair amount of work to
figure out how to build the cross-compilers in the first place (not so much
once you know what you're doing), and you discover that on some platforms,
you need to use older versions of binutils than you do on other platforms.
Unless you really need to get the build time for the machines down, I'd
stick with what you have.

Eric



More information about the distcc mailing list