[commit: ghc] master: Drop copy step from the rts/ghc.mk (3e33d33)

git at git.haskell.org git at git.haskell.org
Tue Feb 28 20:50:49 UTC 2017


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

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

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

commit 3e33d334f3a328f049eb2fdb10b04c36e8d6cbef
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Tue Feb 28 11:09:22 2017 -0500

    Drop copy step from the rts/ghc.mk
    
    Recently I've used a different build system for building the
    rts (Xcode).  And in doing so, I looked through the rts/ghc.mk
    to figure out how to build the rts.
    
    In general it's quite straight forward to just compile all the
    c files with the proper flags.
    
    However there is one rather awkward copy step that copies some
    files for special handling for the rts way.
    
    I'm wondering if the proposed solution in this diff is better
    or worse than the current situation?
    
    The idea is to keep the files, but use #includes to produce
    identical files with just an additional define. It does however
    produce empty objects for non threaded ways.
    
    Reviewers: ezyang, bgamari, austin, erikd, simonmar, rwbarton
    
    Reviewed By: bgamari, simonmar, rwbarton
    
    Subscribers: rwbarton, thomie, snowleopard
    
    Differential Revision: https://phabricator.haskell.org/D3237


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

3e33d334f3a328f049eb2fdb10b04c36e8d6cbef
 rts/ghc.mk        | 13 +------------
 rts/sm/Evac_thr.c |  4 ++++
 rts/sm/Scav_thr.c |  4 ++++
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/rts/ghc.mk b/rts/ghc.mk
index 89c5a0b..b756d94 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -68,10 +68,6 @@ rts_AUTO_APPLY_CMM = rts/dist/build/AutoApply.cmm
 $(rts_AUTO_APPLY_CMM): $$(genapply_INPLACE)
 	"$(genapply_INPLACE)" >$@
 
-rts/dist/build/sm/Evac_thr.c : rts/sm/Evac.c | $$(dir $$@)/.
-	cp $< $@
-rts/dist/build/sm/Scav_thr.c : rts/sm/Scav.c | $$(dir $$@)/.
-	cp $< $@
 
 rts_H_FILES := $(wildcard rts/*.h rts/*/*.h)
 
@@ -157,9 +153,6 @@ endif
 rts_dist_$1_CC_OPTS += -DDYNAMIC
 endif
 
-ifneq "$$(findstring thr, $1)" ""
-rts_$1_EXTRA_C_SRCS  =  rts/dist/build/sm/Evac_thr.c rts/dist/build/sm/Scav_thr.c
-endif
 
 $(call distdir-way-opts,rts,dist,$1,1) # 1 because the rts is built with stage1
 $(call c-suffix-rules,rts,dist,$1,YES)
@@ -452,12 +445,8 @@ endif
 
 # -O3 helps unroll some loops (especially in copy() with a constant argument).
 rts/sm/Evac_CC_OPTS += -funroll-loops
-rts/dist/build/sm/Evac_thr_HC_OPTS += -optc-funroll-loops
+rts/sm/Evac_thr_HC_OPTS += -optc-funroll-loops
 
-# These files are just copies of sm/Evac.c and sm/Scav.c respectively,
-# but compiled with -DPARALLEL_GC.
-rts/dist/build/sm/Evac_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm
-rts/dist/build/sm/Scav_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm
 
 #-----------------------------------------------------------------------------
 # Use system provided libffi
diff --git a/rts/sm/Evac_thr.c b/rts/sm/Evac_thr.c
new file mode 100644
index 0000000..4fff4ec
--- /dev/null
+++ b/rts/sm/Evac_thr.c
@@ -0,0 +1,4 @@
+#ifdef THREADED_RTS
+#define PARALLEL_GC
+#include "Evac.c"
+#endif
diff --git a/rts/sm/Scav_thr.c b/rts/sm/Scav_thr.c
new file mode 100644
index 0000000..372e779
--- /dev/null
+++ b/rts/sm/Scav_thr.c
@@ -0,0 +1,4 @@
+#ifdef THREADED_RTS
+#define PARALLEL_GC
+#include "Scav.c"
+#endif



More information about the ghc-commits mailing list