diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-07-26 16:49:36 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-08 05:11:03 -0400 |
commit | 9a2798e139e3d20183b59bb5a66012db495c66c7 (patch) | |
tree | d8a73d82f2bed67d3fdb5bb8bea26fe827a160af | |
parent | 77ca39e305fe794f6e53d98254e342ad10b86cea (diff) | |
download | haskell-9a2798e139e3d20183b59bb5a66012db495c66c7.tar.gz |
hadrian: Add `validate` and `slow validate` flavours
-rw-r--r-- | hadrian/doc/flavours.md | 22 | ||||
-rw-r--r-- | hadrian/hadrian.cabal | 1 | ||||
-rwxr-xr-x | hadrian/src/Settings.hs | 3 | ||||
-rw-r--r-- | hadrian/src/Settings/Flavours/Validate.hs | 46 |
4 files changed, 71 insertions, 1 deletions
diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md index 689c3f1742..26d5115e61 100644 --- a/hadrian/doc/flavours.md +++ b/hadrian/doc/flavours.md @@ -120,6 +120,28 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH <td></td> <td>-O0<br>-DDEBUG</td> </tr> + <tr> + <th>validate</td> + <td>-O0<br>-H64m</td> + <td>-fllvm-fill-undef-with-garbage</td> + <td></td> + <td>-O<br>-dcore-lint<br>-dno-debug-output</td> + <td>-O2<br>-DDEBUG</td> + <td>-O<br>-dcore-lint<br>-dno-debug-output</td> + <td>-O</td> + <td>-O</td> + </tr> + <tr> + <th>validate</td> + <td>-O0<br>-H64m</td> + <td>-fllvm-fill-undef-with-garbage</td> + <td></td> + <td>-O<br>-dcore-lint<br>-dno-debug-output</td> + <td>-O2<br>-DDEBUG</td> + <td>-O<br>-DDEBUG<br>-dcore-lint<br>-dno-debug-output</td> + <td>-O</td> + <td>-O</td> + </tr> </table> ### LLVM variants diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal index ce44a18095..818114a4d4 100644 --- a/hadrian/hadrian.cabal +++ b/hadrian/hadrian.cabal @@ -101,6 +101,7 @@ executable hadrian , Settings.Flavours.QuickCross , Settings.Flavours.Quickest , Settings.Flavours.GhcInGhci + , Settings.Flavours.Validate , Settings.Packages , Settings.Parser , Settings.Program diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs index ba0cff770a..2263f68107 100755 --- a/hadrian/src/Settings.hs +++ b/hadrian/src/Settings.hs @@ -21,6 +21,7 @@ import Settings.Flavours.Quick import Settings.Flavours.Quickest import Settings.Flavours.QuickCross import Settings.Flavours.GhcInGhci +import Settings.Flavours.Validate import Control.Monad.Except import Data.Either @@ -45,7 +46,7 @@ hadrianFlavours = , developmentFlavour Stage2, performanceFlavour, profiledFlavour , quickFlavour, quickestFlavour, quickCrossFlavour, benchmarkLlvmFlavour , performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour - , ghcInGhciFlavour ] + , ghcInGhciFlavour, validateFlavour, slowValidateFlavour ] -- | This action looks up a flavour with the name given on the -- command line with @--flavour@, defaulting to 'userDefaultFlavour' diff --git a/hadrian/src/Settings/Flavours/Validate.hs b/hadrian/src/Settings/Flavours/Validate.hs new file mode 100644 index 0000000000..f49f5112de --- /dev/null +++ b/hadrian/src/Settings/Flavours/Validate.hs @@ -0,0 +1,46 @@ +module Settings.Flavours.Validate (validateFlavour, slowValidateFlavour) where + +import Expression +import Flavour +import Oracles.Flag +import {-# SOURCE #-} Settings.Default + +-- Please update doc/flavours.md when changing this file. +validateFlavour :: Flavour +validateFlavour = werror $ defaultFlavour + { name = "validate" + , args = defaultBuilderArgs <> validateArgs <> defaultPackageArgs + , libraryWays = mconcat [ pure [vanilla] + , notStage0 ? platformSupportsSharedLibs ? pure [dynamic] + ] + , rtsWays = mconcat [ pure [vanilla, threaded, debug, logging, threadedDebug, threadedLogging] + , notStage0 ? platformSupportsSharedLibs ? pure + [ dynamic, threadedDynamic, debugDynamic, threadedDebugDynamic + , loggingDynamic, threadedLoggingDynamic + ] + ] + } + +validateArgs :: Args +validateArgs = sourceArgs SourceArgs + { hsDefault = mconcat [ stage0 ? pure ["-O0", "-H64m"] + -- See #11487 + , notStage0 ? arg "-fllvm-fill-undef-with-garbage" + ] + , hsLibrary = pure ["-O", "-dcore-lint", "-dno-debug-output"] + , hsCompiler = mconcat [ stage0 ? pure ["-O2", "-DDEBUG"] + , notStage0 ? pure ["-O", "-dcore-lint", "-dno-debug-output"] + ] + , hsGhc = pure ["-O"] } + +slowValidateFlavour :: Flavour +slowValidateFlavour = werror $ validateFlavour + { name = "slow-validate" + , args = defaultBuilderArgs <> slowValidateArgs <> defaultPackageArgs + } + +slowValidateArgs :: Args +slowValidateArgs = + mconcat [ validateArgs + , notStage0 ? arg "-DDEBUG" + ] |