diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2019-01-22 11:33:18 +0000 |
---|---|---|
committer | Ben Gamari <ben@well-typed.com> | 2019-01-23 14:07:28 -0500 |
commit | cfe64019a70acc1bae76f2fa580d6654f8eb5bc4 (patch) | |
tree | ec72edd1b0e18b9a48cf638294adb7b42c042e7b /hadrian/src/Rules | |
parent | 395c8eaaf88608aad7cf255402d60eb12a33d11c (diff) | |
download | haskell-cfe64019a70acc1bae76f2fa580d6654f8eb5bc4.tar.gz |
Fix hadrian prof flavour so that it builds a profiled version of GHC
In Alp's refactoring of `getProgramContexts` he removed a call to
`getProgramContext` which was where the logic for this used to be
implemented.
Fixes #16214
Diffstat (limited to 'hadrian/src/Rules')
-rw-r--r-- | hadrian/src/Rules/Program.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/hadrian/src/Rules/Program.hs b/hadrian/src/Rules/Program.hs index c9df6f5e2d..d7bcb48712 100644 --- a/hadrian/src/Rules/Program.hs +++ b/hadrian/src/Rules/Program.hs @@ -13,6 +13,7 @@ import Settings import Settings.Default import Target import Utilities +import Flavour -- | TODO: Drop code duplication buildProgramRules :: [(Resource, Int)] -> Rules () @@ -44,12 +45,18 @@ getProgramContexts stage = do -- make sure that we cover these -- "prof-build-under-other-name" cases. -- iserv gets its names from Packages.hs:programName - let allCtxs = [ vanillaContext stage pkg + -- + profiled <- ghcProfiled <$> flavour + let allCtxs = + if pkg == ghc && profiled && stage > Stage0 + then [ Context stage pkg profiling ] + else [ vanillaContext stage pkg , Context stage pkg profiling -- TODO Dynamic way has been reverted as the dynamic build is -- broken. See #15837. -- , Context stage pkg dynamic - ] + ] + forM allCtxs $ \ctx -> do name <- programName ctx return (name <.> exe, ctx) |