Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 17237 - xft-2.0.1-r1 compile failed with distcc crosscompile
Summary: xft-2.0.1-r1 compile failed with distcc crosscompile
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-10 12:35 UTC by Tom Ward
Modified: 2003-04-06 11:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to correct called name of gcc (xft-2.0.1-r1.ebuild-xdistcc.patch,100 bytes, patch)
2003-03-10 12:35 UTC, Tom Ward
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Ward 2003-03-10 12:35:09 UTC
distcc requires cc to be called fully qualified (powerpc-unknown-linux-gcc rather than 
cc) for cross compilers to work.
Comment 1 Tom Ward 2003-03-10 12:35:26 UTC
Created attachment 9222 [details, diff]
patch to correct called name of gcc
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-03-10 21:58:20 UTC
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.
Comment 3 Tom Ward 2003-03-10 23:27:07 UTC
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 
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-03-11 10:25:27 UTC
< 	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.
Comment 5 James Boddington (RETIRED) gentoo-dev 2003-03-26 17:11:00 UTC
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 
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-06 11:13:51 UTC
Suggested fix not flexible.