[commit: ghc] master: Fix Windows builds after D1242 (7f77e4e)

git at git.haskell.org git at git.haskell.org
Sat Nov 21 12:43:12 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7f77e4e9b301493db0782cf2d129cf62dbcd5af6/ghc

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

commit 7f77e4e9b301493db0782cf2d129cf62dbcd5af6
Author: Tamar Christina <tamar at zhox.com>
Date:   Sat Nov 21 13:33:09 2015 +0100

    Fix Windows builds after D1242
    
    Summary:
    Only use the merge_sections.ld linker script if SplitSections is enabled.
    
    I thought I had a way to make the linker script actually work on Windows
    and produce object files instead of image files (by using the "INSERT AFTER"
    linker script command to get the default script's output format setting),
    but that fix caused ghci to crash with an illegal instruction on startup.
    
    Gave up and made a simpler fix of just disabling this for normal builds,
    as it's only really relevant with SplitSections enabled anyway.
    
    Reviewers: austin, thomie, bgamari
    
    Reviewed By: austin, thomie
    
    Subscribers: Phyx, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1505
    
    GHC Trac Issues: #8405


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

7f77e4e9b301493db0782cf2d129cf62dbcd5af6
 rules/build-package-way.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index d048f74..905b7f0 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -136,7 +136,11 @@ BINDIST_LIBS += $$($1_$2_$3_LIB)
 BINDIST_LIBS += $$($1_$2_$3_LIB0)
 endif
 
+ifeq "$$($1_$2_SplitSections)" "YES"
+ifeq "$(LdIsGNULd)" "YES"
 $1_$2_LD_SCRIPT = driver/utils/merge_sections.ld
+endif
+endif
 
 # Build the GHCi library
 ifeq "$$(DYNAMIC_GHC_PROGRAMS)" "YES"
@@ -151,7 +155,7 @@ BINDIST_LIBS += $$($1_$2_GHCI_LIB)
 endif
 endif
 $$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) $$($1_$2_LD_SCRIPT)
-	$$(call cmd,LD) $$(CONF_LD_LINKER_OPTS_STAGE$4) -r $(if $(filter YES,$(LdIsGNULd)),-T $$($1_$2_LD_SCRIPT)) -o $$@ $$(EXTRA_LD_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS)
+	$$(call cmd,LD) $$(CONF_LD_LINKER_OPTS_STAGE$4) -r $$(if $$($1_$2_LD_SCRIPT),-T $$($1_$2_LD_SCRIPT)) -o $$@ $$(EXTRA_LD_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS)
 
 ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES"
 # Don't bother making ghci libs for bootstrapping packages



More information about the ghc-commits mailing list