public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: use modpost-args-y to clean up modpost arguments
@ 2022-09-06 19:34 Masahiro Yamada
  2022-09-06 19:34 ` [PATCH 2/2] kbuild: re-run modpost stage when scripts/mod/modpost is updated Masahiro Yamada
  2022-09-07  5:26 ` [PATCH 1/2] kbuild: use modpost-args-y to clean up modpost arguments Nick Desaulniers
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2022-09-06 19:34 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Michal Marek, Nick Desaulniers

Separate the modpost executable (scripts/mod/modpost) and the command
parameters for the next commit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile                 |  2 +-
 scripts/Makefile.modpost | 22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index aee4f0769d9d..e07236209606 100644
--- a/Makefile
+++ b/Makefile
@@ -1908,7 +1908,7 @@ tags TAGS cscope gtags: FORCE
 # ---------------------------------------------------------------------------
 
 PHONY += nsdeps
-nsdeps: export KBUILD_NSDEPS=1
+nsdeps: export KBUILD_NSDEPS=y
 nsdeps: modules
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/nsdeps
 
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index ceb1d78140e7..87821a5fe16b 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -38,17 +38,17 @@ __modpost:
 include include/config/auto.conf
 include $(srctree)/scripts/Kbuild.include
 
-MODPOST = scripts/mod/modpost								\
-	$(if $(CONFIG_MODVERSIONS),-m)							\
-	$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a)					\
-	$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E)					\
-	$(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS))					\
-	$(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N)	\
-	-o $@
+MODPOST = scripts/mod/modpost
+
+modpost-args-$(CONFIG_MODVERSIONS)				+= -m
+modpost-args-$(CONFIG_MODULE_SRCVERSION_ALL)			+= -a
+modpost-args-$(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)	+= -N
+modpost-args-$(KBUILD_NSDEPS)					+= -N -d $(MODULES_NSDEPS)
+modpost-args-y += $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E)
 
 # 'make -i -k' ignores compile errors, and builds as many modules as possible.
 ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),)
-MODPOST += -n
+modpost-args-y += -n
 endif
 
 ifeq ($(KBUILD_EXTMOD),)
@@ -99,12 +99,12 @@ module.symvers-if-present := $(wildcard Module.symvers)
 output-symdump := $(KBUILD_EXTMOD)/Module.symvers
 missing-input := $(filter-out $(module.symvers-if-present), Module.symvers)
 
-MODPOST += -e $(addprefix -i ,$(module.symvers-if-present) $(KBUILD_EXTRA_SYMBOLS))
+modpost-args-y += -e $(addprefix -i ,$(module.symvers-if-present) $(KBUILD_EXTRA_SYMBOLS))
 
 endif # ($(KBUILD_EXTMOD),)
 
 ifneq ($(KBUILD_MODPOST_WARN)$(missing-input),)
-MODPOST += -w
+modpost-args-y += -w
 endif
 
 modorder-if-needed := $(if $(KBUILD_MODULES), $(MODORDER))
@@ -117,7 +117,7 @@ quiet_cmd_modpost = MODPOST $@
 		echo >&2 "WARNING: $(missing-input) is missing."; \
 		echo >&2 "         Modules may not have dependencies or modversions."; \
 		echo >&2 "         You may get many unresolved symbol warnings.";) \
-	sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(vmlinux.o-if-present) -T -
+	sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args-y) $(vmlinux.o-if-present) -T - -o $@
 
 targets += $(output-symdump)
 $(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) FORCE
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-15  6:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-06 19:34 [PATCH 1/2] kbuild: use modpost-args-y to clean up modpost arguments Masahiro Yamada
2022-09-06 19:34 ` [PATCH 2/2] kbuild: re-run modpost stage when scripts/mod/modpost is updated Masahiro Yamada
2022-09-07  5:26 ` [PATCH 1/2] kbuild: use modpost-args-y to clean up modpost arguments Nick Desaulniers
2022-09-15  6:07   ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox