distcc requires cc to be called fully qualified (powerpc-unknown-linux-gcc rather than cc) for cross compilers to work.
Created attachment 9222 [details, diff] patch to correct called name of gcc
No. You should only call make with "make CC=${CC}", and then YOU should call emerge like so: # CC=<mychost>-gcc emerge xft and make sure that your distcc bins come first in the PATH.
Let me explain my motivation a bit more (this goes for bugs 17233, 17235 and 17243 for those watching in black and white... - it's a bit of a rant - sorry). I'm using the latest portage, and merely adding FEATURES='distcc' - so my distcc bins being in the right place in the path is taken care of automagically. The gentoo machine is ppc. The machine running distccd is an athlon, with ppc-gcc and i586-gcc in the path, with gcc linked to i586-gcc (as you'd expect - the distcc is running in a normal user environment). This allows the athlon to serve distcc requests from the gentoo machine, and from my k6 box, but requires that the command line passed to distcc is either ppc-gcc or i586-gcc. distcc specifically recommends this, rather than gcc --target=ppc etc. Now, anything that uses GNU configure seems to be given --host=${CHOST} in its ebuild - which causes it to write CC=${CHOST}-gcc into its makefile. This means that anything using configure automagically just works with distcc and the cross compiler. Similarly, whatever KDE does just works. I'd like it if everything else worked automagically too. So, the approaches we can take are to write the qualified name into the makefile / ebuild (a la configure - which I did with the baselayout and ttmkfdir bugs) or to hope that the user has CC overridden whenever they're installing a package which doesn't use GNU configure. The first option is a lot of hassle for the maintainers, the second option is a bit of hassle for the users (and I don't think there are many people using this kind of setup, and they will realise what the problem is immediately and come looking). I agree modifying CC= in a makefile to fit a particular host seems crazy - but I did because the ebuilds were modifying CFLAGS= to fit a particular host in the same breath. Is this definately the way you want to deal with it? Thanks, Jesu
< emake CC=${CHOST}-gcc || die "Xft2 make failed" --- > emake || die "Xft2 make failed" ----------------------------------------- This is the patch. Now, why I do not like it, is because it is not flexible. For instance, if icc will be able to compile Xft, then this will have to be fixed again. Same for the seds you did with the others. Easiest and most flexible way with CC/CXX is normally to do: ------------------------------------------- make CC=$CC CXX=$CXX ------------------------------------------- Then if the user want icc, he can just set CC to that, same with in you example .. you can just set CC to $CHOST-gcc. It also just plain look neater than the seds. Now for the CFLAGS ... its usually because a Makefile sets something like: CFLAGS=-O2 -ffast-math -fomit-frame-pointer The -O2 is just for optimization, where the others are usually more critical. We can thus not do the same as for CC and just replace it totally, but rather just replace the -O2 with a sed.
Just repeating what I said in bug 18024 I modify /etc/env.d/gcc/<local compiler> such that CC and CXX get set to the fully qualified name. In a mixed environment the cross platform distcc is now transparent. emerge package works instead of having to do CC=<fullname>-gcc emerge packge
Suggested fix not flexible.