[commit: ghc] master: mk/config.mk.in: lower -O2 optimization down to -O1 on UNREG (432a1f1)

git at git.haskell.org git at git.haskell.org
Tue May 23 09:31:40 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/432a1f18327a50d7b2bbdbe6b004473fe1b0b0b9/ghc

>---------------------------------------------------------------

commit 432a1f18327a50d7b2bbdbe6b004473fe1b0b0b9
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Tue May 23 09:36:50 2017 +0100

    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 at gentoo.org>


>---------------------------------------------------------------

432a1f18327a50d7b2bbdbe6b004473fe1b0b0b9
 mk/config.mk.in | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/mk/config.mk.in b/mk/config.mk.in
index 8901137..b2a9569 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'



More information about the ghc-commits mailing list