Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 588226

Summary: [TRACKER] GCC version checks failing with clang
Product: Quality Assurance Reporter: Michael Palimaka (kensington) <kensington>
Component: TrackersAssignee: Gentoo Quality Assurance Team <qa>
Status: CONFIRMED ---    
Severity: normal CC: dschridde+gentoobugs, wizardedit
Priority: Normal Keywords: Tracker
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://archives.gentoo.org/gentoo-dev/message/acd35c3475c79dc73ad31ce6f689bc8c
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 587998, 588228, 588230, 588232, 588234, 588236, 607248, 607250    
Bug Blocks: 408963    

Description Michael Palimaka (kensington) gentoo-dev 2016-07-07 13:12:54 UTC
Previously, the GCC version check functions from toolchain-funcs.eclass would return the active GCC version, even if CC was overridden (eg. with clang).

This behaviour was changed so that the active compiler is queried, causing these checks to fail with clang since it reports itself as GCC 4.2.

From $URL:

The common use cases:

a. checking for a specific gcc version:

  [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]

would become:

  tc-is-gcc && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]

i.e. it would not trigger for clang.

b. applying clang-specific quirks (discouraged but people still do
that):

  [[ ${CC} == *clang* ]] && ...

would become:

  tc-is-clang && ...