diff options
| author | Sami Tolvanen <samitolvanen@google.com> | 2017-10-25 12:33:58 -0700 |
|---|---|---|
| committer | Bruno Martins <bgcngm@gmail.com> | 2022-10-28 15:57:23 +0100 |
| commit | 2d471de60bb497d8b3f9021ea255dcf1b8a07dc0 (patch) | |
| tree | f7ea040f6cfc14b8b49aa50cb91f02de61ee125e /scripts/Kbuild.include | |
| parent | 06280a90d845bd21e2ccece9f82f1f832a9c92ad (diff) | |
BACKPORT: 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 <ndesaulniers@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
(cherry picked from commit 552777bdc1d775bee1ffde43c23ab0b2c4501f35)
Signed-off-by: Dan Aloni <daloni@magicleap.com>
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'scripts/Kbuild.include')
| -rw-r--r-- | scripts/Kbuild.include | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index f955e3556942..5ad934a46ec9 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -204,6 +204,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 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) |
