modpost: do not invoke extra modpost for nsdeps

'make nsdeps' invokes the modpost three times at most; before linking
vmlinux, before building modules, and finally for generating .ns_deps
files. Running the modpost again and again is not efficient.

The last two can be unified. When the -d option is given, the modpost
still does the usual job, and in addition, generates .ns_deps files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Matthias Maennich <maennich@google.com>
Reviewed-by: Matthias Maennich <maennich@google.com>
This commit is contained in:
Masahiro Yamada
2019-10-29 21:38:06 +09:00
parent faade96102
commit bff9c62b5d
3 changed files with 7 additions and 15 deletions

View File

@@ -53,8 +53,7 @@ MODPOST = scripts/mod/modpost \
$(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
$(if $(KBUILD_MODPOST_WARN),-w) \
$(if $(filter nsdeps,$(MAKECMDGOALS)),-d)
$(if $(KBUILD_MODPOST_WARN),-w)
ifdef MODPOST_VMLINUX
@@ -66,7 +65,8 @@ __modpost:
else
MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T -
MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - \
$(if $(KBUILD_NSDEPS),-d)
ifeq ($(KBUILD_EXTMOD),)
MODPOST += $(wildcard vmlinux)
@@ -96,8 +96,6 @@ ifneq ($(KBUILD_MODPOST_NOFINAL),1)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modfinal
endif
nsdeps: __modpost
endif
.PHONY: $(PHONY)