[commit: ghc] ghc-8.2: Fix lld detection if both gold and lld are found (2fbdd42)

git at git.haskell.org git at git.haskell.org
Wed Aug 2 21:40:36 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/2fbdd42c27a589d33a3583d13162641dada9ed2c/ghc

>---------------------------------------------------------------

commit 2fbdd42c27a589d33a3583d13162641dada9ed2c
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Fri Jul 28 11:48:52 2017 -0400

    Fix lld detection if both gold and lld are found
    
    If you have ld.gold and ld.lld, then ld.gold will be selected by the
    detection logic. This patch prioritizes lld by changing the order. The
    rationale for checking lld first is that it's (right now) not part of,
    say, a default Linux distro installation and if it's available, it's
    very likely that it was installed explicitly and should be seen as a
    sign of preference. On FreeBSD LLVM is the (default) base toolchain and
    the changed order makes sense there as well, since ld.gold can be
    available in /usr/local via ports/pkg. I don't have access to macOS and
    can't say anything about their LLVM toolchain.
    
    At some point we could add a check for LD=ld.lld or LD=ld.gold as an
    optional override to explicitly select a linker.
    
    Since I cannot really remove gcc on Linux, this was the only way to
    configure GHC to use ld.lld.
    
    Reviewers: austin, hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, erikd
    
    Tags: PHID-PROJ-5azim3sqhsf7wzvlvaag
    
    Differential Revision: https://phabricator.haskell.org/D3790
    
    (cherry picked from commit 2974f81f8c3529657a0b808b8415a4d2ad9ed6d1)


>---------------------------------------------------------------

2fbdd42c27a589d33a3583d13162641dada9ed2c
 aclocal.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aclocal.m4 b/aclocal.m4
index fe2c43d..3e5c5dc 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -2339,7 +2339,7 @@ AC_DEFUN([FIND_LD],[
       [enable_ld_override=yes])
 
     if test "x$enable_ld_override" = "xyes"; then
-        AC_CHECK_TARGET_TOOLS([TmpLd], [ld.gold ld.lld ld])
+        AC_CHECK_TARGET_TOOLS([TmpLd], [ld.lld ld.gold ld])
 
         out=`$TmpLd --version`
         case $out in



More information about the ghc-commits mailing list