OSDN Git Service

kbuild: add ld-name macro
authorDanny Lin <danny@kdrag0n.dev>
Wed, 7 Aug 2019 12:06:50 +0000 (15:06 +0300)
committer0ranko0P <ranko0p@outlook.com>
Wed, 4 Dec 2019 17:16:46 +0000 (01:16 +0800)
[wight554: stripped from kdrag0n/proton_bluecross@aba5259]
Signed-off-by: Volodymyr Zhdanov <wight554@gmail.com>
scripts/Kbuild.include

index 374d546..0c3bead 100644 (file)
@@ -172,6 +172,10 @@ ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2))
 # Important: no spaces around options
 ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
 
+# ld-name
+# Expands to either bfd or lld
+ld-name = $(shell $(LD) -v 2>&1 | grep -q "LLD" && echo lld || echo bfd)
+
 # ld-version
 # Note this is mainly for HJ Lu's 3 number binutil versions
 ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)