Commit 1825f50d authored by Alp Mestanogullari's avatar Alp Mestanogullari Committed by Marge Bot

Hadrian: don't accept p_dyn for executables, to fix --flavour=prof

parent c54a093f
......@@ -60,10 +60,14 @@ programContext :: Stage -> Package -> Action Context
programContext stage pkg = do
profiled <- ghcProfiled <$> flavour
dynGhcProgs <- dynamicGhcPrograms =<< flavour
return . Context stage pkg . wayFromUnits . concat $
[ [ Profiling | pkg == ghc && profiled && stage > Stage0 ]
, [ Dynamic | dynGhcProgs && stage > Stage0 ]
]
return $ Context stage pkg (wayFor profiled dynGhcProgs)
where wayFor prof dyn
| prof && dyn =
error "programContext: profiling+dynamic not supported"
| pkg == ghc && prof && stage > Stage0 = profiling
| dyn && stage > Stage0 = dynamic
| otherwise = vanilla
-- TODO: switch to Set Package as the order of packages should not matter?
-- Otherwise we have to keep remembering to sort packages from time to time.
......
......@@ -10,7 +10,8 @@ profiledFlavour :: Flavour
profiledFlavour = defaultFlavour
{ name = "prof"
, args = defaultBuilderArgs <> profiledArgs <> defaultPackageArgs
, ghcProfiled = True }
, ghcProfiled = True
, dynamicGhcPrograms = pure False }
profiledArgs :: Args
profiledArgs = sourceArgs SourceArgs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment