summaryrefslogtreecommitdiff
path: root/rts/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-10-14 02:43:50 +0100
committerIan Lynagh <igloo@earth.li>2011-10-14 02:43:50 +0100
commit7c3b22edada41d6ad811a453575ec2084c6af823 (patch)
tree22e5b67cf08ec630ff25bcda904a9e37d70817de /rts/ghc.mk
parentbcab1273dcb58199001e225eca1708e6648a3bb4 (diff)
downloadhaskell-7c3b22edada41d6ad811a453575ec2084c6af823.tar.gz
Simplify the libffi build
We now put the libffi objects into the RTS library, rather than trying to mangle libffi into being a ghc package itself. It would be nicer to make it a separate library (but not a ghc package), but for now hopefully this will get the build going through on Windows again.
Diffstat (limited to 'rts/ghc.mk')
-rw-r--r--rts/ghc.mk28
1 files changed, 13 insertions, 15 deletions
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 9f3680d71b..767194e23f 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -172,15 +172,15 @@ rts_dist_$1_CC_OPTS += -DRtsWay=\"rts_$1\"
# Making a shared library for the RTS.
ifneq "$$(findstring dyn, $1)" ""
ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend
+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend $$(rts_ffi_objs_stamp)
"$$(RM)" $$(RM_OPTS) $$@
"$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
- -no-auto-link-packages `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
+ -no-auto-link-packages `cat rts/libs.depend` $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
else
-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend
+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend $$(rts_ffi_objs_stamp)
"$$(RM)" $$(RM_OPTS) $$@
"$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
- -no-auto-link-packages `cat rts/libs.depend` $$(rts_$1_OBJS) \
+ -no-auto-link-packages `cat rts/libs.depend` $$(rts_ffi_objs) $$(rts_$1_OBJS) \
$$(rts_$1_DTRACE_OBJS) -o $$@
ifeq "$$(darwin_HOST_OS)" "1"
# Ensure library's install name is correct before anyone links with it.
@@ -188,9 +188,9 @@ ifeq "$$(darwin_HOST_OS)" "1"
endif
endif
else
-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS)
+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp)
"$$(RM)" $$(RM_OPTS) $$@
- echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
+ echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
$$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@
endif
@@ -198,6 +198,12 @@ endif
endef
+rts_ffi_objs_stamp = rts/dist/ffi/stamp
+rts_ffi_objs = rts/dist/ffi/*.o
+$(rts_ffi_objs_stamp): $(libffi_STATIC_LIB) | $$(dir $$@)/.
+ cd rts/dist/ffi && $(AR) x ../../../$(libffi_STATIC_LIB)
+ touch $@
+
# And expand the above for each way:
$(foreach way,$(rts_WAYS),$(eval $(call build-rts-way,$(way))))
@@ -455,15 +461,7 @@ endif
$(eval $(call dependencies,rts,dist,1))
-$(rts_dist_depfile_c_asm) : libffi/dist-install/build/ffi.h $(DTRACEPROBES_H)
-
-#-----------------------------------------------------------------------------
-# libffi stuff
-
-rts_CC_OPTS += -Ilibffi/dist-install/build
-rts_HC_OPTS += -Ilibffi/dist-install/build
-rts_HSC2HS_OPTS += -Ilibffi/dist-install/build
-rts_LD_OPTS += -Llibffi/dist-install/build
+$(rts_dist_depfile_c_asm) : $(ffi_HEADER) $(DTRACEPROBES_H)
# -----------------------------------------------------------------------------
# compile dtrace probes if dtrace is supported