From: Sedat Dilek <sedat.dilek@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
"Steven Rostedt (VMware)" <rostedt@goodmis.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Tejun Heo <tj@kernel.org>,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
"Joel Fernandes (Google)" <joel@joelfernandes.org>,
Patrick Bellasi <patrick.bellasi@arm.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Dan Williams <dan.j.williams@intel.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Subject: [RFC PATCH 1/2] kbuild: add CONFIG_LD_IS_BINUTILS
Date: Sun, 19 Apr 2020 15:19:47 +0200 [thread overview]
Message-ID: <20200419131947.173685-1-sedat.dilek@gmail.com> (raw)
This patch is currently not mandatory but a prerequisites for the second one.
Folks from ClangBuiltLinux project like the combination of Clang compiler
and LLD linker from LLVM project to build their Linux kernels.
Sami Tolvanen <samitolvanen@google.com> has a patch for using LD_IS_LLD (see [1]).
Documentation/process/changes.rst says and uses "binutils" that's why I called
it LD_IS_BINUTILS (see [2] and [3]).
The second patch will rename existing LD_VERSION to BINUTILS_VERSION to have
a consistent naming convention like:
1. CC_IS_GCC and GCC_VERSION
2. CC_IS_CLANG and CLANG_VERSION
3. LD_IS_BINUTILS and BINUTILS_VERSION
[1] https://github.com/samitolvanen/linux/commit/61889e01f0ed4f07a9d631f163bba6c6637bfa46
[2] https://git.kernel.org/linus/tree/Documentation/process/changes.rst#n34
[3] https://git.kernel.org/linus/tree/Documentation/process/changes.rst#n76
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
init/Kconfig | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/init/Kconfig b/init/Kconfig
index 9e22ee8fbd75..520116efea0f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -16,9 +16,12 @@ config GCC_VERSION
default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC
default 0
+config LD_IS_BINUTILS
+ def_bool $(success,$(LD) -v | head -n 1 | grep -q 'GNU ld')
+
config LD_VERSION
int
- default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh)
+ default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh) if LD_IS_BINUTILS
config CC_IS_CLANG
def_bool $(success,$(CC) --version | head -n 1 | grep -q clang)
--
2.26.1
next reply other threads:[~2020-04-19 13:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-19 13:19 Sedat Dilek [this message]
2020-04-23 18:43 ` [RFC PATCH 1/2] kbuild: add CONFIG_LD_IS_BINUTILS Nick Desaulniers
2020-04-24 1:40 ` Masahiro Yamada
2020-04-24 5:18 ` Fangrui Song
2020-04-24 5:56 ` Sedat Dilek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200419131947.173685-1-sedat.dilek@gmail.com \
--to=sedat.dilek@gmail.com \
--cc=clang-built-linux@googlegroups.com \
--cc=dan.j.williams@intel.com \
--cc=ebiederm@xmission.com \
--cc=joel@joelfernandes.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=mhiramat@kernel.org \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).