Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 335943 - toolchain-funcs.eclass: gcc-fullversion() should ask the CPP for version information for cross-compatibility
Summary: toolchain-funcs.eclass: gcc-fullversion() should ask the CPP for version info...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-04 13:34 UTC by Ambroz Bizjak
Modified: 2010-09-11 17:12 UTC (History)
0 users

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


Attachments
a fix (toolchain-funcs.eclass.patch,617 bytes, patch)
2010-09-04 13:35 UTC, Ambroz Bizjak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ambroz Bizjak 2010-09-04 13:34:20 UTC
If you have CC set to clang, gcc-fullversion() returns the version of clang (e.g. 2.8). It should really return the version of gcc that clang claims to be compatible with. This version can be extracted from predefined preprocessor macros (__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__).

This issue for example affects x11-libs/qt-core, which when built with clang, because it thinks an old gcc compiler is being used, adds a compiler flag unsupported by newer gcc's to /usr/share/qt4/mkspecs/common/g++.conf (can't remember which flag), which then causes packages using qmake to fail to compile.

Reproducible: Always

Steps to Reproduce:
Comment 1 Ambroz Bizjak 2010-09-04 13:35:28 UTC
Created attachment 245952 [details, diff]
a fix

This fixes the issue by obtaining the version from preprocessor macros instead of the "-dumpversion" option.
Comment 2 SpanKY gentoo-dev 2010-09-08 16:14:48 UTC
Comment on attachment 245952 [details, diff]
a fix

should execute CPP once instead of multiple times.  plus, we have a CPP helper.

gcc-fullversion() {
    $(tc-getCPP "$@") -E -P - <<<"__GNUC__.__GNUC_MINOR__.__GNUC_PATCHLEVEL__" | sed 's: ::g'
}
Comment 3 SpanKY gentoo-dev 2010-09-11 17:12:19 UTC
no feedback, so ive done that

http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.101&r2=1.102