Skip to content

Commit 4bd04b2

Browse files
masahir0yglaubitz
authored andcommitted
sh: Remove compiler flag duplication
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 <[email protected]> Acked-by: Randy Dunlap <[email protected]> Tested-by: Randy Dunlap <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
1 parent 01658fe commit 4bd04b2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/sh/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,8 @@ cpuincdir-y += cpu-common # Must be last
145145

146146
drivers-y += arch/sh/drivers/
147147

148-
cflags-y += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y))
149-
148+
KBUILD_CPPFLAGS += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y))
150149
KBUILD_CFLAGS += -pipe $(cflags-y)
151-
KBUILD_CPPFLAGS += $(cflags-y)
152150
KBUILD_AFLAGS += $(cflags-y)
153151

154152
ifeq ($(CONFIG_MCOUNT),y)

0 commit comments

Comments
 (0)