Permalink
Browse files

Enable and fix building dynlibs on Win64

  • Loading branch information...
1 parent 3762105 commit 88f694dd488bfe475c7dfac20ad47781c5689785 @igfoo igfoo committed May 4, 2012
Showing with 10 additions and 7 deletions.
  1. +1 −1 compiler/ghc.mk
  2. +5 −1 mk/config.mk.in
  3. +3 −4 rts/ghc.mk
  4. +1 −1 rules/build-package-way.mk
View
2 compiler/ghc.mk
@@ -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)" ""
View
6 mk/config.mk.in
@@ -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)
View
7 rts/ghc.mk
@@ -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 \
View
2 rules/build-package-way.mk
@@ -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 \

0 comments on commit 88f694d

Please sign in to comment.