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:
Created attachment 245952 [details, diff] a fix This fixes the issue by obtaining the version from preprocessor macros instead of the "-dumpversion" option.
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' }
no feedback, so ive done that http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.101&r2=1.102