Skip to content

Commit 4e5ab74

Browse files
committed
modpost: pass -N option only for modules modpost
The built-in only code is not required to have MODULE_IMPORT_NS() to use symbols. So, the namespace is not checked for vmlinux(.o). Do not pass the meaningless -N option to the first pass of modpost. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 89d6117 commit 4e5ab74

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎scripts/Makefile.modpost‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ MODPOST = scripts/mod/modpost \
5353
$(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \
5454
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
5555
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
56-
$(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \
5756
$(if $(KBUILD_MODPOST_WARN),-w)
5857

5958
ifdef MODPOST_VMLINUX
@@ -82,6 +81,10 @@ include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
8281
$(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)
8382
endif
8483

84+
# modpost options for modules (both in-kernel and external)
85+
MODPOST += \
86+
$(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N)
87+
8588
# 'make -i -k' ignores compile errors, and builds as many modules as possible.
8689
ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),)
8790
MODPOST += -n

0 commit comments

Comments
 (0)