Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL at Glasgow Haskell Compiler / GHC
Commits:
-
2e1c0782
by Sven Tennie at 2026-03-08T11:18:20+00:00
-
78f81994
by Sven Tennie at 2026-03-08T11:35:56+00:00
-
2c480368
by Sven Tennie at 2026-03-08T11:41:47+00:00
-
d12e83fa
by Sven Tennie at 2026-03-08T11:48:01+00:00
-
83e7dc2e
by Sven Tennie at 2026-03-08T12:01:16+00:00
6 changed files:
- hadrian/src/Oracles/Flavour.hs
- hadrian/src/Oracles/TestSettings.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings/Builders/DeriveConstants.hs
- hadrian/src/Settings/Program.hs
Changes:
| ... | ... | @@ -28,6 +28,8 @@ oracles = do |
| 28 | 28 | void $ addOracle $ \(DynGhcPrograms stage) -> do
|
| 29 | 29 | cross <- crossStage stage
|
| 30 | 30 | from_flavour <- flip dynamicGhcPrograms stage =<< flavour
|
| 31 | + -- Have to build static if it's a cross stage as we won't distribute the
|
|
| 32 | + -- libraries built for the host.
|
|
| 31 | 33 | return (from_flavour && not cross)
|
| 32 | 34 | void $ addOracle $ \(GhcProfiled stage) ->
|
| 33 | 35 | ghcProfiled <$> flavour <*> pure (succStage stage)
|
| ... | ... | @@ -142,10 +142,9 @@ getTestCross testGhc = |
| 142 | 142 | Just stg -> crossStage stg
|
| 143 | 143 | Nothing -> getBooleanSetting TestCrossCompiling
|
| 144 | 144 | |
| 145 | - |
|
| 146 | --- Given the testGhc string, either a stage0..stage1..stage2 etc or a path to
|
|
| 147 | --- a compiler. Compute the absolute path to the relevant executable provided by
|
|
| 148 | --- the package in the second argument.
|
|
| 145 | +-- | Given the @testGhc@ `String` (either `stage1`, `stage2`, `stage3` or a
|
|
| 146 | +-- path to a compiler). Compute the absolute path to the relevant executable
|
|
| 147 | +-- provided by the package @pkg@ in the second argument.
|
|
| 149 | 148 | getTestExePath :: String -> Package -> Action FilePath
|
| 150 | 149 | getTestExePath testGhc pkg = do
|
| 151 | 150 | case stageOfTestCompiler testGhc of
|
| ... | ... | @@ -154,10 +153,8 @@ getTestExePath testGhc pkg = do |
| 154 | 153 | bindir <- getBinaryDirectory testGhc
|
| 155 | 154 | compiler_path <- getCompilerPath testGhc
|
| 156 | 155 | cross <- getBooleanSetting TestCrossCompiling
|
| 157 | - let cross_prefix = if cross then dropWhileEnd ((/=) '-') (takeFileName compiler_path) else ""
|
|
| 158 | - -- get relative path for the given program in the given stage
|
|
| 156 | + let cross_prefix = if cross then dropWhileEnd ('-' /=) (takeFileName compiler_path) else ""
|
|
| 159 | 157 | let make_absolute rel_path = do
|
| 160 | 158 | abs_path <- liftIO (makeAbsolute rel_path)
|
| 161 | 159 | fixAbsolutePathOnWindows abs_path
|
| 162 | 160 | make_absolute (bindir </> (cross_prefix ++ programBasename pkg) <.> exe) |
| 163 | - -- get relative path for the given program in the given stage |
| ... | ... | @@ -526,7 +526,6 @@ generateConfigHs = do |
| 526 | 526 | stage <- getStage
|
| 527 | 527 | let chooseSetting x y = case stage of { Stage0 {} -> x; _ -> y }
|
| 528 | 528 | let queryTarget f = f <$> expr (targetStage stage)
|
| 529 | - -- Not right for stage3
|
|
| 530 | 529 | buildPlatform <- chooseSetting (queryBuild targetPlatformTriple) (queryHost targetPlatformTriple)
|
| 531 | 530 | hostPlatform <- queryTarget targetPlatformTriple
|
| 532 | 531 | trackGenerateHs
|
| ... | ... | @@ -197,18 +197,16 @@ testRules = do |
| 197 | 197 | |
| 198 | 198 | testEnv :: Stage -> Action [(String, String)]
|
| 199 | 199 | testEnv stg = do
|
| 200 | - |
|
| 201 | 200 | testGhc <- testCompiler <$> userSetting defaultTestArgs
|
| 202 | - |
|
| 203 | 201 | cross <- getTestCross testGhc
|
| 204 | 202 | |
| 205 | - prog_ghc_pkg <- getTestExePath testGhc ghcPkg
|
|
| 206 | - prog_hsc2hs <- getTestExePath testGhc hsc2hs
|
|
| 207 | - prog_hp2ps <- getTestExePath testGhc hp2ps
|
|
| 208 | - prog_haddock <- getTestExePath testGhc haddock
|
|
| 209 | - prog_hpc <- getTestExePath testGhc hpc
|
|
| 210 | - prog_runghc <- getTestExePath testGhc runGhc
|
|
| 211 | 203 | makePath <- builderPath $ Make ""
|
| 204 | + prog_ghc_pkg <- getTestExePath testGhc ghcPkg
|
|
| 205 | + prog_hsc2hs <- getTestExePath testGhc hsc2hs
|
|
| 206 | + prog_hp2ps <- getTestExePath testGhc hp2ps
|
|
| 207 | + prog_haddock <- getTestExePath testGhc haddock
|
|
| 208 | + prog_hpc <- getTestExePath testGhc hpc
|
|
| 209 | + prog_runghc <- getTestExePath testGhc runGhc
|
|
| 212 | 210 | |
| 213 | 211 | root <- buildRoot
|
| 214 | 212 | args <- userSetting defaultTestArgs
|
| ... | ... | @@ -48,4 +48,4 @@ includeCcArgs = do |
| 48 | 48 | , arg "-Irts/include"
|
| 49 | 49 | , arg $ "-I" ++ rtsPath </> "include"
|
| 50 | 50 | , notM (targetSupportsSMP stage) ? arg "-DNOSMP"
|
| 51 | - , arg "-fcommon" ] |
|
| 51 | + ] |
| ... | ... | @@ -19,11 +19,10 @@ programContext :: Stage -> Package -> Action Context |
| 19 | 19 | programContext stage pkg = do
|
| 20 | 20 | profiled <- askGhcProfiled stage
|
| 21 | 21 | dynGhcProgs <- askDynGhcPrograms stage
|
| 22 | - -- Have to build static if it's a cross stage as we won't distribute the libraries built for the host.
|
|
| 23 | 22 | return $ Context stage pkg (wayFor profiled dynGhcProgs) Final
|
| 24 | 23 | |
| 25 | 24 | where wayFor prof dyn
|
| 26 | - | prof && dyn = profilingDynamic
|
|
| 25 | + | prof && dyn = profilingDynamic
|
|
| 27 | 26 | | pkg == ghc && prof && notStage0 stage = profiling
|
| 28 | 27 | | dyn && notStage0 stage = dynamic
|
| 29 | 28 | | otherwise = vanilla
|