summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2017-05-23 09:36:50 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2017-05-23 09:36:50 +0100
commit432a1f18327a50d7b2bbdbe6b004473fe1b0b0b9 (patch)
tree722cbc2b11b36c083310fe3b6bdd1c850f6aed11 /mk
parent1fd06de4e98d1b659500ecd66d88d6d80fcc60d3 (diff)
downloadhaskell-432a1f18327a50d7b2bbdbe6b004473fe1b0b0b9.tar.gz
mk/config.mk.in: lower -O2 optimization down to -O1 on UNREG
It's not a new behaviour. First it was introduced by 2d5372cfdc2236a77ec49df249f3379b93224e06 ("lower -O2 optimization down to -O1 on UNREG") to fix build failure on unregisterised powerpc64. This time I've noticed build failures on unregisterised ia64. The change was accidentally reverted by commit 14d0f7f1221db758cd06a69f53803d9d0150164a ("Build system: Add stage specific SRC_HC_(WARNING_)OPTS) The revert happened due to the following code rearrangement: ifeq "$(GhcUnregisterised)" "YES" GhcStage1HcOpts= GhcStage2HcOpts= GhcStage3HcOpts= endif GhcUnregisterised=@Unregisterised@ As a result 'ifeq' part has no effect. The change moves 'ifeq' down to the very end of file and adds a note it depends on the 'GhcUnregisterised' variable. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/config.mk.in26
1 files changed, 17 insertions, 9 deletions
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 8901137f00..b2a9569d39 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -70,15 +70,6 @@ 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.hs')
-# and sometimes not compile at all (powerpc64 overflows something
-# on 'compiler/hsSyn/HsExpr.hs').
-ifeq "$(GhcUnregisterised)" "YES"
-GhcStage1HcOpts=
-GhcStage2HcOpts=
-GhcStage3HcOpts=
-endif
# Note [Stage number in build variables].
#
@@ -901,3 +892,20 @@ GMP_LIB_DIRS = @GMP_LIB_DIRS@
CURSES_INCLUDE_DIRS = @CURSES_INCLUDE_DIRS@
CURSES_LIB_DIRS = @CURSES_LIB_DIRS@
+
+# See Note [Disable -O2 in unregisteride mode]
+# Be careful: 'GhcUnregisterised' should be defined earlier in this file.
+ifeq "$(GhcUnregisterised)" "YES"
+GhcStage1HcOpts=
+GhcStage2HcOpts=
+GhcStage3HcOpts=
+
+GhcLibHcOpts=
+endif
+
+# Note [Disable -O2 in unregisteride mode]
+# Disable -O2 optimization in uregisterised more. Otherwise amount
+# of generated C code # makes things very slow to compile (~5 minutes
+# on core-i7 for 'compiler/hsSyn/HsExpr.hs') and sometimes not compile
+# at all: powerpc64 overflows TOC section on 'compiler/hsSyn/HsExpr.hs'
+# ia64 overflows short data section on 'compiler/main/DynFlags.hs'