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 Only build the ghc lib the dynamic way if supported It is not supported on Windows, yet. The problem is that we hit the 64k limit on the number of exported symbols for a single dll. We delegate to the defaultDynamicGhcPrograms predicate to decide if it is supported. - - - - - 2 changed files: - hadrian/src/Packages.hs - hadrian/src/Settings/Default.hs Changes: ===================================== hadrian/src/Packages.hs ===================================== @@ -13,6 +13,7 @@ module Packages ( transformers, unlit, unix, win32, xhtml, lintersCommon, lintNotes, lintCodes, lintCommitMsg, lintSubmoduleRefs, lintWhitespace, ghcPackages, isGhcPackage, + ghcApiPackages, isGhcApiPackage, -- * Package information crossPrefix, programName, nonHsMainPackage, programPath, timeoutPath, @@ -49,6 +50,16 @@ ghcPackages = isGhcPackage :: Package -> Bool isGhcPackage = (`elem` ghcPackages) +-- | This package list contains the ghc api package (called 'compiler' here), +-- and all the libraries (not programs) that depend on the ghc api package. +-- This is used to special-case things for the ghc api package and its deps. +-- +ghcApiPackages :: [Package] +ghcApiPackages = [compiler, haddockApi] + +isGhcApiPackage :: Package -> Bool +isGhcApiPackage = (`elem` ghcApiPackages) + -- | Package definitions, see 'Package'. array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, countDeps, compareSizes, compiler, containers, deepseq, deriveConstants, directory, dumpDecls, ===================================== hadrian/src/Settings/Default.hs ===================================== @@ -226,6 +226,7 @@ defaultLibraryWays = do [ pure [vanilla] , notStage0 ? pure [profiling] , notStage0 ? platformSupportsSharedLibs + ? onlyDynGhcLibIfSupported ? pure [dynamic, profilingDynamic] ] @@ -233,6 +234,16 @@ defaultLibraryWays = do else do stage <- getStage Set.singleton <$> expr (programWay stage pkg) +-- | Only build the ghc library (and libs that depend on it) the dynamic way, +-- if the platform supports it. +-- +onlyDynGhcLibIfSupported :: Predicate +onlyDynGhcLibIfSupported = do + pkg <- getPackage + if isGhcApiPackage pkg + then expr defaultDynamicGhcPrograms + else pure True + -- | Default build ways for the RTS. defaultRtsWays :: Ways defaultRtsWays = Set.fromList <$> @@ -323,7 +334,7 @@ defaultDynamicGhcPrograms = do supportsShared <- platformSupportsSharedLibs winTarget <- isWinTarget -- For now, don't build dynamic ghc on windows because we hit dll - -- symbol limits for the ghc library. + -- symbol limits for the ghc library. See issue #27162. return (supportsShared && not winTarget) -- | All 'Builder'-dependent command line arguments. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/276642f7382f269346d8a22e6c21e59e... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/276642f7382f269346d8a22e6c21e59e... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Duncan Coutts (@dcoutts)