summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-07-11 14:42:04 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-11 15:26:20 -0400
commitfcd2db14368fc6e0d35b13535a9663cfab7080a7 (patch)
treed30cdba042d3ec12012e2e88bef99375434f3286 /aclocal.m4
parentd3bdd6c4ea9e267af494f822bfdd0600e3a06281 (diff)
downloadhaskell-fcd2db14368fc6e0d35b13535a9663cfab7080a7.tar.gz
configure: Ensure that we don't set LD to unusable linker
Previously if we found an unusable linker in PATH (e.g. ld.lld on OS X) we would notice the -fuse-ld=... was broken, but neglected to reset LD to a usable linker. This resulted in brokenness on OS X when lld is in PATH. Test Plan: Validate on OS X with lld in PATH Reviewers: austin, hvr, angerman Reviewed By: angerman Subscribers: rwbarton, thomie, erikd, angerman GHC Trac Issues: #13541 Differential Revision: https://phabricator.haskell.org/D3713
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m412
1 files changed, 7 insertions, 5 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 1d9c09b0cd..c31c881466 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -2272,18 +2272,20 @@ AC_DEFUN([FIND_LD],[
[enable_ld_override=yes])
if test "x$enable_ld_override" = "xyes"; then
- AC_CHECK_TARGET_TOOLS([LD], [ld.gold ld.lld ld])
- UseLd=''
+ AC_CHECK_TARGET_TOOLS([TmpLd], [ld.gold ld.lld ld])
- out=`$LD --version`
+ out=`$TmpLd --version`
case $out in
"GNU ld"*) FP_CC_LINKER_FLAG_TRY(bfd, $2) ;;
"GNU gold"*) FP_CC_LINKER_FLAG_TRY(gold, $2) ;;
"LLD"*) FP_CC_LINKER_FLAG_TRY(lld, $2) ;;
*) AC_MSG_NOTICE([unknown linker version $out]) ;;
esac
- if test "z$2" = "z"; then
- AC_MSG_NOTICE([unable to convince '$CC' to use linker '$LD'])
+ if test "z$$2" = "z"; then
+ AC_MSG_NOTICE([unable to convince '$CC' to use linker '$TmpLd'])
+ AC_CHECK_TARGET_TOOL([LD], [ld])
+ else
+ LD="$TmpLd"
fi
else
AC_CHECK_TARGET_TOOL([LD], [ld])