www-client/chromium-40 now has a check to ensure that >=gcc-4.8 is used. One can override the system GCC on the commandline, e.g. like this: CC='gcc-4.9.2' CXX='g++-4.9.2' emerge -av1 chromium However, the ebuild still assumes that the system GCC is active and aborts. This can probably be traced back to _gcc_fullversion() in toolchain-funcs. It doesn't seem to pay attention to the the $CC and $CXX envionmental variables and thus always returns the system GCC instead of the one specified in the environment.
1) Please post your `emerge --info' output in a comment. 2) Please attach the entire build log to this bug report.
Created attachment 394790 [details] emerge --info
Created attachment 394792 [details] emerge log Trying to emerge chromium with temporary cc override set. Yes, gcc-4.9.2 is installed. Yes, it can be emerged this way when I strip the check out of the ebuild.
Try setting CPP='cpp-4.9.2'.
(In reply to Mike Gilbert from comment #4) > Try setting CPP='cpp-4.9.2'. That actually works! Interesting. But it's still $CXX and not $CPP that influences the C++ compiler being used in all build scripts (that I've encountered), so shouldn't toolchain-funcs pay attention to $CXX instead of $CPP?
@toolchain: We have a gcc-version based check in pkg_pretend that does not work properly if CXX is set as shown above. gcc-version ends up calling $(tc-getCPP), which defaults to "cpp". Are we doing something wrong, or is gcc-version in toolchain-funcs.eclass broken? If the former, how can we properly check to see if g++ 4.8 or greater is being used?
See bug #335943 way we use CPP
(In reply to Mike Gilbert from comment #6) > @toolchain: We have a gcc-version based check in pkg_pretend that does not > work properly if CXX is set as shown above. gcc-version ends up calling > $(tc-getCPP), which defaults to "cpp". > > Are we doing something wrong, or is gcc-version in toolchain-funcs.eclass > broken? > > If the former, how can we properly check to see if g++ 4.8 or greater is > being used? Following up on Magnus' point about why we use cpp (to avoid clang version numbers) you should note that, when you choose a particular compiler suite with gcc-config, `gcc --version` `g++ --version` and `cpp --version` all return the same version info. However, if you override CC and CXX on the command line, but not CPP, you'll be mixing versions. I'm not sure that's safe. You may want some intelligence in pkg_pretend() to detect this and fix/warn.
It seems like calling CC or CXX would work just as well. Passing -E to them causes them to just run the pre-processor. # cpp -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" 4 9 2 # g++ -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" 4 9 2 # gcc -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" 4 9 2 # clang -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" 4 2 1 # clang++ -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" 4 2 1 Maybe we should just inline that into the chromium ebuild?
(In reply to Mike Gilbert from comment #9) > It seems like calling CC or CXX would work just as well. Passing -E to them > causes them to just run the pre-processor. > > # cpp -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" > 4 9 2 > # g++ -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" > 4 9 2 > # gcc -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" > 4 9 2 > # clang -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" > 4 2 1 > # clang++ -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" > 4 2 1 > > Maybe we should just inline that into the chromium ebuild? Yeah that would work.
toolchain-funcs.eclass now calls ${CC} -E instead of ${CPP}. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c65f6083898968b5442eeb66afd4298a3b4264e2