Commit 3e33d334 authored by Moritz Angermann's avatar Moritz Angermann Committed by Ben Gamari
Browse files

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
parent aa2143e0
......@@ -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
......
#ifdef THREADED_RTS
#define PARALLEL_GC
#include "Evac.c"
#endif
#ifdef THREADED_RTS
#define PARALLEL_GC
#include "Scav.c"
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment