diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-01-15 14:57:08 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-08 10:19:57 -0500 |
commit | bec76733b818b0489ffea0834ab6b1560207577c (patch) | |
tree | 556569d2f5144dbfa2c6994c83f733e9c2f17d80 /hadrian/src | |
parent | 88bf81aaaf67e9c9bb5b12088ab33accd4a55fb3 (diff) | |
download | haskell-bec76733b818b0489ffea0834ab6b1560207577c.tar.gz |
Fix GhcThreaded setting
This adopts a patch from NetBSD's packaging fixing the `GhcThreaded`
option of the make build system. In addition we introduce a `ghcThreaded`
option in hadrian's `Flavour` type.
Also fix Hadrian's treatment of the `Use Threaded` entry in `settings`.
Previously it would incorrectly claim `Use Threaded = True` if we were
building the `threaded` runtime way. However, this is inconsistent with
the `make` build system, which defines it to be whether the `ghc`
executable is linked against the threaded runtime.
Fixes #17692.
Diffstat (limited to 'hadrian/src')
-rw-r--r-- | hadrian/src/Flavour.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Default.hs | 1 | ||||
-rw-r--r-- | hadrian/src/Settings/Packages.hs | 4 |
4 files changed, 7 insertions, 2 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index dd203ea88e..64ce931e78 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -39,6 +39,8 @@ data Flavour = Flavour { ghcProfiled :: Bool, -- | Build GHC with debugging assertions. ghcDebugged :: Bool, + -- | Build the GHC executable against the threaded runtime system. + ghcThreaded :: Bool, -- | Whether to build docs and which ones -- (haddocks, user manual, haddock manual) ghcDocs :: Action DocTargets } diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index 74759be20e..c65d852931 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -320,7 +320,7 @@ generateSettings = do , ("Tables next to code", expr $ yesNo <$> flag TablesNextToCode) , ("Leading underscore", expr $ yesNo <$> flag LeadingUnderscore) , ("Use LibFFI", expr $ yesNo <$> useLibFFIForAdjustors) - , ("Use Threads", yesNo . any (wayUnit Threaded) <$> getRtsWays) + , ("Use Threads", expr $ yesNo . ghcThreaded <$> flavour) , ("Use Debugging", expr $ yesNo . ghcDebugged <$> flavour) , ("RTS expects libdw", yesNo <$> getFlag WithLibdw) ] diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs index 7279023e82..5bf9ea7e7c 100644 --- a/hadrian/src/Settings/Default.hs +++ b/hadrian/src/Settings/Default.hs @@ -215,6 +215,7 @@ defaultFlavour = Flavour , ghciWithDebugger = False , ghcProfiled = False , ghcDebugged = False + , ghcThreaded = True , ghcDocs = cmdDocsArgs } -- | Default logic for determining whether to build diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index 9e43459a0f..d0dbabde99 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -96,7 +96,9 @@ packageArgs = do -- the 'threaded' flag is True by default, but -- let's record explicitly that we link all ghc -- executables with the threaded runtime. - , arg "threaded" ] ] + , stage0 ? arg "-threaded" + , notStage0 ? ifM (ghcThreaded <$> expr flavour) (arg "threaded") (arg "-threaded") ] + ] -------------------------------- ghcPkg -------------------------------- , package ghcPkg ? |