Default configure wrong for macOS
Summary
Default configuration is wrong on macOS. Builds using ./configure
(equivalently hadrian --configure
) have recently begun failing with:
libraries/integer-gmp/cbits/wrappers.c:30:3: error: __GNU_MP_VERSION not defined
# error __GNU_MP_VERSION not defined
^
libraries/integer-gmp/cbits/wrappers.c:42:3: error: WORD_SIZE_IN_BITS != GMP_LIMB_BITS not supported
# error WORD_SIZE_IN_BITS != GMP_LIMB_BITS not supported
^
As explained at https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation/mac-osx#setting-up-a-macos-x-system-for-building-ghc-head, this can be overcome by invoking configuration as CC=clang ./configure
.
As recent versions of Xcode use clang, I argue that the default configuration choice is wrong. That is, CC=clang
should be assumed and overridden manually if necessary to CC=gcc
.
Steps to reproduce
./boot && ./configure && make
Expected behavior
The above procedure should produce a build "out of the box" without requiring setting CC
.
Environment
Operating System: macOS (10.14.5), GHC 8.6.5 with
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin