]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
modpost: pass -N option only for modules modpost
authorMasahiro Yamada <masahiroy@kernel.org>
Mon, 1 Jun 2020 05:57:03 +0000 (14:57 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 3 Jun 2020 04:22:17 +0000 (13:22 +0900)
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>
scripts/Makefile.modpost

index ac143c0851829905bb1a197472ea1bf9e3afe225..3334f100a4909419ba2e140ab51a1e028ab00a32 100644 (file)
@@ -53,7 +53,6 @@ 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 $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N)       \
        $(if $(KBUILD_MODPOST_WARN),-w)
 
 ifdef MODPOST_VMLINUX
@@ -82,6 +81,10 @@ include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
              $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)
 endif
 
+# modpost options for modules (both in-kernel and external)
+MODPOST += \
+       $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N)
+
 # 'make -i -k' ignores compile errors, and builds as many modules as possible.
 ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),)
 MODPOST += -n