ANDROID: scripts/Kbuild: avoid <<< for dash shell
The build server seems to be using dash shell, which doesn't support <<<. Avoid invoking the shell entirely to figure out which linker we're using, so that we don't have bugs and build failures on the server that aren't reproducible locally. Bug: 117299373 Change-Id: I0cd9940c2fa07a6bb4573ec8b1edcd21fd1f3a4d Reported-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Rapherion Rollerscaperers <rapherion@raphielgang.org>
This commit is contained in:
parent
773f7f9fdc
commit
3caa54b873
1 changed files with 13 additions and 2 deletions
|
@ -205,8 +205,19 @@ ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2),$(3))
|
||||||
ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
|
ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
|
||||||
|
|
||||||
# ld-name
|
# ld-name
|
||||||
# Expands to either bfd or gold
|
# Expands to either bfd, gold, or lld
|
||||||
ld-name = $(shell $(LD) -v 2>&1 | grep -q "GNU gold" && echo gold || echo bfd)
|
ifneq (,$(LD))
|
||||||
|
__ld-name = $(shell $(LD) -v 2>&1)
|
||||||
|
endif
|
||||||
|
ifneq (,$(findstring GNU gold,$(__ld-name)))
|
||||||
|
ld-name = gold
|
||||||
|
else
|
||||||
|
ifneq (,$(findstring GNU ld,$(__ld-name)))
|
||||||
|
ld-name = bfd
|
||||||
|
else
|
||||||
|
ld-name = lld
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# ld-version
|
# ld-version
|
||||||
# Note this is mainly for HJ Lu's 3 number binutil versions
|
# Note this is mainly for HJ Lu's 3 number binutil versions
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue