diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-11-11 15:05:20 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-22 12:39:38 -0500 |
commit | d4d95e51a463e539fceb1c6f191e84adaa337e3b (patch) | |
tree | 691cf2ebf8cbc3d7bf84633fa9117afa8127cca0 /hadrian/src | |
parent | 179d0becd2ddfa216f7b221df9fc520a352fdbe7 (diff) | |
download | haskell-d4d95e51a463e539fceb1c6f191e84adaa337e3b.tar.gz |
hadrian: Add profiled_ghc and no_dynamic_ghc modifiers
Diffstat (limited to 'hadrian/src')
-rw-r--r-- | hadrian/src/Flavour.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index 6c68df21ff..a7a32ed634 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -9,6 +9,8 @@ module Flavour , enableThreadSanitizer , enableDebugInfo, enableTickyGhc , viaLlvmBackend + , enableProfiledGhc + , disableDynamicGhcPrograms ) where import Expression @@ -86,6 +88,8 @@ flavourTransformers = M.fromList , "split_sections" =: splitSections , "thread_sanitizer" =: enableThreadSanitizer , "llvm" =: viaLlvmBackend + , "profiled_ghc" =: enableProfiledGhc + , "no_dynamic_ghc" =: disableDynamicGhcPrograms ] where (=:) = (,) @@ -197,3 +201,13 @@ enableThreadSanitizer = addArgs $ mconcat -- | Use the LLVM backend in stages 1 and later. viaLlvmBackend :: Flavour -> Flavour viaLlvmBackend = addArgs $ notStage0 ? builder Ghc ? arg "-fllvm" + +-- | Build the GHC executable with profiling enabled. It is also recommended +-- 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 } + +-- | Disable 'dynamicGhcPrograms'. +disableDynamicGhcPrograms :: Flavour -> Flavour +disableDynamicGhcPrograms flavour = flavour { dynamicGhcPrograms = pure False } |