Using distcc to cross compile on PPC for x86

mdooner

Registered
I want to use distcc to cross compile software on a PPC machine for a x86 machine. Specifically to use my G5 to help compile software for my much slower Gentoo laptop.

I havn't had much luck Googling for anything on this topic, everyone seems to want to compile PPC code on x86 machines instead.

Does anyone have any info on this?
 
I don't know about Gentoo but i do know that XCode doesn't even bother looking for other distcc machines unless the project file is huge.

And I'm not sure how cross-compiling would work in the first place. Wouldn't using distcc remotely on your G5 be the same as copyig the project to the G5 : it would still compile for PPC, wouldn't it, since it resides in a PPC environment ?

That's just a guess....
 
The idea is that you use distcc and gcc to compile in your native platform. GCC will compile for whatever architecture you tell it to. I have distcc installed now, using the Darwinports port. Once I test it out with my Gentoo system i'll post the results, maybe write up something simple on it if it works.
 
The manpage seems to indicate you can do it by building your gcc from source, and specifying its target architecture and OS when you configure it - this would give you a gcc with a name like i686-linux-gcc-3.3. Then you could, say,

make -j2 CC="distcc i686-linux-gcc-3.3"

You'd have to make sure you have the same version of gcc on both machines, and that it had the same names - so on the mac i686-linux-gcc-3.3 would be a cross-compiler, and on the laptop i686-linux-gcc-3.3 might just be a symlink to the regular gcc-3.3.

Of course I'm speaking out of ignorance here, I've never tried this, just looked at the docs...
 
That's pretty cool...

Of course, now that i think about it, cc would compile to whatever you tell it to. I got it caught up in configure/make shell scripts, which just auto-detect the platform and pass that to cc.
 
Not only do you need the compiler, but I'm quite sure you'll need the corresponding glibc and possibly other libraries installed for the correct architecture as well.
 
Actually, it's my understanding you don't need the target system's libraries to run a distcc build for it.

The files are preprocessed on the client (so any headers get included there), passed to the server for compilation, and then object code is passed back to the client. The client then does any linking (so libraries get linked in there). All that happens on the servers is the compilation from source to object code, so all you should need on the server is a compiler that knows how to do that for the appropriate target.
 
mdooner, I've been compiling a heck of a lot of stuff on my iBook (333MHz) and would like your little write-up on using distcc (since I could compile on my hopefully-incoming G5).

;)
 
Back
Top