diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-12-01 11:50:44 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-10-24 20:59:39 -0400 |
commit | ccf2d4b091284a60acc6c16d166ea7cafade209f (patch) | |
tree | 20af66bb3ffb2e05c3e3960473b6c4da015b1241 /hadrian/src/Flavour.hs | |
parent | b9d4dd9cbc4f1dd40e6beaf5d8301ac9d3034fca (diff) | |
download | haskell-ccf2d4b091284a60acc6c16d166ea7cafade209f.tar.gz |
rts: Infrastructure for testing with ThreadSanitizer
Diffstat (limited to 'hadrian/src/Flavour.hs')
-rw-r--r-- | hadrian/src/Flavour.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index 56488f0b0a..0a4439827f 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -4,6 +4,7 @@ module Flavour -- * Flavour transformers , addArgs , splitSections, splitSectionsIf + , enableThreadSanitizer , enableDebugInfo, enableTickyGhc ) where @@ -115,3 +116,12 @@ splitSections :: Flavour -> Flavour splitSections = splitSectionsIf (/=ghc) -- Disable section splitting for the GHC library. It takes too long and -- there is little benefit. + +enableThreadSanitizer :: Flavour -> Flavour +enableThreadSanitizer = addArgs $ mconcat + [ builder (Ghc CompileHs) ? arg "-optc-fsanitize=thread" + , builder (Ghc CompileCWithGhc) ? (arg "-optc-fsanitize=thread" <> arg "-DTSAN_ENABLED") + , builder (Ghc LinkHs) ? arg "-optl-fsanitize=thread" + , builder (Cc CompileC) ? (arg "-fsanitize=thread" <> arg "-DTSAN_ENABLED") + , builder (Cabal Flags) ? arg "thread-sanitizer" + ] |