From 951c3e2acb90e504d8b75a01167892178176a7c7 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 17 Nov 2011 11:59:10 +0000 Subject: [PATCH] GhcProfiled: don't automatically add -auto-all --- compiler/ghc.mk | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 4449a14307..d2a272ed7e 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -349,12 +349,21 @@ else compiler_CONFIGURE_OPTS += --ghc-option=-DNO_REGS endif -# If we're profiling GHC then we want lots of SCCs, so -auto-all -# We also don't want to waste time building the non-profiling library. -# Unfortunately this means that we have to tell ghc-pkg --force as it -# gets upset when libHSghc-6.9.a doesn't exist. ifeq "$(GhcProfiled)" "YES" -compiler_stage2_CONFIGURE_OPTS += --ghc-option=-auto-all + +# If we're profiling GHC then we want SCCs. However, adding -auto-all +# everywhere tends to give a hard-to-read profile, and adds lots of +# overhead. A better approach is to proceed top-down; identify the +# parts of the compiler of interest, and then add further cost centres +# as necessary. Turn on -auto-all for individual modules like this: + +compiler/main/DriverPipeline_HC_OPTS += -auto-all +compiler/main/GhcMake_HC_OPTS += -auto-all +compiler/main/GHC_HC_OPTS += -auto-all + +# or alternatively addd {-# OPTIONS_GHC -auto-all #-} to the top of +# modules you're interested in. + # We seem to still build the vanilla libraries even if we say # --disable-library-vanilla, but installation then fails, as Cabal # doesn't copy the vanilla .hi files, but ghc-pkg complains about -- GitLab