libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Accept LLD as a GNU ld compatible linker


From: Fangrui Song
Subject: [PATCH] Accept LLD as a GNU ld compatible linker
Date: Fri, 3 Apr 2020 21:40:17 -0700

The ELF port of LLD (the LLVM linker) is a drop-in replacement for GNU
ld and is widely used nowadays.

https://reviews.llvm.org/D31199 added a User-Agent style hack to make
libtool recognize lld as a GNU ld compatible linker, but it would be
nice to support the "LLD" version string directly so that LLD can
eventually get rid of the hack.

`ld.lld -v` output:

LLD 11.0.0 (compatible with GNU linkers)
---
 m4/libtool.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index f2d1f398..4e2d8fdf 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -3321,7 +3321,7 @@ AC_CACHE_VAL(lt_cv_path_LD,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
+      *GNU* | *'with BFD'* | *LLD*)
        test no != "$with_gnu_ld" && break
        ;;
       *)
@@ -3361,7 +3361,7 @@ m4_defun([_LT_PATH_LD_GNU],
 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
+*GNU* | *'with BFD'* | *LLD*)
   lt_cv_prog_gnu_ld=yes
   ;;
 *)
-- 
2.26.0.292.g33ef6b2f38-goog




reply via email to

[Prev in Thread] Current Thread [Next in Thread]