[commit: ghc] master: Enable split sections by default where possible (8f71d95)

git at git.haskell.org git at git.haskell.org
Sat Dec 17 01:58:13 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8f71d9581ee0a1826c0105e51a7048f0c7669492/ghc

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

commit 8f71d9581ee0a1826c0105e51a7048f0c7669492
Author: Simon Brenner <olsner at gmail.com>
Date:   Fri Dec 16 12:16:05 2016 -0500

    Enable split sections by default where possible
    
    On non-windows platforms with GNU ld, enable SplitSections in the GHC
    build by default.
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: DemiMarie, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1800
    
    GHC Trac Issues: #11445


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

8f71d9581ee0a1826c0105e51a7048f0c7669492
 mk/config.mk.in | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/mk/config.mk.in b/mk/config.mk.in
index 06c12bf..5141ccf 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -339,8 +339,12 @@ SupportsSplitObjs := $(strip \
                                $(filter NO,$(GhcUnregisterised))),\
                           YES,NO))
 
-# By default, enable SplitObjs for the libraries if this build supports it
-SplitObjs=$(SupportsSplitObjs)
+# By default, enable SplitObjs for the libraries if this build supports it.
+# Unless SplitSections is enabled - then let that take precedence.
+SplitObjs = $(strip \
+    $(if $(and $(filter YES,$(SupportsSplitObjs)),\
+               $(filter NO,$(SplitSections))),\
+         YES,NO))
 
 # ----------------------------------------------------------------------------
 # Section splitting
@@ -349,9 +353,16 @@ SplitObjs=$(SupportsSplitObjs)
 # like SplitObjs, but doesn't require post-processing and splitting of object
 # files.
 #
-# Set SplitSections=YES in your build.mk to enable.
-
-SplitSections=NO
+# Set SplitSections=YES or NO in your build.mk to override the default.
+#
+# This is not supported on Darwin (where you can use subsections-via-symbols
+# instead) and Windows is not yet working. (See #11445 and related tickets.)
+OsSupportsSplitSections=$(strip $(if $(filter $(TargetOS_CPP),mingw32 darwin),NO,YES))
+SupportsSplitSections = $(strip \
+                    $(if $(and $(filter YES,$(OsSupportsSplitSections)),\
+                               $(filter YES,$(LdIsGNULd))),\
+                          YES,NO))
+SplitSections ?= $(SupportsSplitSections)
 
 # ----------------------------------------------------------------------------
 



More information about the ghc-commits mailing list