[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171130233905.130602-4-samitolvanen@google.com>
Date: Thu, 30 Nov 2017 15:39:01 -0800
From: Sami Tolvanen <samitolvanen@...gle.com>
To: Alex Matveev <alxmtvv@...il.com>, Andi Kleen <ak@...ux.intel.com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Greg Hackmann <ghackmann@...gle.com>,
Kees Cook <keescook@...omium.org>,
linux-arm-kernel@...ts.infradead.org, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, Mark Rutland <mark.rutland@....com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Maxim Kuvyrkov <maxim.kuvyrkov@...aro.org>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Yury Norov <ynorov@...iumnetworks.com>,
Matthias Kaehlcke <mka@...omium.org>,
Nicholas Piggin <npiggin@...il.com>
Cc: Sami Tolvanen <samitolvanen@...gle.com>
Subject: [PATCH v2 3/7] kbuild: add ld-name macro
GNU gold may require different flags than GNU ld. Add a macro for
detecting the linker.
Signed-off-by: Sami Tolvanen <samitolvanen@...gle.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
---
scripts/Kbuild.include | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index eb2cf2780f6e..899863e4cd05 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -273,6 +273,10 @@ ld-option = $(call try-run-cached,\
# Important: no spaces around options
ar-option = $(call try-run-cached, $(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 = $(call shell-cached,$(LD) --version | $(srctree)/scripts/ld-version.sh)
--
2.15.0.531.g2ccb3012c9-goog
Powered by blists - more mailing lists