ANDROID: scripts/Kbuild: add ld-name support for ld.lld

Bug: 63740206
Change-Id: I0cd9940c2fa07a6bb4573ec8b1edcd21fd1f3a4d
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
tirimbino
Nick Desaulniers 6 years ago committed by Sami Tolvanen
parent 5179a6a673
commit 10fa2703fb
  1. 15
      scripts/Kbuild.include

@ -204,8 +204,19 @@ ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2))
ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
# ld-name
# Expands to either bfd or gold
ld-name = $(shell $(LD) -v 2>&1 | grep -q "GNU gold" && echo gold || echo bfd)
# Expands to either bfd, gold, or lld
ifneq (,$(LD))
__ld-name = $(shell $(LD) -v 2>&1)
endif
ifneq (,$(findstring GNU gold,$(__ld-name)))
ld-name = gold
else
ifneq (,$(findstring LLD,$(__ld-name)))
ld-name = lld
else
ld-name = bfd
endif
endif
# ld-version
# Note this is mainly for HJ Lu's 3 number binutil versions

Loading…
Cancel
Save