--- a/toolchain-funcs.eclass +++ a/toolchain-funcs.eclass @@ -483,6 +483,8 @@ tc-endian() { # Query the preprocessor to improve compatibility across different # compilers rather than maintaining a --version flag matrix. #335943 _gcc_fullversion() { + local opt="" + [[ $(tc-getCPP) == clang-cpp ]] || opt="-E" local ver="$1"; shift set -- `$(tc-getCPP "$@") -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__"` eval echo "$ver"