mk/config.mk.in: lower -O2 optimization down to -O1 on UNREG
authorSergei Trofimovich <slyfox@gentoo.org>
Thu, 13 Feb 2014 13:29:50 +0000 (07:29 -0600)
committerAustin Seipp <austin@well-typed.com>
Mon, 17 Feb 2014 07:46:03 +0000 (01:46 -0600)
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').

Issue #8748

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Austin Seipp <austin@well-typed.com>
mk/config.mk.in

index b3d6995..6207cce 100644 (file)
@@ -422,6 +422,16 @@ BIN_DIST_TAR_BZ2      = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2
 #
 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
+
 # -----------------------------------------------------------------------------
 # Names of programs in the GHC tree