From: Sami Tolvanen Date: Wed, 25 Oct 2017 19:33:58 +0000 (-0700) Subject: FROMLIST: kbuild: add ld-name macro X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e68f37bdf3afaeaba36f6a166d0beb06bd53c53a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git FROMLIST: kbuild: add ld-name macro GNU gold may require different flags than GNU ld. Add a macro for detecting the linker. Bug: 62093296 Bug: 67506682 Change-Id: I777f14bf4fd902de1f8dc73d7ecc3c0403eae5f5 (am from https://patchwork.kernel.org/patch/10085775/) Reviewed-by: Nick Desaulniers Signed-off-by: Sami Tolvanen --- diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index b2c913479f9a..ae167b7b187b 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -204,6 +204,10 @@ ld-option = $(call try-run,\ # Important: no spaces around options 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) + # ld-version # Note this is mainly for HJ Lu's 3 number binutil versions ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)