Selectively reduce optimisation level in GHC build
Currently there are a few places in the GHC build where we do signficantly more time than is necessary or warranted, especially during development:
-
the stage0
ghc-cabal
is built with$SRC_HC_OPTS
, which contains-O
in most build flavours. This means that we end up spending a significant amount of time compiling an optimizedCabal
, despite the fact that stage0ghc-cabal
is hardly a performance critical executable. -
stage2
Cabal
is built withHsLibHcOpts
, which contains-O
in most build flavours. Not only isCabal
typically not going to be performance critical for users, but the object size from an unoptimised build is significantly smaller than that from an optimised build.