Commit 432a1f18 authored by Sergei Trofimovich's avatar Sergei Trofimovich

mk/config.mk.in: lower -O2 optimization down to -O1 on UNREG

It's not a new behaviour. First it was introduced by
2d5372cf
("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
14d0f7f1
("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: default avatarSergei Trofimovich <slyfox@gentoo.org>
parent 1fd06de4
......@@ -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'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment