summaryrefslogtreecommitdiff
path: root/rts/ghc.mk
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2017-08-29 23:09:09 +0100
committerTamar Christina <tamar@zhox.com>2017-08-29 23:09:09 +0100
commit5f6a82040694f7c8c2b394c1b418c0167b963e0b (patch)
treec176440e824dd48e2ee54814272642ce453f664f /rts/ghc.mk
parent3c6b2fc3b5ca11a5410405664e4640767ef941dd (diff)
downloadhaskell-5f6a82040694f7c8c2b394c1b418c0167b963e0b.tar.gz
Add gen-dll as replacement for dll-split
Summary: This tool can be used to generate dll's for any list of object files given to it. It will then repartition them automatically to fit within a dll and generates as many dll's as needed to do this. Cyclic dependencies between these generated dlls are handle automatically so there is no need to tell it how to partition. It is also a lot more general than `dll-split` as it is able to split any package not just `libGHC`. It also uses a trick using GNU style import libraries to hide the splitting from the rest of the pipeline. Which means come linking time you don't need to know which dll contains what symbol or how many split dlls were created. The import libraries are by default created with libtool. However since libtool is BFD based it is very slow. So if present and detected by configure the `genlib` tool from the msys2 project is used. This makes a difference of about ~45 minutes when compiling. To install `genlib` run `pacman -Sy mingw-w64-$(uname -m)-tools-git`. More detailed explaination of the process can be found here https://ghc.haskell.org/trac/ghc/wiki/WindowsDynamicLinking Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: snowleopard, rwbarton, thomie, erikd, #ghc_windows_task_force GHC Trac Issues: #5987 Differential Revision: https://phabricator.haskell.org/D3883
Diffstat (limited to 'rts/ghc.mk')
-rw-r--r--rts/ghc.mk24
1 files changed, 19 insertions, 5 deletions
diff --git a/rts/ghc.mk b/rts/ghc.mk
index e3de93dc49..ed1b89c0f4 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -207,11 +207,25 @@ ifneq "$$(findstring dyn, $1)" ""
ifeq "$$(TargetOS_CPP)" "mingw32"
$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/dist/libs.depend rts/dist/build/$$(LIBFFI_DLL)
"$$(RM)" $$(RM_OPTS) $$@
- "$$(rts_dist_HC)" -this-unit-id rts -shared -dynamic -dynload deploy \
- -no-auto-link-packages -Lrts/dist/build -l$$(LIBFFI_NAME) \
- `cat rts/dist/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) \
- $$(rts_dist_$1_GHC_LD_OPTS) \
- -o $$@
+ # Call out to the shell script to decide how to build the dll.
+ # Making a shared library for the RTS.
+ # $$1 = dir
+ # $$2 = distdir
+ # $$3 = way
+ # $$4 = extra flags
+ # $$5 = extra libraries to link
+ # $$6 = object files to link
+ # $$7 = output filename
+ # $$8 = link command
+ # $$9 = create delay load import lib
+ # $$10 = SxS Name
+ # $$11 = SxS Version
+ $$(gen-dll_INPLACE) link "rts/dist/build" "rts/dist/build" "" "" "$$(ALL_RTS_DEF_LIBS)" "$$(rts_$1_OBJS)" "$$@" "$$(rts_dist_HC) -this-unit-id rts -no-hs-main -shared -dynamic -dynload deploy \
+ -no-auto-link-packages -Lrts/dist/build -l$$(LIBFFI_NAME) \
+ `cat rts/dist/libs.depend | tr '\n' ' '` \
+ $$(rts_dist_$1_GHC_LD_OPTS)" "NO" \
+ "$(rts_INSTALL_INFO)-$(subst dyn,,$(subst _dyn,,$(subst v,,$1)))" "$(ProjectVersion)"
+
else
ifneq "$$(UseSystemLibFFI)" "YES"
LIBFFI_LIBS = -Lrts/dist/build -l$$(LIBFFI_NAME)