From: Greg Hackmann <ghackmann@google.com>
To: Nick Desaulniers <ndesaulniers@google.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Stefan Agner <stefan@agner.ch>,
Matthias Kaehlcke <mka@chromium.org>,
joel@jms.id.au, Nathan Chancellor <natechancellor@gmail.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags
Date: Fri, 9 Nov 2018 10:34:22 -0800 [thread overview]
Message-ID: <9c4868dd-82fa-aa5c-843e-e1f78ffbc7e2@google.com> (raw)
In-Reply-To: <CAKwvOd=JwjVu=uk3egVJxTm9vPcF=Jx2Bexx1Wx=Z-PC38X3Uw@mail.gmail.com>
On 11/09/2018 10:29 AM, Nick Desaulniers wrote:
> On Mon, Nov 5, 2018 at 7:05 PM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>>
>> Collect basic Clang options such as --target, --prefix, --gcc-toolchain,
>> -no-integrated-as into a single variable CLANG_FLAGS so that it can be
>> easily reused in other parts of Makefile.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> ---
>>
>> Changes in v2:
>> - Use := flavor instead of = because $(CLANG_FLAGS) is expanded soon anyway
>>
>> Makefile | 13 ++++++-------
>> 1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index da11700..e173a73 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -487,18 +487,17 @@ endif
>>
>> ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
>> ifneq ($(CROSS_COMPILE),)
>> -CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
>> +CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
>> GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
>> -CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR)
>> +CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)
>> GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
>> endif
>> ifneq ($(GCC_TOOLCHAIN),)
>> -CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
>> +CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
>> endif
>> -KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
>> -KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
>> -KBUILD_CFLAGS += -no-integrated-as
>> -KBUILD_AFLAGS += -no-integrated-as
>> +CLANG_FLAGS += -no-integrated-as
>> +KBUILD_CFLAGS += $(CLANG_FLAGS)
>> +KBUILD_AFLAGS += $(CLANG_FLAGS)
>> endif
>>
>> RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
>> --
>> 2.7.4
>>
>
> Thanks for this patch, Masahiro, it's a good simplification.
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
> Tested-by: Nick Desaulniers <ndesaulniers@google.com>
>
> Would you mind waiting for a tested-by from Stefan, and maybe an ack
> from Greg (added to cc)?
>
Acked-by: Greg Hackmann <ghackmann@google.com>
next prev parent reply other threads:[~2018-11-10 0:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 3:04 [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally Masahiro Yamada
2018-11-06 3:04 ` [PATCH v2 2/2] kbuild: consolidate Clang compiler flags Masahiro Yamada
2018-11-09 18:29 ` Nick Desaulniers
2018-11-09 18:34 ` Greg Hackmann [this message]
2018-11-11 14:03 ` Masahiro Yamada
2018-11-12 1:05 ` Michael Ellerman
2018-11-12 3:28 ` Masahiro Yamada
2018-11-12 4:22 ` Joel Stanley
2018-11-13 23:25 ` Masahiro Yamada
2018-11-09 18:08 ` [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally Nick Desaulniers
2018-11-13 23:24 ` Masahiro Yamada
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=9c4868dd-82fa-aa5c-843e-e1f78ffbc7e2@google.com \
--to=ghackmann@google.com \
--cc=joel@jms.id.au \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michal.lkml@markovi.net \
--cc=mka@chromium.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=stefan@agner.ch \
--cc=yamada.masahiro@socionext.com \
/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).