linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] init/Kconfig: add config support for detecting linker
@ 2019-02-07 22:01 ndesaulniers
  2019-02-07 22:01 ` [PATCH 2/4] Makefile: clang: choose GCC_TOOLCHAIN_DIR not on LD ndesaulniers
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: ndesaulniers @ 2019-02-07 22:01 UTC (permalink / raw)
  To: yamada.masahiro
  Cc: Nick Desaulniers, Nathan Chancellor, Sami Tolvanen,
	Andrew Morton, Peter Zijlstra (Intel),
	Johannes Weiner, Kees Cook, Dominik Brodowski, Nicholas Piggin,
	Mathieu Desnoyers, Vasily Gorbik, Adrian Reber,
	Richard Guy Briggs, linux-kernel

Similar to how we differentiate between CONFIG_CC_IS_GCC and
CONFIG_CC_IS_CLANG, add CONFIG_LD_IS_BFD, CONFIG_LD_IS_GOLD, and
CONFIG_LD_IS_LLD.

This simiplifies patches to Makefiles that need to do different things
for different linkers.

Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 init/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/init/Kconfig b/init/Kconfig
index c9386a365eea..b6046dcf7794 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -26,6 +26,15 @@ config CLANG_VERSION
 config CC_HAS_ASM_GOTO
 	def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC))
 
+config LD_IS_BFD
+	def_bool $(success,$(LD) --version | head -n 1 | grep -q 'GNU ld')
+
+config LD_IS_GOLD
+	def_bool $(success,$(LD) --version | head -n 1 | grep -q 'GNU gold')
+
+config LD_IS_LLD
+	def_bool $(success,$(LD) --version | head -n 1 | grep -q 'LLD')
+
 config CONSTRUCTORS
 	bool
 	depends on !UML
-- 
2.20.1.791.gb4d0f1c61a-goog


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* Re: [PATCH 3/4] Makefile: lld: tell clang to use lld
@ 2019-02-08 14:21 Sedat Dilek
  2019-02-08 16:24 ` Nathan Chancellor
  0 siblings, 1 reply; 21+ messages in thread
From: Sedat Dilek @ 2019-02-08 14:21 UTC (permalink / raw)
  To: Masahiro Yamada, Nick Desaulniers, Nathan Chancellor,
	Michal Marek, linux-kbuild, linux-kernel

Hi Nick,

why don't you simply check for CONFIG_LD_IS_LLD existing (when [1] applied)?

If you want a specific version of ld.lld (you mentioned kernel module
linking failure was fixed recently) why not transfer this into a
scripts/lld-version.sh file?

Greetings,
- Sedat -

[1] https://lore.kernel.org/patchwork/patch/1039719/ ("[1/4]
init/Kconfig: add config support for detecting linker")

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-02-11 19:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07 22:01 [PATCH 1/4] init/Kconfig: add config support for detecting linker ndesaulniers
2019-02-07 22:01 ` [PATCH 2/4] Makefile: clang: choose GCC_TOOLCHAIN_DIR not on LD ndesaulniers
2019-02-08  5:45   ` Nathan Chancellor
2019-02-07 22:01 ` [PATCH 3/4] Makefile: lld: tell clang to use lld ndesaulniers
2019-02-08  5:50   ` Nathan Chancellor
2019-02-08 17:27     ` Nick Desaulniers
2019-02-08 17:45       ` Nathan Chancellor
2019-02-11 15:32       ` Masahiro Yamada
2019-02-11 16:05         ` Sedat Dilek
2019-02-11 19:30           ` Nick Desaulniers
2019-02-11 19:27         ` Nick Desaulniers
2019-02-11 19:26     ` Nick Desaulniers
2019-02-07 22:01 ` [PATCH 4/4] Makefile: lld: set -O2 linker flag when linking with LLD ndesaulniers
2019-02-08  6:07   ` Nathan Chancellor
2019-02-08  0:48 ` [PATCH 1/4] init/Kconfig: add config support for detecting linker Kees Cook
2019-02-08  0:57 ` Mathieu Desnoyers
2019-02-08  5:41   ` Nathan Chancellor
2019-02-11 15:08     ` Masahiro Yamada
2019-02-08  5:14 ` Nathan Chancellor
2019-02-08 14:21 [PATCH 3/4] Makefile: lld: tell clang to use lld Sedat Dilek
2019-02-08 16:24 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).