summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
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