summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-03-29 12:27:20 -0400
committerBen Gamari <ben@smart-cactus.org>2022-04-23 19:03:12 -0400
commit53ebd115a1190c4c30cf5ca9ba112b8a45c667d7 (patch)
tree5b38184d0193d2b97b52703b5ce2ac598d7bfa09
parent10c3133aed2d5355ed48dcce2316b54d2b7a83d3 (diff)
downloadhaskell-wip/T18826.tar.gz
Drop remaining vestiges of libtoolwip/T18826
Drop libtool logic from gen-dll, allowing us to drop the remaining logic from the `configure` script. Strangely, this appears to reliably reduce compiler allocations of T16875 on Windows. Closes #18826. Metric Decrease: T16875
-rw-r--r--configure.ac17
-rw-r--r--m4/fp_settings.m46
-rw-r--r--mk/config.mk.in1
-rw-r--r--utils/gen-dll/Main.hs23
-rw-r--r--utils/gen-dll/gen-dll.cabal.in1
5 files changed, 11 insertions, 37 deletions
diff --git a/configure.ac b/configure.ac
index 7f2fb42bc6..6b41a7e392 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,22 +547,6 @@ AC_CHECK_TARGET_TOOL([STRIP], [strip])
StripCmd="$STRIP"
AC_SUBST([StripCmd])
-
-dnl ** which libtool to use?
-dnl --------------------------------------------------------------
-# The host normalization on Windows breaks autoconf, it no longer
-# thinks that target == host so it never checks the unqualified
-# tools for Windows. See #14274.
-if test "$HostOS" = "mingw32"
-then
- AC_PATH_PROG([LIBTOOL],[libtool])
- LibtoolCmd="$(cygpath -m $LIBTOOL)"
-else
- AC_CHECK_TARGET_TOOL([LIBTOOL], [libtool])
- LibtoolCmd="$LIBTOOL"
-fi
-AC_SUBST([LibtoolCmd])
-
dnl ** Which otool to use on macOS
dnl --------------------------------------------------------------
AC_CHECK_TARGET_TOOL([OTOOL], [otool])
@@ -1299,7 +1283,6 @@ echo "\
ar : $ArCmd
ld : $LdCmd
nm : $NmCmd
- libtool : $LibtoolCmd
objdump : $ObjdumpCmd
ranlib : $RanlibCmd
otool : $OtoolCmd
diff --git a/m4/fp_settings.m4 b/m4/fp_settings.m4
index 4db7cd46af..dbacd3a816 100644
--- a/m4/fp_settings.m4
+++ b/m4/fp_settings.m4
@@ -74,11 +74,6 @@ AC_DEFUN([FP_SETTINGS],
fi
# Platform-agnostic tools
- if test -z "$LibtoolCmd"; then
- LibtoolCmd="libtool"
- fi
- SettingsLibtoolCommand="$LibtoolCmd"
-
if test -z "$ClangCmd"; then
ClangCmd="clang"
fi
@@ -125,7 +120,6 @@ AC_DEFUN([FP_SETTINGS],
AC_SUBST(SettingsInstallNameToolCommand)
AC_SUBST(SettingsDllWrapCommand)
AC_SUBST(SettingsWindresCommand)
- AC_SUBST(SettingsLibtoolCommand)
AC_SUBST(SettingsTouchCommand)
AC_SUBST(SettingsClangCommand)
AC_SUBST(SettingsLlcCommand)
diff --git a/mk/config.mk.in b/mk/config.mk.in
index e1474a34a3..a80d47abe8 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -485,7 +485,6 @@ SettingsInstallNameToolCommand = @SettingsInstallNameToolCommand@
SettingsRanlibCommand = @SettingsRanlibCommand@
SettingsDllWrapCommand = @SettingsDllWrapCommand@
SettingsWindresCommand = @SettingsWindresCommand@
-SettingsLibtoolCommand = @SettingsLibtoolCommand@
SettingsTouchCommand = @SettingsTouchCommand@
SettingsClangCommand = @SettingsClangCommand@
SettingsLlcCommand = @SettingsLlcCommand@
diff --git a/utils/gen-dll/Main.hs b/utils/gen-dll/Main.hs
index 10abbe89db..b8c4869f13 100644
--- a/utils/gen-dll/Main.hs
+++ b/utils/gen-dll/Main.hs
@@ -44,9 +44,9 @@
which is also the partitioning scheme used for all other files including
the resulting dlls.
- From the .def file we use libtool or genlib (when available) to generate
- an import library. In this case we generate a GNU style import library
- See Note [BFD import library].
+ From the .def file we use genlib to generate an import library. In this
+ case we generate a GNU style import library See Note [BFD import
+ library].
These import libraries are used to break the cyclic dependencies that may
exist between the symbols due to the random partitioning. e.g. A may
@@ -71,7 +71,7 @@
only 1 symbol and the dll in which to find this symbol.
A proper linker processes all the object files in this AR file (lld, ld and
- ghci do this.) and so while genlib and libtool don't allow you to create
+ ghci do this.) and so while genlib doesn't allow you to create
import libraries with multiple dll pointers, it is trivial to do.
We use ar to merge together the import libraries into a large complete one.
@@ -440,13 +440,12 @@ execProg prog m_stdin args =
length results `seq` return $ lines results)
-- | Mingw-w64's genlib.exe is generally a few order of magnitudes faster than
--- libtool which is BFD based. So we prefer it, but it's not standard so
--- support both. We're talking a difference of 45 minutes in build time here.
+-- libtool which is BFD based. We used to support both but the libtool path
+-- would literally require fractions of hours to finish so we dropped it in the
+-- name of consistency and simplicity.
execLibTool :: String -> String -> IO [String]
-execLibTool input_def output_lib =
- do if HAS_GENLIB
- then execProg genlib Nothing [input_def, "-o", output_lib]
- else execProg libexe Nothing ["-d", input_def, "-l", output_lib]
+execLibTool input_def output_lib
+ = execProg genlib Nothing [input_def, "-o", output_lib]
-- Builds a delay import lib at the very end which is used to
-- be able to delay the picking of a DLL on Windows.
@@ -470,9 +469,9 @@ build_import_lib base dll_name defFile objs
let (globals, functions) = splitObjs objs
-- This split is important because for DATA entries the compiler should not generate
- -- a trampoline since CONTS DATA is directly referenced and not executed. This is not very
+ -- a trampoline since CONST DATA is directly referenced and not executed. This is not very
-- important for mingw-w64 which would generate both the trampoline and direct reference
- -- by default, but for libtool is it and even for mingw-w64 we can trim the output.
+ -- by default, but nevertheless for mingw-w64 we can trim the output.
_ <- withFile defFile WriteMode $ \hDef -> do
hPutStrLn hDef $ unlines $ ["LIBRARY " ++ show dll_name
,"EXPORTS"
diff --git a/utils/gen-dll/gen-dll.cabal.in b/utils/gen-dll/gen-dll.cabal.in
index 7c5c355f12..1013b0b74a 100644
--- a/utils/gen-dll/gen-dll.cabal.in
+++ b/utils/gen-dll/gen-dll.cabal.in
@@ -32,6 +32,5 @@ Executable gen-dll
ghc-options: -UGEN_SXS
-DHAS_GENLIB=@HAVE_GENLIB@
-DNM_TOOL_BIN="\"@NmCmd@\""
- -DLIB_TOOL_BIN="\"@LibtoolCmd@\""
-DGENLIB_TOOL_BIN="\"@GenlibCmd@\""
-DAR_TOOL_BIN="\"@ArCmd@\""