* [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally @ 2018-11-06 3:04 Masahiro Yamada 2018-11-06 3:04 ` [PATCH v2 2/2] kbuild: consolidate Clang compiler flags Masahiro Yamada ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: Masahiro Yamada @ 2018-11-06 3:04 UTC (permalink / raw) To: linux-kbuild Cc: Nick Desaulniers, Stefan Agner, Matthias Kaehlcke, Joel Stanley, linuxppc-dev, Michael Ellerman, Masahiro Yamada, Michal Marek, linux-kernel We are still a way off the Clang's integrated assembler support for the kernel. Hence, -no-integrated-as is mandatory to build the kernel with Clang. If you had an ancient version of Clang that does not recognize this option, you would not be able to compile the kernel anyway. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> --- Changes in v2: - New patch Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 93315eb..da11700 100644 --- a/Makefile +++ b/Makefile @@ -497,8 +497,8 @@ CLANG_GCC_TC := --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 += $(call cc-option, -no-integrated-as) -KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) +KBUILD_CFLAGS += -no-integrated-as +KBUILD_AFLAGS += -no-integrated-as endif RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/2] kbuild: consolidate Clang compiler flags 2018-11-06 3:04 [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally Masahiro Yamada @ 2018-11-06 3:04 ` Masahiro Yamada 2018-11-09 18:29 ` Nick Desaulniers 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 2 siblings, 2 replies; 11+ messages in thread From: Masahiro Yamada @ 2018-11-06 3:04 UTC (permalink / raw) To: linux-kbuild Cc: Nick Desaulniers, Stefan Agner, Matthias Kaehlcke, Joel Stanley, linuxppc-dev, Michael Ellerman, Masahiro Yamada, Michal Marek, linux-kernel 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 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags 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 2018-11-13 23:25 ` Masahiro Yamada 1 sibling, 1 reply; 11+ messages in thread From: Nick Desaulniers @ 2018-11-09 18:29 UTC (permalink / raw) To: Masahiro Yamada Cc: Linux Kbuild mailing list, Stefan Agner, Matthias Kaehlcke, joel, linuxppc-dev, mpe, Michal Marek, LKML, Greg Hackmann, Nathan Chancellor 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)? -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags 2018-11-09 18:29 ` Nick Desaulniers @ 2018-11-09 18:34 ` Greg Hackmann 2018-11-11 14:03 ` Masahiro Yamada 0 siblings, 1 reply; 11+ messages in thread From: Greg Hackmann @ 2018-11-09 18:34 UTC (permalink / raw) To: Nick Desaulniers, Masahiro Yamada Cc: Linux Kbuild mailing list, Stefan Agner, Matthias Kaehlcke, joel, linuxppc-dev, mpe, Michal Marek, LKML, Nathan Chancellor 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> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags 2018-11-09 18:34 ` Greg Hackmann @ 2018-11-11 14:03 ` Masahiro Yamada 2018-11-12 1:05 ` Michael Ellerman 0 siblings, 1 reply; 11+ messages in thread From: Masahiro Yamada @ 2018-11-11 14:03 UTC (permalink / raw) To: Greg Hackmann, Joel Stanley, Nick Desaulniers Cc: Linux Kbuild mailing list, Stefan Agner, Matthias Kaehlcke, linuxppc-dev, Michael Ellerman, Michal Marek, Linux Kernel Mailing List, Nathan Chancellor On Sat, Nov 10, 2018 at 3:35 AM Greg Hackmann <ghackmann@google.com> wrote: > > 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> Thanks for your review! So, how to organize this series, and Joel's one together? I'd like Joel to use this series as a base for his work. (https://lore.kernel.org/patchwork/patch/1006696/) It will be much cleaner. Shall I merge all the patches to kbuild tree, or maybe will they go through powerpc tree? -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags 2018-11-11 14:03 ` Masahiro Yamada @ 2018-11-12 1:05 ` Michael Ellerman 2018-11-12 3:28 ` Masahiro Yamada 0 siblings, 1 reply; 11+ messages in thread From: Michael Ellerman @ 2018-11-12 1:05 UTC (permalink / raw) To: Masahiro Yamada, Greg Hackmann, Joel Stanley, Nick Desaulniers Cc: Linux Kbuild mailing list, Stefan Agner, Matthias Kaehlcke, linuxppc-dev, Michal Marek, Linux Kernel Mailing List, Nathan Chancellor Masahiro Yamada <yamada.masahiro@socionext.com> writes: > On Sat, Nov 10, 2018 at 3:35 AM Greg Hackmann <ghackmann@google.com> wrote: >> >> 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> > > > Thanks for your review! > > > So, how to organize this series, and Joel's one together? > > I'd like Joel to use this series as a base for his work. > (https://lore.kernel.org/patchwork/patch/1006696/) > > It will be much cleaner. > > > Shall I merge all the patches to kbuild tree, or > maybe will they go through powerpc tree? Joel's changes are fairly small so you may as well merge them along with the rest of the series, if that's OK with you and Joel. cheers ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags 2018-11-12 1:05 ` Michael Ellerman @ 2018-11-12 3:28 ` Masahiro Yamada 2018-11-12 4:22 ` Joel Stanley 0 siblings, 1 reply; 11+ messages in thread From: Masahiro Yamada @ 2018-11-12 3:28 UTC (permalink / raw) To: Michael Ellerman Cc: Greg Hackmann, Joel Stanley, Nick Desaulniers, Linux Kbuild mailing list, Stefan Agner, Matthias Kaehlcke, linuxppc-dev, Michal Marek, Linux Kernel Mailing List, Nathan Chancellor On Mon, Nov 12, 2018 at 10:05 AM Michael Ellerman <mpe@ellerman.id.au> wrote: > > Masahiro Yamada <yamada.masahiro@socionext.com> writes: > > On Sat, Nov 10, 2018 at 3:35 AM Greg Hackmann <ghackmann@google.com> wrote: > >> > >> 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> > > > > > > Thanks for your review! > > > > > > So, how to organize this series, and Joel's one together? > > > > I'd like Joel to use this series as a base for his work. > > (https://lore.kernel.org/patchwork/patch/1006696/) > > > > It will be much cleaner. > > > > > > Shall I merge all the patches to kbuild tree, or > > maybe will they go through powerpc tree? > > Joel's changes are fairly small so you may as well merge them along with > the rest of the series, if that's OK with you and Joel. OK, I will. Joel, If you send v2, I will merge it to kbuild tree. Thanks. -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags 2018-11-12 3:28 ` Masahiro Yamada @ 2018-11-12 4:22 ` Joel Stanley 0 siblings, 0 replies; 11+ messages in thread From: Joel Stanley @ 2018-11-12 4:22 UTC (permalink / raw) To: Masahiro Yamada Cc: Michael Ellerman, ghackmann, Nick Desaulniers, linux-kbuild, stefan, mka, linuxppc-dev, Michal Marek, Linux Kernel Mailing List, natechancellor On Mon, 12 Nov 2018 at 13:59, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > > On Mon, Nov 12, 2018 at 10:05 AM Michael Ellerman <mpe@ellerman.id.au> wrote: > > > > Masahiro Yamada <yamada.masahiro@socionext.com> writes: > > > On Sat, Nov 10, 2018 at 3:35 AM Greg Hackmann <ghackmann@google.com> wrote: > > >> > > >> 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> > > > > > > > > > Thanks for your review! > > > > > > > > > So, how to organize this series, and Joel's one together? > > > > > > I'd like Joel to use this series as a base for his work. > > > (https://lore.kernel.org/patchwork/patch/1006696/) > > > > > > It will be much cleaner. > > > > > > > > > Shall I merge all the patches to kbuild tree, or > > > maybe will they go through powerpc tree? > > > > Joel's changes are fairly small so you may as well merge them along with > > the rest of the series, if that's OK with you and Joel. > > > OK, I will. > > > Joel, > If you send v2, I will merge it to kbuild tree. Thanks, I've done that now. Cheers, Joel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags 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-13 23:25 ` Masahiro Yamada 1 sibling, 0 replies; 11+ messages in thread From: Masahiro Yamada @ 2018-11-13 23:25 UTC (permalink / raw) To: Linux Kbuild mailing list Cc: Nick Desaulniers, Stefan Agner, Matthias Kaehlcke, Joel Stanley, linuxppc-dev, Michael Ellerman, Michal Marek, Linux Kernel Mailing List On Tue, Nov 6, 2018 at 12:06 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> > --- Applied to linux-kbuild. > 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 > -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally 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:08 ` Nick Desaulniers 2018-11-13 23:24 ` Masahiro Yamada 2 siblings, 0 replies; 11+ messages in thread From: Nick Desaulniers @ 2018-11-09 18:08 UTC (permalink / raw) To: Masahiro Yamada Cc: Linux Kbuild mailing list, Stefan Agner, Matthias Kaehlcke, joel, linuxppc-dev, mpe, Michal Marek, LKML On Mon, Nov 5, 2018 at 7:05 PM Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > > We are still a way off the Clang's integrated assembler support for > the kernel. Hence, -no-integrated-as is mandatory to build the kernel > with Clang. If you had an ancient version of Clang that does not > recognize this option, you would not be able to compile the kernel > anyway. > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> > --- > > Changes in v2: > - New patch > > Makefile | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 93315eb..da11700 100644 > --- a/Makefile > +++ b/Makefile > @@ -497,8 +497,8 @@ CLANG_GCC_TC := --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 += $(call cc-option, -no-integrated-as) > -KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) > +KBUILD_CFLAGS += -no-integrated-as > +KBUILD_AFLAGS += -no-integrated-as Sorry for the delay in review. Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Tested-by: Nick Desaulniers <ndesaulniers@google.com> > endif > > RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register > -- > 2.7.4 > -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally 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:08 ` [PATCH v2 1/2] kbuild: add -no-integrated-as Clang option unconditionally Nick Desaulniers @ 2018-11-13 23:24 ` Masahiro Yamada 2 siblings, 0 replies; 11+ messages in thread From: Masahiro Yamada @ 2018-11-13 23:24 UTC (permalink / raw) To: Linux Kbuild mailing list Cc: Nick Desaulniers, Stefan Agner, Matthias Kaehlcke, Joel Stanley, linuxppc-dev, Michael Ellerman, Michal Marek, Linux Kernel Mailing List On Tue, Nov 6, 2018 at 12:06 PM Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > > We are still a way off the Clang's integrated assembler support for > the kernel. Hence, -no-integrated-as is mandatory to build the kernel > with Clang. If you had an ancient version of Clang that does not > recognize this option, you would not be able to compile the kernel > anyway. > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> > --- Applied to linux-kbuild. > > Changes in v2: > - New patch > > Makefile | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 93315eb..da11700 100644 > --- a/Makefile > +++ b/Makefile > @@ -497,8 +497,8 @@ CLANG_GCC_TC := --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 += $(call cc-option, -no-integrated-as) > -KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) > +KBUILD_CFLAGS += -no-integrated-as > +KBUILD_AFLAGS += -no-integrated-as > endif > > RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register > -- > 2.7.4 > -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-11-13 23:26 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 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
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).