From e81f2e4e466cfefca9cae425a148030711a5b15f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 16 Feb 2021 11:51:37 -0500 Subject: hadrian: Fix profiled flavour transformer Previously the profiled flavour transformer failed to add the profiled ways to the library and RTS ways lists, resulting in link failures. --- hadrian/src/Flavour.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'hadrian') diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index 3f2b30352e..e07c2e9078 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -208,7 +208,15 @@ viaLlvmBackend = addArgs $ notStage0 ? builder Ghc ? arg "-fllvm" -- that you use this with @'dynamicGhcPrograms' = False@ since GHC does not -- support loading of profiled libraries with the dynamically-linker. enableProfiledGhc :: Flavour -> Flavour -enableProfiledGhc flavour = flavour { ghcProfiled = True } +enableProfiledGhc flavour = + flavour { rtsWays = addWays [profiling, threadedProfiling, debugProfiling, threadedDebugProfiling] (rtsWays flavour) + , libraryWays = addWays [profiling] (libraryWays flavour) + , ghcProfiled = True + } + where + addWays :: [Way] -> Ways -> Ways + addWays ways = + fmap (++ ways) -- | Disable 'dynamicGhcPrograms'. disableDynamicGhcPrograms :: Flavour -> Flavour -- cgit v1.2.1