Skip to content

MacOS installation settings are for gcc rather than clang

ghcup installs ghc nicely under MacOS but, unlike brew install ghc, the ghc --info settings pick gcc rather than clang as the C compiler:

3c3
<  ,("C compiler command","gcc")
---
>  ,("C compiler command","clang")
8c8
<  ,("Haskell CPP command","gcc")
---
>  ,("Haskell CPP command","clang")
28c28
<  ,("unlit command","/Users/xxx/.ghcup/ghc/8.10.4/lib/ghc-8.10.4/bin/unlit")
---
>  ,("unlit command","/usr/local/Cellar/ghc/8.10.4/lib/ghc-8.10.4/bin/unlit")
56c56
<  ,("Booter version","8.6.5")
---
>  ,("Booter version","8.10.4")
76,77c76,77
<  ,("LibDir","/Users/xxx/.ghcup/ghc/8.10.4/lib/ghc-8.10.4")
<  ,("Global Package DB","/Users/xxx/.ghcup/ghc/8.10.4/lib/ghc-8.10.4/package.conf.d")
---
>  ,("LibDir","/usr/local/Cellar/ghc/8.10.4/lib/ghc-8.10.4")
>  ,("Global Package DB","/usr/local/Cellar/ghc/8.10.4/lib/ghc-8.10.4/package.conf.d")

In many cases, this will not matter either way, as gcc may just be a wrapper around clang, but in some cases it will (because build scripts / includes set different flags for the different compilers). llvm-hs builds OK with clang, but not gcc (not for any low-level reason, but because it thinks it is compiling C when compiling C++ in places, for example).

It is, of course, easy enough to set these by hand but it would seem more robust either to ask the user which compiler should be used or, ideally, to follow homebrew and default to clang.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information