diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-03-09 11:37:18 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-17 19:05:50 -0400 |
commit | 84927818ee68c6826327abc26d4647fb56053fb7 (patch) | |
tree | 108ab49003f77c80a1b2eeb755df44ecad416f22 /configure.ac | |
parent | 540fa6b2cff3802877ff56a47ab3611e33a9ac86 (diff) | |
download | haskell-84927818ee68c6826327abc26d4647fb56053fb7.tar.gz |
llvmGen: Accept range of LLVM versions
Previously we would support only one LLVM major version. Here we
generalize this to accept a range, taking this range to be LLVM 10 to 11,
as 11 is necessary for Apple M1 support. We also accept 12, as that is
what apple ships with BigSur on the M1.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 2645ee5aa1..6b772f4a79 100644 --- a/configure.ac +++ b/configure.ac @@ -719,10 +719,14 @@ AC_SUBST(InstallNameToolCmd) # tools we are looking for. In the past, GHC supported a number of # versions of LLVM simultaneously, but that stopped working around # 3.5/3.6 release of LLVM. -LlvmVersion=10 -AC_SUBST([LlvmVersion]) -sUPPORTED_LLVM_VERSION=$(echo \($LlvmVersion\) | sed 's/\./,/') -AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION], ${sUPPORTED_LLVM_VERSION}, [The supported LLVM version number]) +LlvmMinVersion=10 +LlvmMaxVersion=12 # inclusive +AC_SUBST([LlvmMinVersion]) +AC_SUBST([LlvmMaxVersion]) +sUPPORTED_LLVM_VERSION_MIN=$(echo \($LlvmMinVersion\) | sed 's/\./,/') +sUPPORTED_LLVM_VERSION_MAX=$(echo \($LlvmMaxVersion\) | sed 's/\./,/') +AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION_MIN], ${sUPPORTED_LLVM_VERSION_MIN}, [The minimum supported LLVM version number]) +AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION_MAX], ${sUPPORTED_LLVM_VERSION_MAX}, [The maximum supported LLVM version number]) dnl ** Which LLVM clang to use? dnl -------------------------------------------------------------- @@ -734,14 +738,14 @@ AC_SUBST([ClangCmd]) dnl ** Which LLVM llc to use? dnl -------------------------------------------------------------- AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]]) -FIND_LLVM_PROG([LLC], [llc], [$LlvmVersion]) +FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion]) LlcCmd="$LLC" AC_SUBST([LlcCmd]) dnl ** Which LLVM opt to use? dnl -------------------------------------------------------------- AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]]) -FIND_LLVM_PROG([OPT], [opt], [$LlvmVersion]) +FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion]) OptCmd="$OPT" AC_SUBST([OptCmd]) |