[commit: ghc] wip/rwbarton-split-sections: Set $1_$2_SplitSections in distdir-opts.mk not build-package.mk (ac85c29)

git at git.haskell.org git at git.haskell.org
Tue Feb 14 16:39:31 UTC 2017


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

On branch  : wip/rwbarton-split-sections
Link       : http://ghc.haskell.org/trac/ghc/changeset/ac85c29f8e41ea8ec2a6bdd15736902f700715f6/ghc

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

commit ac85c29f8e41ea8ec2a6bdd15736902f700715f6
Author: Reid Barton <rwbarton at gmail.com>
Date:   Tue Feb 14 11:30:08 2017 -0500

    Set $1_$2_SplitSections in distdir-opts.mk not build-package.mk
    
    After commit a50082c11 we use -ffunction-sections -fdata-sections
    for all C compilations, when $1_$2_SplitSections is set. But that
    variable was set in build-package.mk which is not run for the RTS.
    As a result the RTS was not being split, leading to larger binaries.
    
    This commit fixes RTS splitting by moving the definition of
    $1_$2_SplitSections to distdir-opts.mk, which is run for the RTS
    (and also from build-package.mk).


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

ac85c29f8e41ea8ec2a6bdd15736902f700715f6
 rules/build-package.mk | 18 ------------------
 rules/distdir-opts.mk  | 20 +++++++++++++++++++-
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/rules/build-package.mk b/rules/build-package.mk
index 9599c57..fb04f02 100644
--- a/rules/build-package.mk
+++ b/rules/build-package.mk
@@ -102,24 +102,6 @@ endif
 $1_$2_PKGDATA_DEP = $1/$2/package-data.mk
 endif
 
-# We don't bother splitting the bootstrap packages (built with stage 0)
-ifeq "$$($1_$2_SplitObjs)" ""
-ifeq "$$(SplitObjs) $3" "YES 1"
-$1_$2_SplitObjs = YES
-else
-$1_$2_SplitObjs = NO
-endif
-endif
-# Disable split sections when building with stage0, it won't be supported yet
-# and it's probably not very relevant anyway (smaller stage1 ghc?).
-ifeq "$$($1_$2_SplitSections)" ""
-ifeq "$3" "1"
-$1_$2_SplitSections = $(SplitSections)
-else
-$1_$2_SplitSections = NO
-endif
-endif
-
 $(call hs-sources,$1,$2)
 $(call c-sources,$1,$2)
 $(call includes-sources,$1,$2)
diff --git a/rules/distdir-opts.mk b/rules/distdir-opts.mk
index b3dfba1..6cabac3 100644
--- a/rules/distdir-opts.mk
+++ b/rules/distdir-opts.mk
@@ -11,7 +11,7 @@
 # -----------------------------------------------------------------------------
 
 
-# Set compilation flags that additionally depend on a particular way
+# Set compilation flags that do not depend on a particular way
 
 define distdir-opts # args: $1 = dir, $2 = distdir, $3 = stage
 
@@ -89,5 +89,23 @@ $1_$2_ALL_HAPPY_OPTS = \
  $$($1_$2_HAPPY_OPTS) \
  $$(EXTRA_HAPPY_OPTS)
 
+# We don't bother splitting the bootstrap packages (built with stage 0)
+ifeq "$$($1_$2_SplitObjs)" ""
+ifeq "$$(SplitObjs) $3" "YES 1"
+$1_$2_SplitObjs = YES
+else
+$1_$2_SplitObjs = NO
+endif
+endif
+# Disable split sections when building with stage0, it won't be supported yet
+# and it's probably not very relevant anyway (smaller stage1 ghc?).
+ifeq "$$($1_$2_SplitSections)" ""
+ifeq "$3" "1"
+$1_$2_SplitSections = $(SplitSections)
+else
+$1_$2_SplitSections = NO
+endif
+endif
+
 endef
 



More information about the ghc-commits mailing list