summaryrefslogtreecommitdiff
path: root/configure.ac
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 /configure.ac
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 'configure.ac')
-rw-r--r--configure.ac47
1 files changed, 31 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index dd721447c4..500be7e491 100644
--- a/configure.ac
+++ b/configure.ac
@@ -391,6 +391,8 @@ then
OBJDUMP="${mingwbin}objdump.exe"
fp_prog_ar="${mingwbin}ar.exe"
+ AC_PATH_PROG([Genlib],[genlib])
+
# NB. Download the perl binaries if required
if ! test -d inplace/perl ||
test inplace/perl -ot ghc-tarballs/perl/ghc-perl*.tar.gz
@@ -420,13 +422,25 @@ then
AC_PATH_PROG([OBJDUMP],[objdump])
AC_PATH_PROG([DllWrap],[dllwrap])
AC_PATH_PROG([Windres],[windres])
+ AC_PATH_PROG([Genlib],[genlib])
fi
DllWrapCmd="$DllWrap"
WindresCmd="$Windres"
+HAVE_GENLIB=False
+if test "$HostOS" = "mingw32"
+then
+ if test "$Genlib" != ""; then
+ GenlibCmd="$(cygpath -m $Genlib)"
+ HAVE_GENLIB=True
+ fi
+fi
+
AC_SUBST([DllWrapCmd])
AC_SUBST([WindresCmd])
+AC_SUBST([GenlibCmd])
+AC_SUBST([HAVE_GENLIB])
FP_ICONV
FP_GMP
@@ -587,18 +601,6 @@ esac
ObjdumpCmd="$OBJDUMP"
AC_SUBST([ObjdumpCmd])
-dnl ** Which ar to use?
-dnl --------------------------------------------------------------
-if test "$HostOS" != "mingw32"; then
- AC_CHECK_TARGET_TOOL([AR], [ar])
- if test "$AR" = ":"; then
- AC_MSG_ERROR([cannot find ar in your PATH])
- fi
-fi
-ArCmd="$AR"
-fp_prog_ar="$AR"
-AC_SUBST([ArCmd])
-
dnl ** Which ranlib to use?
dnl --------------------------------------------------------------
AC_PROG_RANLIB
@@ -610,9 +612,21 @@ RANLIB="$RanlibCmd"
dnl ** which libtool to use?
dnl --------------------------------------------------------------
-AC_CHECK_TARGET_TOOL([LIBTOOL], [libtool])
-LibtoolCmd="$LIBTOOL"
-LIBTOOL="$LibtoolCmd"
+# The host normalization on Windows breaks autoconf, it no longer
+# thinks that target == host so it never checks the unqualified
+# tools for Windows. I don't know why we do this whole normalization thing
+# as it just breaks everything.. but for now, just check the unqualified one
+# if on Windows.
+if test "$HostOS" = "mingw32"
+then
+ AC_PATH_PROG([LIBTOOL],[libtool])
+ LibtoolCmd="$(cygpath -m $LIBTOOL)"
+else
+ AC_CHECK_TARGET_TOOL([LIBTOOL], [libtool])
+ LibtoolCmd="$LIBTOOL"
+ LIBTOOL="$LibtoolCmd"
+fi
+AC_SUBST([LibtoolCmd])
# Here is where we re-target which specific version of the LLVM
# tools we are looking for. In the past, GHC supported a number of
@@ -1249,7 +1263,7 @@ checkMake380() {
checkMake380 make
checkMake380 gmake
-AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal utils/runghc/runghc.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
+AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac])
AC_OUTPUT
[
if test "$print_make_warning" = "true"; then
@@ -1302,6 +1316,7 @@ echo "\
ranlib : $RanlibCmd
windres : $WindresCmd
dllwrap : $DllWrapCmd
+ genlib : $GenlibCmd
Happy : $HappyCmd ($HappyVersion)
Alex : $AlexCmd ($AlexVersion)
Perl : $PerlCmd