[commit: ghc] master: Apply SplitSections to all C compilations (a50082c)

git at git.haskell.org git at git.haskell.org
Sun Feb 12 01:09:16 UTC 2017


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

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

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

commit a50082c115bed1891b2e5aac4a21462935f4f0d6
Author: Simon Brenner <olsner at gmail.com>
Date:   Sat Feb 11 19:25:16 2017 -0500

    Apply SplitSections to all C compilations
    
    Previously this was added only to the RTS's C files (those are the bulk
    of it though), but there are C bits in ghc-prim, integer-gmp and base
    too.
    
    Followup for #8405, allows the large table of character properties in
    base to be stripped when not used.
    
    Test Plan: validate
    
    Reviewers: austin, bgamari, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: thomie, snowleopard
    
    Differential Revision: https://phabricator.haskell.org/D3121


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

a50082c115bed1891b2e5aac4a21462935f4f0d6
 rts/ghc.mk                | 4 ----
 rules/distdir-way-opts.mk | 3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/rts/ghc.mk b/rts/ghc.mk
index d3daec5..89c5a0b 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -335,10 +335,6 @@ ifeq "$$(TargetOS_CPP)" "mingw32"
 rts_CC_OPTS += -DWINVER=$(rts_WINVER)
 endif
 
-ifeq "$(SplitSections)" "YES"
-rts_CC_OPTS += -ffunction-sections -fdata-sections
-endif
-
 #-----------------------------------------------------------------------------
 # Flags for compiling specific files
 rts/RtsMessages_CC_OPTS += -DProjectVersion=\"$(ProjectVersion)\"
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index 62a1451..c4d7168 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -190,7 +190,8 @@ $1_$2_$3_ALL_CC_OPTS = \
  $$($1_$2_$3_CC_OPTS) \
  $$($$(basename $$<)_CC_OPTS) \
  $$($1_$2_EXTRA_CC_OPTS) \
- $$(EXTRA_CC_OPTS)
+ $$(EXTRA_CC_OPTS) \
+ $$(if $$(findstring YES,$$($1_$2_SplitSections)),-ffunction-sections -fdata-sections)
 
 $1_$2_$3_GHC_CC_OPTS = \
  $$(addprefix -optc, $$($1_$2_$3_ALL_CC_OPTS)) \



More information about the ghc-commits mailing list