summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorRodrigo Mesquita <rodrigo.m.mesquita@gmail.com>2023-05-08 16:19:11 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-11 04:12:07 -0400
commitc17bb82f1cc66cb819acbfc7727a6b366097a323 (patch)
tree6c06bd797e954a4a1a4c12fe00623f1362f7c597 /compiler
parent40c7daed0c971e58e86a8189f82f72e9213af8b6 (diff)
downloadhaskell-c17bb82f1cc66cb819acbfc7727a6b366097a323.tar.gz
Move "target has RTS linker" out of settings
We move the "target has RTS linker" information out of configure into a predicate in GHC, and remove this option from the settings file where it is unnecessary -- it's information statically known from the platform. Note that previously we would consider `powerpc`s and `s390x`s other than `powerpc-ibm-aix*` and `s390x-ibm-linux` to have an RTS linker, but the RTS linker supports neither platform. Closes #23361
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/Driver/Session.hs5
-rw-r--r--compiler/GHC/Platform.hs18
2 files changed, 21 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 027b97d226..6a7ba74477 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -4830,8 +4830,9 @@ compilerInfo dflags
("Target platform", platformMisc_targetPlatformString $ platformMisc dflags),
("Have interpreter", showBool $ platformMisc_ghcWithInterpreter $ platformMisc dflags),
("Object splitting supported", showBool False),
- ("Have native code generator", showBool $ platformNcgSupported (targetPlatform dflags)),
- ("Target default backend", show $ platformDefaultBackend (targetPlatform dflags)),
+ ("Have native code generator", showBool $ platformNcgSupported platform),
+ ("target has RTS linker", showBool $ platformHasRTSLinker platform),
+ ("Target default backend", show $ platformDefaultBackend platform),
-- Whether or not we support @-dynamic-too@
("Support dynamic-too", showBool $ not isWindows),
-- Whether or not we support the @-j@ flag with @--make@.
diff --git a/compiler/GHC/Platform.hs b/compiler/GHC/Platform.hs
index a630e0c1d3..6ea05b30a3 100644
--- a/compiler/GHC/Platform.hs
+++ b/compiler/GHC/Platform.hs
@@ -29,6 +29,7 @@ module GHC.Platform
, platformInIntRange
, platformInWordRange
, platformCConvNeedsExtension
+ , platformHasRTSLinker
, PlatformMisc(..)
, SseVersion (..)
, BmiVersion (..)
@@ -271,6 +272,23 @@ platformCConvNeedsExtension platform = case platformArch platform of
| OSDarwin <- platformOS platform -> True
_ -> False
+-- | Does this platform have an RTS linker?
+platformHasRTSLinker :: Platform -> Bool
+-- Note that we've inlined this logic in hadrian's
+-- Settings.Builders.RunTest.inTreeCompilerArgs.
+-- If you change this, be sure to change it too
+platformHasRTSLinker p = case archOS_arch (platformArchOS p) of
+ ArchPPC -> False -- powerpc
+ ArchPPC_64 ELF_V1 -> False -- powerpc64
+ ArchPPC_64 ELF_V2 -> False -- powerpc64le
+ ArchS390X -> False
+ ArchRISCV64 -> False
+ ArchLoongArch64 -> False
+ ArchJavaScript -> False
+ ArchWasm32 -> False
+ _ -> True
+
+
--------------------------------------------------
-- Instruction sets