Skip to content

Commit 735aec5

Browse files
committed
kbuild: readd -w option when vmlinux.o or Module.symver is missing
Commit 63ffe00 ("kbuild: Fix running modpost with musl libc") accidentally turned the unresolved symbol warnings into errors when vmlinux.o (for in-tree builds) or Module.symver (for external module builds) is missing. In those cases, unresolved symbols are expected, but the -w option is not set because 'missing-input' is referenced before set. Move $(missing-input) back to the original place. This should be fine for musl libc because vmlinux.o and -w are not added at the same time. With this change, -w may be passed twice, but it is not a big deal. Link: https://lore.kernel.org/all/[email protected]/ Fixes: 63ffe00 ("kbuild: Fix running modpost with musl libc") Reported-by: Christopher Schramm <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Samuel Holland <[email protected]>
1 parent a53da43 commit 735aec5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/Makefile.modpost

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ modpost-args = \
4444
$(if $(CONFIG_MODVERSIONS),-m) \
4545
$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \
4646
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
47+
$(if $(KBUILD_MODPOST_WARN),-w) \
4748
$(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \
4849
$(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \
4950
-o $@
@@ -55,10 +56,6 @@ ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),)
5556
modpost-args += -n
5657
endif
5758

58-
ifneq ($(KBUILD_MODPOST_WARN)$(missing-input),)
59-
modpost-args += -w
60-
endif
61-
6259
# Read out modules.order to pass in modpost.
6360
# Otherwise, allmodconfig would fail with "Argument list too long".
6461
ifdef KBUILD_MODULES
@@ -124,6 +121,10 @@ modpost-args += -e $(addprefix -i , $(KBUILD_EXTRA_SYMBOLS))
124121

125122
endif # ($(KBUILD_EXTMOD),)
126123

124+
ifneq ($(missing-input),)
125+
modpost-args += -w
126+
endif
127+
127128
quiet_cmd_modpost = MODPOST $@
128129
cmd_modpost = \
129130
$(if $(missing-input), \

0 commit comments

Comments
 (0)