Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 588226 - [TRACKER] GCC version checks failing with clang
Summary: [TRACKER] GCC version checks failing with clang
Status: CONFIRMED
Alias: None
Product: Quality Assurance
Classification: Unclassified
Component: Trackers (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Quality Assurance Team
URL: https://archives.gentoo.org/gentoo-de...
Whiteboard:
Keywords: Tracker
Depends on: 587998 588228 588230 588232 588234 588236 607248 607250
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2016-07-07 13:12 UTC by Michael Palimaka (kensington)
Modified: 2022-08-09 11:02 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 && ...