aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-08-10 11:52:59 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-08-14 13:25:11 -0400
commitc2290f3286b6d1f2058b905cc954243c6027c37a (patch)
tree926b08f95cb7ee97d9cd485a4f1795e99dd6f631 /scripts/Makefile.build
parent986662b90352d79c4842dd7d4e678f50824ed729 (diff)
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 <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index c41206880bf2..f84ccca8d74f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -309,10 +309,9 @@ $(obj)/%.h.s: $(src)/%.h FORCE
309# Compile assembler sources (.S) 309# Compile assembler sources (.S)
310# --------------------------------------------------------------------------- 310# ---------------------------------------------------------------------------
311 311
312modkern_aflags := $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL) 312modkern_aflags = $(if $(part-of-module), \
313 313 $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \
314$(real-obj-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) 314 $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL))
315$(real-obj-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
316 315
317# .S file exports must have their C prototypes defined in asm/asm-prototypes.h 316# .S file exports must have their C prototypes defined in asm/asm-prototypes.h
318# or a file that it includes, in order to get versioned symbols. We build a 317# or a file that it includes, in order to get versioned symbols. We build a