]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
kbuild: fix modkern_aflags implementation
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 10 Aug 2019 15:52:59 +0000 (00:52 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 14 Aug 2019 17:25:11 +0000 (02:25 +0900)
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 <yamada.masahiro@socionext.com>
scripts/Makefile.build

index c41206880bf26ceb1525ce12759d84bb61835ba0..f84ccca8d74fb0e897b64ae090aea78ad7b6eed2 100644 (file)
@@ -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