Skip to content
Snippets Groups Projects
Commit 41cf758b authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

Drop remaining vestiges of libtool

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
parent 9420d26b
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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)
......
......@@ -485,7 +485,6 @@ SettingsInstallNameToolCommand = @SettingsInstallNameToolCommand@
SettingsRanlibCommand = @SettingsRanlibCommand@
SettingsDllWrapCommand = @SettingsDllWrapCommand@
SettingsWindresCommand = @SettingsWindresCommand@
SettingsLibtoolCommand = @SettingsLibtoolCommand@
SettingsTouchCommand = @SettingsTouchCommand@
SettingsClangCommand = @SettingsClangCommand@
SettingsLlcCommand = @SettingsLlcCommand@
......
......@@ -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"
......
......@@ -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@\""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment