Commit f3c24c53 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Follow libffi changes on Windows

parent 1169351d
...@@ -497,7 +497,7 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" ...@@ -497,7 +497,7 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
define windowsDynLinkToFfi define windowsDynLinkToFfi
# $1 = way # $1 = way
ifneq "$$(findstring dyn, $1)" "" ifneq "$$(findstring dyn, $1)" ""
compiler_stage2_$1_ALL_HC_OPTS += -lffi-5 compiler_stage2_$1_ALL_HC_OPTS += -l$$(LIBFFI_WINDOWS_LIB)
endif endif
endef endef
$(foreach way,$(GhcLibWays),$(eval $(call windowsDynLinkToFfi,$(way)))) $(foreach way,$(GhcLibWays),$(eval $(call windowsDynLinkToFfi,$(way))))
......
...@@ -35,6 +35,9 @@ libffi_STATIC_LIB = libffi/build/inst/lib/libffi.a ...@@ -35,6 +35,9 @@ libffi_STATIC_LIB = libffi/build/inst/lib/libffi.a
libffi_HEADERS = rts/dist/build/ffi.h \ libffi_HEADERS = rts/dist/build/ffi.h \
rts/dist/build/ffitarget.h rts/dist/build/ffitarget.h
LIBFFI_WINDOWS_LIB = ffi-6
LIBFFI_DLL = lib$(LIBFFI_WINDOWS_LIB).dll
ifeq "$(OSTYPE)" "cygwin" ifeq "$(OSTYPE)" "cygwin"
LIBFFI_PATH_MANGLE = PATH=$$(cygpath "$(TOP)")/libffi:$$PATH; export PATH; LIBFFI_PATH_MANGLE = PATH=$$(cygpath "$(TOP)")/libffi:$$PATH; export PATH;
endif endif
......
...@@ -116,7 +116,7 @@ $(rts_ffi_objs_stamp): $(libffi_STATIC_LIB) $(TOUCH_DEP) | $$(dir $$@)/. ...@@ -116,7 +116,7 @@ $(rts_ffi_objs_stamp): $(libffi_STATIC_LIB) $(TOUCH_DEP) | $$(dir $$@)/.
rts/dist/build/libffi$(soext): libffi/build/inst/lib/libffi$(soext) rts/dist/build/libffi$(soext): libffi/build/inst/lib/libffi$(soext)
cp libffi/build/inst/lib/libffi$(soext)* rts/dist/build cp libffi/build/inst/lib/libffi$(soext)* rts/dist/build
rts/dist/build/libffi-5.dll: libffi/build/inst/bin/libffi-5.dll rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(LIBFFI_DLL)
cp $< $@ cp $< $@
endif endif
...@@ -172,10 +172,10 @@ rts_dist_$1_CC_OPTS += -DRtsWay=\"rts_$1\" ...@@ -172,10 +172,10 @@ rts_dist_$1_CC_OPTS += -DRtsWay=\"rts_$1\"
# Making a shared library for the RTS. # Making a shared library for the RTS.
ifneq "$$(findstring dyn, $1)" "" ifneq "$$(findstring dyn, $1)" ""
ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32" ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/libffi-5.dll $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/$$(LIBFFI_DLL)
"$$(RM)" $$(RM_OPTS) $$@ "$$(RM)" $$(RM_OPTS) $$@
"$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
-no-auto-link-packages -Lrts/dist/build -lffi-5 `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@ -no-auto-link-packages -Lrts/dist/build -l$(LIBFFI_WINDOWS_LIB) `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
else else
$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext) $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
"$$(RM)" $$(RM_OPTS) $$@ "$$(RM)" $$(RM_OPTS) $$@
...@@ -510,7 +510,7 @@ endif ...@@ -510,7 +510,7 @@ endif
INSTALL_LIBS += $(ALL_RTS_LIBS) INSTALL_LIBS += $(ALL_RTS_LIBS)
INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*) INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll) INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL))
install: install_libffi_headers install: install_libffi_headers
......
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