[GHC] #15742: GHC configure step can fail when CC=clang

GHC ghc-devs at haskell.org
Fri Oct 12 00:50:59 UTC 2018


#15742: GHC configure step can fail when CC=clang
----------------------------------------+---------------------------------
           Reporter:  judah             |             Owner:  (none)
               Type:  bug               |            Status:  new
           Priority:  normal            |         Milestone:
          Component:  Build System      |           Version:  8.4.3
           Keywords:                    |  Operating System:  Linux
       Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
          Test Case:                    |        Blocked By:
           Blocking:                    |   Related Tickets:
Differential Rev(s):                    |         Wiki Page:
----------------------------------------+---------------------------------
 In our internal build of GHC from source, we are building it on Linux with
 Clang.  Unfortunately, this results in an error  on ghc-8.4.3:
 {{{
 $ ./configure CC=clang CC_STAGE0=clang --prefix=... --with-ghc=...
 ...
 checking version of gcc... configure: error: Need at least gcc version 4.4
 (4.7+ recommended)
 }}}
 Looking in the code, it seems that the logic is wrong: it calls `$CC -v`
 and parses the output unconditionally, whether or not the compiler is
 actually GCC:
 https://github.com/ghc/ghc/blob/ce7a1c4ae4c93f2d0d3d7a0b573ddd876fc855c2/aclocal.m4#L1245
 In our case, the test fails since the compiler is a build of Clang that
 doesn't produce a useful version number.

 I also realized that on macOS (where gcc *is* clang), this test succeeds
 accidentally, since the output of {{{gcc -v}}} is:
 {{{
 Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-
 gxx-include-dir=/usr/include/c++/4.2.1
 Apple LLVM version 10.0.0 (clang-1000.10.44.2)
 Target: x86_64-apple-darwin17.7.0
 Thread model: posix
 InstalledDir: /Library/Developer/CommandLineTools/usr/bin
 judahjacobson-macbookpro:~ judahjacobson$ gcc -v
 Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-
 gxx-include-dir=/usr/include/c++/4.2.1
 Apple LLVM version 10.0.0 (clang-1000.10.44.2)
 Target: x86_64-apple-darwin17.7.0
 Thread model: posix
 InstalledDir: /Library/Developer/CommandLineTools/usr/bin
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15742>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list