diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2017-02-28 11:09:22 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-02-28 15:43:38 -0500 |
commit | 3e33d334f3a328f049eb2fdb10b04c36e8d6cbef (patch) | |
tree | 3dd137bfa02305f858af6e9a03b17a26ecf87454 | |
parent | aa2143e0541908c6e168ae326e89216c49593d29 (diff) | |
download | haskell-3e33d334f3a328f049eb2fdb10b04c36e8d6cbef.tar.gz |
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
-rw-r--r-- | rts/ghc.mk | 13 | ||||
-rw-r--r-- | rts/sm/Evac_thr.c | 4 | ||||
-rw-r--r-- | rts/sm/Scav_thr.c | 4 |
3 files changed, 9 insertions, 12 deletions
diff --git a/rts/ghc.mk b/rts/ghc.mk index 89c5a0b852..b756d942ca 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 0000000000..4fff4ec8ac --- /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 0000000000..372e779b96 --- /dev/null +++ b/rts/sm/Scav_thr.c @@ -0,0 +1,4 @@ +#ifdef THREADED_RTS +#define PARALLEL_GC +#include "Scav.c" +#endif |