@@ -962,8 +962,6 @@ endif
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
-$(filter-out $(init-y),$(vmlinux-deps)): KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
-$(filter-out $(init-y),$(vmlinux-deps)): KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
$(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Handle descending into subdirectories listed in $(vmlinux-dirs)
@@ -1016,13 +1014,10 @@ prepare1: prepare2 $(version_h)
include/generated/utsrelease.h
archprepare: archheaders archscripts prepare1 scripts_basic
-prepare0: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
-prepare0: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
prepare0: archprepare gcc-plugins FORCE
$(Q)$(MAKE) $(build)=.
# All the preparing..
-prepare: KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
prepare: prepare0 prepare-objtool
ifdef CONFIG_STACK_VALIDATION
@@ -1155,8 +1150,6 @@ all: modules
# using awk while concatenating to the final file.
PHONY += modules
-modules: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
-modules: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
$(Q)$(AWK) '!x[$$0]++'
$(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtre
@$(kecho) ' Building modules, stage 2.';
@@ -1446,8 +1439,6 @@ PHONY += $(module-dirs) modules
$(module-dirs): crmodverdir $(objtree)/Module.symvers
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
-modules: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
-modules: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
modules: $(module-dirs)
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1589,14 +1580,10 @@ else
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif
-%.s: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
-%.s: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
%.s: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.i: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-%.o: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
-%.o: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
%.o: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.lst: %.c prepare scripts FORCE
@@ -1615,14 +1602,10 @@ endif
$(build)=$(build-dir)
# Make sure the latest headers are built for Documentation
Documentation/: headers_install
-%/: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
-%/: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
%/: prepare scripts FORCE
$(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir)
-%.ko: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
-%.ko: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
%.ko: prepare scripts FORCE
$(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
@@ -26,4 +26,6 @@ ifdef CONFIG_GCC_PLUGINS
endif
endif
+ KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
+
endif