Duncan Coutts pushed to branch wip/dcoutts/windows-dlls-experimental at Glasgow Haskell Compiler / GHC
Commits:
-
276642f7
by Duncan Coutts at 2026-04-29T10:28:59+01:00
2 changed files:
Changes:
| ... | ... | @@ -13,6 +13,7 @@ module Packages ( |
| 13 | 13 | transformers, unlit, unix, win32, xhtml,
|
| 14 | 14 | lintersCommon, lintNotes, lintCodes, lintCommitMsg, lintSubmoduleRefs, lintWhitespace,
|
| 15 | 15 | ghcPackages, isGhcPackage,
|
| 16 | + ghcApiPackages, isGhcApiPackage,
|
|
| 16 | 17 | |
| 17 | 18 | -- * Package information
|
| 18 | 19 | crossPrefix, programName, nonHsMainPackage, programPath, timeoutPath,
|
| ... | ... | @@ -49,6 +50,16 @@ ghcPackages = |
| 49 | 50 | isGhcPackage :: Package -> Bool
|
| 50 | 51 | isGhcPackage = (`elem` ghcPackages)
|
| 51 | 52 | |
| 53 | +-- | This package list contains the ghc api package (called 'compiler' here),
|
|
| 54 | +-- and all the libraries (not programs) that depend on the ghc api package.
|
|
| 55 | +-- This is used to special-case things for the ghc api package and its deps.
|
|
| 56 | +--
|
|
| 57 | +ghcApiPackages :: [Package]
|
|
| 58 | +ghcApiPackages = [compiler, haddockApi]
|
|
| 59 | + |
|
| 60 | +isGhcApiPackage :: Package -> Bool
|
|
| 61 | +isGhcApiPackage = (`elem` ghcApiPackages)
|
|
| 62 | + |
|
| 52 | 63 | -- | Package definitions, see 'Package'.
|
| 53 | 64 | array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, countDeps,
|
| 54 | 65 | compareSizes, compiler, containers, deepseq, deriveConstants, directory, dumpDecls,
|
| ... | ... | @@ -226,6 +226,7 @@ defaultLibraryWays = do |
| 226 | 226 | [ pure [vanilla]
|
| 227 | 227 | , notStage0 ? pure [profiling]
|
| 228 | 228 | , notStage0 ? platformSupportsSharedLibs
|
| 229 | + ? onlyDynGhcLibIfSupported
|
|
| 229 | 230 | ? pure [dynamic, profilingDynamic]
|
| 230 | 231 | ]
|
| 231 | 232 | |
| ... | ... | @@ -233,6 +234,16 @@ defaultLibraryWays = do |
| 233 | 234 | else do stage <- getStage
|
| 234 | 235 | Set.singleton <$> expr (programWay stage pkg)
|
| 235 | 236 | |
| 237 | +-- | Only build the ghc library (and libs that depend on it) the dynamic way,
|
|
| 238 | +-- if the platform supports it.
|
|
| 239 | +--
|
|
| 240 | +onlyDynGhcLibIfSupported :: Predicate
|
|
| 241 | +onlyDynGhcLibIfSupported = do
|
|
| 242 | + pkg <- getPackage
|
|
| 243 | + if isGhcApiPackage pkg
|
|
| 244 | + then expr defaultDynamicGhcPrograms
|
|
| 245 | + else pure True
|
|
| 246 | + |
|
| 236 | 247 | -- | Default build ways for the RTS.
|
| 237 | 248 | defaultRtsWays :: Ways
|
| 238 | 249 | defaultRtsWays = Set.fromList <$>
|
| ... | ... | @@ -323,7 +334,7 @@ defaultDynamicGhcPrograms = do |
| 323 | 334 | supportsShared <- platformSupportsSharedLibs
|
| 324 | 335 | winTarget <- isWinTarget
|
| 325 | 336 | -- For now, don't build dynamic ghc on windows because we hit dll
|
| 326 | - -- symbol limits for the ghc library.
|
|
| 337 | + -- symbol limits for the ghc library. See issue #27162.
|
|
| 327 | 338 | return (supportsShared && not winTarget)
|
| 328 | 339 | |
| 329 | 340 | -- | All 'Builder'-dependent command line arguments.
|