Message ID | 20230219141555.2308306-4-masahiroy@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/4] sh: fix -Wmissing-include-dirs warnings for various platforms | expand |
On 2/19/23 06:15, Masahiro Yamada wrote: > Every compiler flag added by arch/sh/Makefile is passed to the > compiler twice. > > $(KBUILD_CPPFLAGS) + $(KBUILD_CFLAGS) is used for compiling *.c > $(KBUILD_CPPFLAGS) + $(KBUILD_AFLAGS) is used for compiling *.S > > Given the above, adding $(cflags-y) to all of KBUILD_{CPP/C/A}FLAGS > ends up with duplication. > > Add -I options to $(KBUILD_CPPFLAGS), and the rest of $(cflags-y) > to KBUILD_{C,A}FLAGS. > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> Thanks. > --- > > arch/sh/Makefile | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/arch/sh/Makefile b/arch/sh/Makefile > index f1c6aace8acb..cab2f9c011a8 100644 > --- a/arch/sh/Makefile > +++ b/arch/sh/Makefile > @@ -145,10 +145,8 @@ cpuincdir-y += cpu-common # Must be last > > drivers-y += arch/sh/drivers/ > > -cflags-y += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y)) > - > +KBUILD_CPPFLAGS += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y)) > KBUILD_CFLAGS += -pipe $(cflags-y) > -KBUILD_CPPFLAGS += $(cflags-y) > KBUILD_AFLAGS += $(cflags-y) > > ifeq ($(CONFIG_MCOUNT),y)
On Sun, 2023-02-19 at 23:15 +0900, Masahiro Yamada wrote: > Every compiler flag added by arch/sh/Makefile is passed to the > compiler twice. > > $(KBUILD_CPPFLAGS) + $(KBUILD_CFLAGS) is used for compiling *.c > $(KBUILD_CPPFLAGS) + $(KBUILD_AFLAGS) is used for compiling *.S > > Given the above, adding $(cflags-y) to all of KBUILD_{CPP/C/A}FLAGS > ends up with duplication. > > Add -I options to $(KBUILD_CPPFLAGS), and the rest of $(cflags-y) > to KBUILD_{C,A}FLAGS. > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > --- > > arch/sh/Makefile | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/arch/sh/Makefile b/arch/sh/Makefile > index f1c6aace8acb..cab2f9c011a8 100644 > --- a/arch/sh/Makefile > +++ b/arch/sh/Makefile > @@ -145,10 +145,8 @@ cpuincdir-y += cpu-common # Must be last > > drivers-y += arch/sh/drivers/ > > -cflags-y += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y)) > - > +KBUILD_CPPFLAGS += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y)) > KBUILD_CFLAGS += -pipe $(cflags-y) > -KBUILD_CPPFLAGS += $(cflags-y) > KBUILD_AFLAGS += $(cflags-y) > > ifeq ($(CONFIG_MCOUNT),y) Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index f1c6aace8acb..cab2f9c011a8 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -145,10 +145,8 @@ cpuincdir-y += cpu-common # Must be last drivers-y += arch/sh/drivers/ -cflags-y += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y)) - +KBUILD_CPPFLAGS += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y)) KBUILD_CFLAGS += -pipe $(cflags-y) -KBUILD_CPPFLAGS += $(cflags-y) KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y)
Every compiler flag added by arch/sh/Makefile is passed to the compiler twice. $(KBUILD_CPPFLAGS) + $(KBUILD_CFLAGS) is used for compiling *.c $(KBUILD_CPPFLAGS) + $(KBUILD_AFLAGS) is used for compiling *.S Given the above, adding $(cflags-y) to all of KBUILD_{CPP/C/A}FLAGS ends up with duplication. Add -I options to $(KBUILD_CPPFLAGS), and the rest of $(cflags-y) to KBUILD_{C,A}FLAGS. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> --- arch/sh/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)