From: Masahiro Yamada Date: Sat, 10 Aug 2019 15:52:59 +0000 (+0900) Subject: kbuild: fix modkern_aflags implementation X-Git-Tag: v5.4-rc1~105^2~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2290f3286b6d1f2058b905cc954243c6027c37a;p=platform%2Fkernel%2Flinux-rpi.git kbuild: fix modkern_aflags implementation For the single target building %.symtypes from %.S, $(a_flags) is expanded into the _KERNEL flags even if the object is a part of a module. $(real-obj-m:.o=.symtypes): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) ... would fix the issue, but it is not nice to duplicate similar code for every suffix. Implement modkern_aflags in the same way as modkern_cflags. Signed-off-by: Masahiro Yamada --- diff --git a/scripts/Makefile.build b/scripts/Makefile.build index c412068..f84ccca 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -309,10 +309,9 @@ $(obj)/%.h.s: $(src)/%.h FORCE # Compile assembler sources (.S) # --------------------------------------------------------------------------- -modkern_aflags := $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL) - -$(real-obj-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) -$(real-obj-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) +modkern_aflags = $(if $(part-of-module), \ + $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \ + $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)) # .S file exports must have their C prototypes defined in asm/asm-prototypes.h # or a file that it includes, in order to get versioned symbols. We build a