Cannot ./configure GHC on fresh Mac
I cannot build GHC on my freshly plucked Apple.
Here is my output from configure
rae:18:12:41 ~/ghc/ghc-homo> ./configure
checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for GHC version date... inferred 9.3.20220130
checking for GHC Git commit id... inferred e3b4b275b9fa15f344e6b9c43e5ff3f9a4dd0703
checking for ghc... /Users/rae/local/bin/ghc
checking version of ghc... 8.10.7
checking build system type... arm-apple-darwin21.3.0
checking host system type... arm-apple-darwin21.3.0
checking target system type... arm-apple-darwin21.3.0
build platform inferred as: aarch64-apple-darwin
host platform inferred as: aarch64-apple-darwin
target platform inferred as: aarch64-apple-darwin
configure: GHC build : aarch64-apple-darwin
configure: GHC host : aarch64-apple-darwin
configure: GHC target : aarch64-apple-darwin
checking for sh... /bin/sh
checking whether target supports a registerised ABI... yes
checking whether target supports tables next to code... yes
checking for path to top of build tree... /Users/rae/ghc/ghc-homo
checking for -windres... no
checking for windres... no
checking for -dllwrap... no
checking for dllwrap... no
checking for -objdump... no
checking for objdump... objdump
checking Xcode version... objc[55098]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x20c147678) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1062082c8). One of the two will be used. Which one is undefined.
objc[55098]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x20c1476c8) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106208318). One of the two will be used. Which one is undefined.
13.2.1
configure: Xcode version component 1: 13
configure: Xcode version component 2: 2
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for sys/time.h... yes
checking for vfork.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking how to run the C preprocessor... cc -E
checking for -ld.lld... no
checking for ld.lld... ld.lld
checking whether C compiler supports -fuse-ld=lld... yes
checking for ld.gold object merging bug (binutils 22266)... checking whether ld is GNU ld... YES
checking whether ld understands --build-id... no
checking whether ld understands -no_compact_unwind... no
checking whether ld understands -filelist... no
checking for -nm... no
checking for nm... nm
checking whether nm program is broken... no
checking for ranlib... ranlib
checking for -strip... no
checking for strip... strip
checking for -libtool... no
checking for libtool... libtool
checking for -otool... no
checking for otool... otool
checking for -install_name_tool... no
checking for install_name_tool... install_name_tool
checking for -clang... no
checking for clang... clang
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for llc-13... no
checking for llc-13.0... no
checking for llc-12... no
checking for llc-12.0... no
checking for llc-11... no
checking for llc-11.0... no
checking for llc-10... no
checking for llc-10.0... no
checking for llc-9... no
checking for llc-9.0... no
checking for llc... llc
checking llc version (13.0.0) is between 9 and 13... no
configure: We only support llvm 9 to 13 (found 13.0.0).
checking for opt-13... no
checking for opt-13.0... no
checking for opt-12... no
checking for opt-12.0... no
checking for opt-11... no
checking for opt-11.0... no
checking for opt-10... no
checking for opt-10.0... no
checking for opt-9... no
checking for opt-9.0... no
checking for opt... opt
checking opt version (13.0.0) is between 9 and 13... no
configure: We only support llvm 9 to 13 (found 13.0.0).
configure: Creating links for headers shared by the RTS and compiler
configure: done.
configure: Creating links for in-tree file handling routines
configure: Routines in place. Packages can now be build normally.
configure: Creating links for ghci wrapper
configure: done.
checking whether #! works in shell scripts... yes
configure: $CC is not gcc; assuming it's a reasonably new C compiler
checking whether CC supports -no-pie... no
checking whether C compiler supports __atomic_ builtins... yes
checking whether -latomic is needed for sub-word-sized atomic operations... failed
configure: error: sub-word-sized atomic operations are not available.
rae:18:13:43 ~/ghc/ghc-homo>
The first thing that makes any sense to me is that GHC thinks that 13.0.0
> 13
. That just might be reasonable, but I don't know how to recover from this problem, and my hunch is that GHC should just learn to tolerate 13.0.0
.
But the killer error appears to be the lack of support for sub-word-sized atomic operations. I have no idea how to proceed.
I did check https://gitlab.haskell.org/ghc/ghc/-/wikis/building/preparation/mac-osx but didn't find any clear help. :(
Help?