diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-08-30 12:35:23 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-08-31 18:27:57 -0400 |
commit | e8eaf8074f78df3f40ecfb9ef94c2077db9c87a1 (patch) | |
tree | 32ee012d132ecb01e203036a42bf8448ec98fc0e /hadrian | |
parent | f7b4dcbd7d76101e7e6eee728bde2b5a5c873c02 (diff) | |
download | haskell-e8eaf8074f78df3f40ecfb9ef94c2077db9c87a1.tar.gz |
Refine in-tree compiler args for --test-compiler=stage1
Some of the logic to calculate in-tree arguments was not correct for the
stage1 compiler. Namely we were not correctly reporting whether we were
building static or dynamic executables and whether debug assertions were
enabled.
Fixes #22096
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/src/Settings/Builders/RunTest.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs index 3af35828ac..5551cf1b35 100644 --- a/hadrian/src/Settings/Builders/RunTest.hs +++ b/hadrian/src/Settings/Builders/RunTest.hs @@ -17,6 +17,8 @@ import qualified Data.Set as Set import Flavour import qualified Context.Type as C import System.Directory (findExecutable) +import Settings.Program +import qualified Context.Type getTestSetting :: TestSetting -> Action String getTestSetting key = testSetting key @@ -91,16 +93,16 @@ inTreeCompilerArgs stg = do return (dynamic `elem` ways, threaded `elem` ways) -- MP: We should be able to vary if stage1/stage2 is dynamic, ie a dynamic stage1 -- should be able to built a static stage2? - hasDynamic <- flavour >>= dynamicGhcPrograms + hasDynamic <- (dynamic ==) . Context.Type.way <$> (programContext stg ghc) -- LeadingUnderscore is a property of the system so if cross-compiling stage1/stage2 could -- have different values? Currently not possible to express. leadingUnderscore <- flag LeadingUnderscore - -- MP: This setting seems to only dictate whether we turn on optasm as a compiler - -- way, but a lot of tests which use only_ways(optasm) seem to not test the NCG? withInterpreter <- ghcWithInterpreter unregisterised <- flag GhcUnregisterised withSMP <- targetSupportsSMP - debugAssertions <- ghcDebugAssertions <$> flavour + debugAssertions <- if stg >= Stage2 + then ghcDebugAssertions <$> flavour + else return False profiled <- ghcProfiled <$> flavour <*> pure stg os <- setting HostOs |