summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-06-08 19:22:02 -0400
committerZubin Duggal <zubin.duggal@gmail.com>2022-07-26 16:28:48 +0530
commit959641a4aba48e945703d16bb9ecc11ac9b89ef6 (patch)
tree33bab5cda3e2683ef85a64f5482da0af6685ea0c
parente6e0c49ddbbf9e57fcabbb0f2c3b7d25a822e1d4 (diff)
downloadhaskell-959641a4aba48e945703d16bb9ecc11ac9b89ef6.tar.gz
configure: Don't attempt to override linker on Darwin
Configure's --enable-ld-override functionality is intended to ensure that we don't rely on ld.bfd, which tends to be slow and buggy, on Linux and Windows. However, on Darwin the lack of sensible package management makes it extremely easy for users to have awkward mixtures of toolchain components from, e.g., XCode, the Apple Command-Line Tools package, and homebrew. This leads to extremely confusing problems like #21712. Here we avoid this by simply giving up on linker selection on Darwin altogether. This isn't so bad since the Apple ld64 linker has decent performance and AFAICT fairly reliable. Closes #21712. (cherry picked from commit bde65ea90ed61696eefc93c83efddf7af68d413e)
-rw-r--r--m4/find_ld.m49
1 files changed, 8 insertions, 1 deletions
diff --git a/m4/find_ld.m4 b/m4/find_ld.m4
index a8621e34f6..2362cd846f 100644
--- a/m4/find_ld.m4
+++ b/m4/find_ld.m4
@@ -64,7 +64,14 @@ AC_DEFUN([FIND_LD],[
AC_CHECK_TARGET_TOOL([LD], [ld])
}
- if test "x$enable_ld_override" = "xyes"; then
+ if test "$ghc_host_os" = "darwin" ; then
+ dnl N.B. Don't even try to find a more efficient linker on Darwin where
+ dnl broken setups (e.g. unholy mixtures of Homebrew and the native
+ dnl toolchain) are far too easy to come across.
+ dnl
+ dnl See #21712.
+ AC_CHECK_TARGET_TOOL([LD], [ld])
+ elif test "x$enable_ld_override" = "xyes"; then
find_ld
else
AC_CHECK_TARGET_TOOL([LD], [ld])