Rodrigo Mesquita pushed to branch wip/romes/26227 at Glasgow Haskell Compiler / GHC Commits: 48a31efa by Rodrigo Mesquita at 2025-07-29T17:00:46+01:00 Drop "Use interpreter" from settings The inaptly named "Use interpreter" entry in `lib/settings` recorded whether GHC had been compiled with the internal interpreter. However, that is a static property of the build, and therefore GHC should simply fix at compile time whether it is compiled with the internal interpreter by checking the HAVE_INTERNAL_INTERPRETER macro. Towards #26227 - - - - - 4 changed files: - compiler/GHC/Driver/Session.hs - compiler/GHC/Settings/IO.hs - hadrian/bindist/Makefile - hadrian/src/Rules/Generate.hs Changes: ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -3528,6 +3528,10 @@ compilerInfo dflags ("target os string", stringEncodeOS (platformOS (targetPlatform dflags))), ("target arch string", stringEncodeArch (platformArch (targetPlatform dflags))), ("target word size in bits", show (platformWordSizeInBits (targetPlatform dflags))), + -- keep "duplicate" of "Have interpreter" for backwards compatibility, + -- since we used to show both... + -- These should really be called "Has internal interpreter" + ("Use interpreter", showBool $ platformMisc_ghcWithInterpreter $ platformMisc dflags), ("Have interpreter", showBool $ platformMisc_ghcWithInterpreter $ platformMisc dflags), ("Object splitting supported", showBool False), ("Have native code generator", showBool $ platformNcgSupported platform), ===================================== compiler/GHC/Settings/IO.hs ===================================== @@ -146,8 +146,6 @@ initSettings top_dir = do pure (ld_r_path, map Option ld_r_args) iserv_prog = libexec "ghc-iserv" - ghcWithInterpreter <- getBooleanSetting "Use interpreter" - baseUnitId <- getSetting_raw "base unit-id" return $ Settings @@ -227,7 +225,7 @@ initSettings top_dir = do , sTargetPlatform = platform , sPlatformMisc = PlatformMisc { platformMisc_targetPlatformString = targetPlatformTriple target - , platformMisc_ghcWithInterpreter = ghcWithInterpreter + , platformMisc_ghcWithInterpreter = ghcWithInternalInterpreter , platformMisc_libFFI = tgtUseLibffiForAdjustors target , platformMisc_llvmTarget = tgtLlvmTarget target , platformMisc_targetRTSLinkerOnlySupportsSharedLibs = tgtRTSLinkerOnlySupportsSharedLibs target @@ -253,3 +251,13 @@ getTargetPlatform Target{..} = Platform , platformHasLibm = tgtHasLibm , platform_constants = Nothing -- will be filled later when loading (or building) the RTS unit } + + +-- | Do we have an internal interpreter? +ghcWithInternalInterpreter :: Bool +#if defined(HAVE_INTERNAL_INTERPRETER) +ghcWithInternalInterpreter = True +#else +ghcWithInternalInterpreter = False +#endif + ===================================== hadrian/bindist/Makefile ===================================== @@ -86,7 +86,6 @@ WrapperBinsDir=${bindir} lib/settings : config.mk @rm -f $@ @echo '[("unlit command", "$$topdir/../bin/$(CrossCompilePrefix)unlit")' >> $@ - @echo ',("Use interpreter", "$(GhcWithInterpreter)")' >> $@ @echo ',("RTS ways", "$(GhcRTSWays)")' >> $@ @echo ',("Relative Global Package DB", "package.conf.d")' >> $@ @echo ',("base unit-id", "$(BaseUnitId)")' >> $@ ===================================== hadrian/src/Rules/Generate.hs ===================================== @@ -484,7 +484,6 @@ generateSettings settingsFile = do settings <- traverse sequence $ [ ("unlit command", ("$topdir/../bin/" <>) <$> expr (programName (ctx { Context.package = unlit }))) - , ("Use interpreter", expr $ yesNo <$> ghcWithInterpreter (predStage stage)) , ("RTS ways", escapeArgs . map show . Set.toList <$> getRtsWays) , ("Relative Global Package DB", pure rel_pkg_db) , ("base unit-id", pure base_unit_id) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/48a31efadafb9994ffdfec19835ad556... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/48a31efadafb9994ffdfec19835ad556... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Rodrigo Mesquita (@alt-romes)