summaryrefslogtreecommitdiff
path: root/mk/config.mk.in
diff options
context:
space:
mode:
Diffstat (limited to 'mk/config.mk.in')
-rw-r--r--mk/config.mk.in49
1 files changed, 40 insertions, 9 deletions
diff --git a/mk/config.mk.in b/mk/config.mk.in
index f9394429bf..967c7510a1 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -64,10 +64,36 @@ GhcHcOpts=-Rghc-timing
# Extra options added to specific stages of the compiler bootstrap.
# These are placed later on the command line, and may therefore
# override options from $(GhcHcOpts).
+#
+# See Note [Stage number in build variables].
GhcStage1HcOpts=
GhcStage2HcOpts=-O2
GhcStage3HcOpts=-O2
+# Disable -O2 optimization. Otherwise amount of generated C code
+# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.lhs')
+# and sometimes not compile at all (powerpc64 overflows something
+# on 'compiler/hsSyn/HsExpr.lhs').
+ifeq "$(GhcUnregisterised)" "YES"
+GhcStage1HcOpts=
+GhcStage2HcOpts=
+GhcStage3HcOpts=
+endif
+
+# Note [Stage number in build variables].
+#
+# There are (unfortunately) two different naming schemes for build variables
+# specific to a certain stage.
+#
+# * GhcStage1HcOpts/GhcStage2HcOpts/GhcStage3HcOpts:
+#
+# The stage number refers to the compiler stage being built (ghc library
+# and executable).
+#
+# * SRC_HC_OPTS_STAGE$4 and SRC_HC_WARNING_OPTS_STAGE$4:
+#
+# The stage number refers to the compiler stage the options are passed to.
+
GhcDebugged=NO
GhcDynamic=NO
@@ -408,15 +434,20 @@ BIN_DIST_TAR_COMP = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.$(TAR_COMP_EXT)
#
SRC_HC_OPTS += -H32m -O
-# Disable -O2 optimization. Otherwise amount of generated C code
-# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.lhs')
-# and sometimes not compile at all (powerpc64 overflows something
-# on 'compiler/hsSyn/HsExpr.lhs').
-ifeq "$(GhcUnregisterised)" "YES"
-GhcStage1HcOpts=
-GhcStage2HcOpts=
-GhcStage3HcOpts=
-endif
+
+# See Note [Stage number in build variables].
+SRC_HC_OPTS_STAGE0 =
+SRC_HC_OPTS_STAGE1 =
+SRC_HC_OPTS_STAGE2 =
+
+# Warning supression flags. See mk/warnings.mk.
+SRC_CC_WARNING_OPTS =
+SRC_HC_WARNING_OPTS =
+
+# See Note [Stage number in build variables].
+SRC_HC_WARNING_OPTS_STAGE0 =
+SRC_HC_WARNING_OPTS_STAGE1 =
+SRC_HC_WARNING_OPTS_STAGE2 =
# -----------------------------------------------------------------------------
# Names of programs in the GHC tree