Skip to content

ghc-8.2.2 configure script fail to extract gcc version correctly

In GHC's configure script, there's a variable $fp_cv_gcc_version which contains gcc version by running one-line bash code.

    fp_cv_gcc_version="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [^0-9]*\([0-9.]*\).*/\1/g'`"

Following is gcc version info of my system.

Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Found CUDA installation: /usr/local/cuda, version 7.5

Expected value of fp_cv_gcc_version is 9.0.0. But CUDA version is extracted unexpectedly and attached to version info resulting buggy mk/config.mk like following.

GccVersion            = 9.0.0
7.5
ifeq "$(phase)" "0"
CrossCompilePrefix    =
...
Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information