Commit 88f694dd authored by Ian Lynagh's avatar Ian Lynagh

Enable and fix building dynlibs on Win64

parent 37621056
......@@ -493,7 +493,7 @@ compiler/main/Constants_HC_OPTS += -fforce-recomp
# LibFFI.hs #includes ffi.h
compiler/stage2/build/LibFFI.hs : $(libffi_HEADERS)
# On Windows it seems we also need to link directly to libffi
ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
ifeq "$(HostOS_CPP)" "mingw32"
define windowsDynLinkToFfi
# $1 = way
ifneq "$$(findstring dyn, $1)" ""
......
......@@ -119,7 +119,7 @@ SharedLibsPlatformList = \
i386-unknown-freebsd x86_64-unknown-freebsd \
i386-unknown-openbsd x86_64-unknown-openbsd \
i386-unknown-netbsd x86_64-unknown-netbsd \
i386-unknown-mingw32 \
i386-unknown-mingw32 x86_64-unknown-mingw32 \
i386-apple-darwin x86_64-apple-darwin powerpc-apple-darwin
ifeq "$(SOLARIS_BROKEN_SHLD)" "NO"
......@@ -632,7 +632,11 @@ endif
# Mingwex Library
#
HaveLibMingwEx = @HaveLibMingwEx@
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
DLLTOOL = inplace/mingw/bin/dlltool.exe
else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
DLLTOOL = inplace/mingw/bin/x86_64-w64-mingw32-dlltool.exe
endif
#-----------------------------------------------------------------------------
# Flex (currently unused, could be moved to glafp-utils)
......
......@@ -81,13 +81,12 @@ rts/libs.depend : $(GHC_PKG_INPLACE)
# These are made from rts/win32/libHS*.def which contain lists of
# all the symbols in those libraries used by the RTS.
#
ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
ifeq "$(HostOS_CPP)" "mingw32"
ALL_RTS_DEF_LIBNAMES = base ghc-prim
ALL_RTS_DEF_LIBS = \
rts/dist/build/win32/libHSbase.dll.a \
rts/dist/build/win32/libHSghc-prim.dll.a \
libffi/build/inst/lib/libffi.dll.a
rts/dist/build/win32/libHSghc-prim.dll.a
# -- import libs for the regular Haskell libraries
define make-importlib-def # args $1 = lib name
......@@ -171,7 +170,7 @@ rts_dist_$1_CC_OPTS += -DRtsWay=\"rts_$1\"
# Making a shared library for the RTS.
ifneq "$$(findstring dyn, $1)" ""
ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
ifeq "$$(HostOS_CPP)" "mingw32"
$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/$$(LIBFFI_DLL)
"$$(RM)" $$(RM_OPTS) $$@
"$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
......
......@@ -62,7 +62,7 @@ ifeq "$3" "dyn"
# Link a dynamic library
# On windows we have to supply the extra libs this one links to when building it.
ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
ifeq "$$(HostOS_CPP)" "mingw32"
$$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
"$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_ALL_OBJS) \
-shared -dynamic -dynload deploy \
......
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