Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 106943 - qt 3.3.4-r8 ebuild incorrectly detects compiler
Summary: qt 3.3.4-r8 ebuild incorrectly detects compiler
Status: RESOLVED DUPLICATE of bug 107332
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
: 120959 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-22 19:20 UTC by Jeremy Whiting
Modified: 2007-04-01 22:20 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Whiting 2005-09-22 19:20:04 UTC
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
Comment 1 AJ Armstrong 2005-09-27 12:45:12 UTC
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?
Comment 2 Gregorio Guidi (RETIRED) gentoo-dev 2005-09-28 03:26:27 UTC
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 
 
Comment 3 Jeremy Whiting 2005-09-28 05:41:53 UTC
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.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2006-01-30 11:40:58 UTC
*** Bug 120959 has been marked as a duplicate of this bug. ***
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-04-01 22:20:29 UTC
CXX="c++" is plain stupid, see Bug 94347 Comment #6

*** This bug has been marked as a duplicate of bug 107332 ***