Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 537554 - www-client/chromium-40.0.2214.91 CC='gcc-4.9.2' CXX='g++-4.9.2' - ERROR: www-client/chromium-40.0.2214.91::gentoo failed (pretend phase): At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.
Summary: www-client/chromium-40.0.2214.91 CC='gcc-4.9.2' CXX='g++-4.9.2' - ERROR: www-...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-24 15:15 UTC by haarp
Modified: 2016-11-19 02:25 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge-info,5.21 KB, text/plain)
2015-01-24 19:45 UTC, haarp
Details
emerge log (emerge-chromium,2.16 KB, text/plain)
2015-01-24 19:46 UTC, haarp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description haarp 2015-01-24 15:15:39 UTC
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.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2015-01-24 19:31:25 UTC
1) Please post your `emerge --info' output in a comment.
2) Please attach the entire build log to this bug report.
Comment 2 haarp 2015-01-24 19:45:01 UTC
Created attachment 394790 [details]
emerge --info
Comment 3 haarp 2015-01-24 19:46:24 UTC
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.
Comment 4 Mike Gilbert gentoo-dev 2015-01-25 18:45:14 UTC
Try setting CPP='cpp-4.9.2'.
Comment 5 haarp 2015-01-25 18:52:08 UTC
(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?
Comment 6 Mike Gilbert gentoo-dev 2015-01-25 18:58:45 UTC
@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?
Comment 7 Magnus Granberg gentoo-dev 2015-01-25 19:35:20 UTC
See bug #335943 way we use CPP
Comment 8 Anthony Basile gentoo-dev 2015-01-25 19:57:19 UTC
(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.
Comment 9 Mike Gilbert gentoo-dev 2015-01-25 20:07:37 UTC
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?
Comment 10 Anthony Basile gentoo-dev 2015-01-26 11:00:54 UTC
(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.
Comment 11 Mike Gilbert gentoo-dev 2016-11-19 02:25:05 UTC
toolchain-funcs.eclass now calls ${CC} -E instead of ${CPP}.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c65f6083898968b5442eeb66afd4298a3b4264e2