When emerging updates qt ebuild always fails on my distcc farm since I have the line: CXX="c++" in my /etc/make.conf for cross compiling issues. the ebuild for qt-3.3.4-r8 only detects g++ and icc as valid compilers and rejects all others, although c++ is a link to g++ on my systems. The code in the ebuild that causes the problem is the following starting at line 57 in the pkg_setup section: CXX=$(tc-getCXX) if [[ ${CXX/g++/} != ${CXX} ]]; then PLATCXX="g++" elif [[ ${CXX/icc/} != ${CXX} ]]; then PLATCXX="icc" else die "Unknown compiler ${CXX}." fi Reproducible: Always Steps to Reproduce: 1. add the line CXX="c++" to /etc/make.conf 2. emerge qt Actual Results: Error: Unknown compiler c++. after the md5 checks, etc Expected Results: emerge and install qt using c++ as the compiler I temporarily fixed the situation on my system by changing the line in /etc/make.conf to CXX="g++" but all other ebuilds work fine the way it was before, so I suggest a fix to the qt ebuild to check if the executable in CXX is available, rather than checking the value of the variable to be either g++ or icc onlf
As this is the fourth time this has been reported, and two of the others have been marked invalid, and to pre-empt this one from joining them, perhaps we should instead wonder if this is actually a valid bug. We might also note that there are a few in the forums reporting it: http://forums.gentoo.org/viewtopic-t-384560.html Setting CXX="c++" is a known, and relatively common, workaround for dealing with amd64 (and probably other) cross-compilation issues with distcc. The fact that qt seems to be the only ebuild that breaks with it set might indicate that this is an issue with the qt ebuild. The assumption that the system compiler is invalid based on testing a macro seems a bit naive, perhaps a more sophisticated test, or simply testing that it is set at all and trusting the user who set it, might be prefered. What do other ebuilds that want to test the C++ compiler use?
I see no problems in relaxing the test, what about something like this? CXX=$(tc-getCXX) if [[ ${CXX/icc/} != ${CXX} ]]; then PLATCXX="icc" else PLATCXX="g++" fi
that ought to work I think, but I like AJ's idea of just testing to see if it is set and trusting the one who set it. Seems like a more reasorable solution to me.
*** Bug 120959 has been marked as a duplicate of this bug. ***
CXX="c++" is plain stupid, see Bug 94347 Comment #6 *** This bug has been marked as a duplicate of bug 107332 ***