diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index 4c5407186c34dc180e8966193f5e58f135ca53df..e120e7993c5a8c4ebe2e219faad72bd2f5254606 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