summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2019-11-04 14:18:25 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-07 08:40:13 -0500
commita424229da7cdf2ffca910ee0dd2af250f62ba5c3 (patch)
treef44a3c108f23233f1375097692f1d83bf5e4404e
parent708c60aa144ed68a5b67a61f16539258dbcdb24e (diff)
downloadhaskell-a424229da7cdf2ffca910ee0dd2af250f62ba5c3.tar.gz
For s390x issue a warning if LLVM 9 or older is used
For s390x the GHC calling convention is only supported since LLVM version 10. Issue a warning in case an older version of LLVM is used.
-rw-r--r--compiler/llvmGen/LlvmCodeGen.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs
index 49b24e8885..ad6aebeb5a 100644
--- a/compiler/llvmGen/LlvmCodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen.hs
@@ -27,6 +27,7 @@ import PprCmm
import BufWrite
import DynFlags
+import GHC.Platform ( platformArch, Arch(..) )
import ErrUtils
import FastString
import Outputable
@@ -64,6 +65,11 @@ llvmCodeGen dflags h us cmm_stream
"Currently only " <> text (llvmVersionStr supportedLlvmVersion) <> " is supported." <+>
"System LLVM version: " <> text (llvmVersionStr ver) $$
"We will try though..."
+ let isS390X = platformArch (targetPlatform dflags) == ArchS390X
+ let major_ver = head . llvmVersionList $ ver
+ when (isS390X && major_ver < 10 && doWarn) $ putMsg dflags $
+ "Warning: For s390x the GHC calling convention is only supported since LLVM version 10." <+>
+ "You are using LLVM version: " <> text (llvmVersionStr ver)
-- run code generation
a <- runLlvm dflags (fromMaybe supportedLlvmVersion mb_ver) bufh us $