Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FIXED at Glasgow Haskell Compiler / GHC
Commits:
-
aa97891e
by Sven Tennie at 2025-11-30T12:42:13+01:00
1 changed file:
Changes:
| ... | ... | @@ -11,7 +11,7 @@ import Oracles.Setting |
| 11 | 11 | import Hadrian.BuildPath
|
| 12 | 12 | import Hadrian.Expression
|
| 13 | 13 | import Hadrian.Haskell.Cabal
|
| 14 | -import Oracles.Flag (targetSupportsGhciObjects)
|
|
| 14 | +import Oracles.Flag (targetSupportsGhciObjects, Flag (..))
|
|
| 15 | 15 | import Packages
|
| 16 | 16 | import Rules.Rts
|
| 17 | 17 | import Settings
|
| ... | ... | @@ -34,6 +34,7 @@ import qualified Distribution.Compat.CharParsing as CabalCharParsing |
| 34 | 34 | |
| 35 | 35 | import qualified Hadrian.Haskell.Cabal.Parse as Cabal
|
| 36 | 36 | import qualified System.Directory as IO
|
| 37 | +import Settings.Builders.Common (flag)
|
|
| 37 | 38 | |
| 38 | 39 | -- * Configuring
|
| 39 | 40 | |
| ... | ... | @@ -118,7 +119,11 @@ registerPackageRules rs stage iplace = do |
| 118 | 119 | pkgName <- getPackageNameFromConfFile conf
|
| 119 | 120 | let pkg = unsafeFindPackageByName pkgName
|
| 120 | 121 | |
| 121 | - when (pkg == compiler) $ need =<< ghcLibDeps stage iplace
|
|
| 122 | + -- Cross-compilers have only libraries in their 2nd stage. So, we don't
|
|
| 123 | + -- need config files for binaries there.
|
|
| 124 | + cross <- flag CrossCompiling
|
|
| 125 | + when (pkg == compiler && (not cross || stage <= Stage1)) $ do
|
|
| 126 | + need =<< ghcLibDeps stage iplace
|
|
| 122 | 127 | |
| 123 | 128 | -- Only used in guard when Stage0 {} but can be GlobalLibs or InTreeLibs
|
| 124 | 129 | isBoot <- (pkg `notElem`) <$> stagePackages stage
|