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.
Unified · Split
| @@ -53,7 +53,6 @@ MODPOST = scripts/mod/modpost \ · 52 unmodified lines | ||
| 53 | 53 | $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \ |
| 54 | 54 | $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ |
| 55 | 55 | $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ |
| 56 | − $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ | |
| 57 | 56 | $(if $(KBUILD_MODPOST_WARN),-w) |
| 58 | 57 | |
| 59 | 58 | ifdef MODPOST_VMLINUX |
| @@ -82,6 +81,10 @@ include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \ · 22 unmodified lines | ||
| 82 | 81 | $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile) |
| 83 | 82 | endif |
| 84 | 83 | |
| 84 | +# modpost options for modules (both in-kernel and external) | |
| 85 | +MODPOST += \ | |
| 86 | + $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) | |
| 87 | + | |
| 85 | 88 | # 'make -i -k' ignores compile errors, and builds as many modules as possible. |
| 86 | 89 | ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),) |
| 87 | 90 | MODPOST += -n |