summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorJames Foster <ratherforky@gmail.com>2019-07-13 01:23:30 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-13 16:37:34 -0400
commit232002c44942491759e44aa93a03a6bc68afbadf (patch)
tree8c1c115cff39f42c687fafcd14b25a4903d405d8 /hadrian
parent348cc8ebf1508b057a85551e5f6e699bb4cd8ade (diff)
downloadhaskell-232002c44942491759e44aa93a03a6bc68afbadf.tar.gz
Make HsInstances and DynFlags compile with -O0 for Stage0 to speed up Hadrian builds (fixes #16936)
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Settings/Packages.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index 4c5407186c..e120e7993c 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -50,7 +50,12 @@ packageArgs = do
, builder (Ghc CompileHs) ? mconcat
[ inputs ["//GHC.hs", "//GhcMake.hs"] ? arg "-fprof-auto"
, input "//Parser.hs" ?
- pure ["-fno-ignore-interface-pragmas", "-fcmm-sink" ] ]
+ pure ["-fno-ignore-interface-pragmas", "-fcmm-sink"]
+ -- These files take a very long time to compile with -O1,
+ -- so we use -O0 for them just in Stage0 to speed up the
+ -- build but not affect Stage1+ executables
+ , inputs ["//HsInstances.hs", "//DynFlags.hs"] ? stage0 ?
+ pure ["-O0"] ]
, builder (Cabal Setup) ? mconcat
[ arg $ "--ghc-option=-DSTAGE=" ++ show (fromEnum stage + 1)
@@ -71,7 +76,7 @@ packageArgs = do
, ghcProfiled <$> flavour ?
notStage0 ? arg "--ghc-pkg-option=--force" ]
- , builder (Cabal Flags) ? mconcat
+ , builder (Cabal Flags) ? mconcat
[ ghcWithNativeCodeGen ? arg "ncg"
, ghcWithInterpreter ? notStage0 ? arg "ghci"
, notStage0 ? not windowsHost ? notM cross ? arg "ext-interp"
@@ -172,7 +177,7 @@ packageArgs = do
-- in Stage1, and at that point the configuration is just wrong.
, package text ?
builder (Cabal Flags) ? notStage0 ? intLib == integerSimple ?
- pure [ "+integer-simple", "-bytestring-builder"] ]
+ pure ["+integer-simple", "-bytestring-builder"] ]
-- | RTS-specific command line arguments.
rtsPackageArgs :: Args