[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190211193008.24101-1-ndesaulniers@google.com>
Date: Mon, 11 Feb 2019 11:30:03 -0800
From: ndesaulniers@...gle.com
To: yamada.masahiro@...ionext.com
Cc: natechancellor@...il.com, sedat.dilek@...il.com,
keescook@...omium.org, samitolvanen@...gle.com,
michal.lkml@...kovi.net, akpm@...ux-foundation.org,
hannes@...xchg.org, peterz@...radead.org,
linux@...inikbrodowski.net, npiggin@...il.com,
mathieu.desnoyers@...icios.com, gor@...ux.ibm.com, adrian@...as.de,
rgb@...hat.com, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: [PATCH v2 1/4] init/Kconfig: add config support for detecting linker
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: Sami Tolvanen <samitolvanen@...gle.com>
Suggested-by: Sedat Dilek <sedat.dilek@...il.com>
Reviewed-by: Kees Cook <keescook@...omium.org>
Reviewed-by: Nathan Chancellor <natechancellor@...il.com>
Tested-by: Nathan Chancellor <natechancellor@...il.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
---
Changes V1->V2:
* Add suggested, reviewed, and tested by tags.
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
Powered by blists - more mailing lists