From c17bb82f1cc66cb819acbfc7727a6b366097a323 Mon Sep 17 00:00:00 2001 From: Rodrigo Mesquita Date: Mon, 8 May 2023 16:19:11 +0100 Subject: 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 --- compiler/GHC/Driver/Session.hs | 5 +++-- compiler/GHC/Platform.hs | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'compiler') 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 -- cgit v1.2.1