mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: readd -w option when vmlinux.o or Module.symver is missing
@ 2023-01-04 14:04 Masahiro Yamada
  2023-01-05  3:34 ` Samuel Holland
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2023-01-04 14:04 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Christopher Schramm,
	Nathan Chancellor, Nick Desaulniers, Nicolas Schier,
	Samuel Holland

Commit 63ffe00d8c93 ("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/b56a03b8-2a2a-f833-a5d2-cdc50a7ca2bb@cschramm.eu/
Fixes: 63ffe00d8c93 ("kbuild: Fix running modpost with musl libc")
Reported-by: Christopher Schramm <debian@cschramm.eu>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/Makefile.modpost | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 0ee296cf520c..43343e13c542 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -44,6 +44,7 @@ modpost-args =										\
 	$(if $(CONFIG_MODVERSIONS),-m)							\
 	$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a)					\
 	$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E)					\
+	$(if $(KBUILD_MODPOST_WARN),-w)							\
 	$(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS))					\
 	$(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N)	\
 	-o $@
@@ -55,10 +56,6 @@ ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),)
 modpost-args += -n
 endif
 
-ifneq ($(KBUILD_MODPOST_WARN)$(missing-input),)
-modpost-args += -w
-endif
-
 # Read out modules.order to pass in modpost.
 # Otherwise, allmodconfig would fail with "Argument list too long".
 ifdef KBUILD_MODULES
@@ -124,6 +121,10 @@ modpost-args += -e $(addprefix -i , $(KBUILD_EXTRA_SYMBOLS))
 
 endif # ($(KBUILD_EXTMOD),)
 
+ifneq ($(missing-input),)
+modpost-args += -w
+endif
+
 quiet_cmd_modpost = MODPOST $@
       cmd_modpost = \
 	$(if $(missing-input), \
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: readd -w option when vmlinux.o or Module.symver is missing
  2023-01-04 14:04 [PATCH] kbuild: readd -w option when vmlinux.o or Module.symver is missing Masahiro Yamada
@ 2023-01-05  3:34 ` Samuel Holland
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Holland @ 2023-01-05  3:34 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kernel, Christopher Schramm, Nathan Chancellor,
	Nick Desaulniers, Nicolas Schier, linux-kbuild

On 1/4/23 08:04, Masahiro Yamada wrote:
> Commit 63ffe00d8c93 ("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/b56a03b8-2a2a-f833-a5d2-cdc50a7ca2bb@cschramm.eu/
> Fixes: 63ffe00d8c93 ("kbuild: Fix running modpost with musl libc")
> Reported-by: Christopher Schramm <debian@cschramm.eu>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/Makefile.modpost | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Sorry for the breakage. This works fine for me, with or without vmlinux.o.

Tested-by: Samuel Holland <samuel@sholland.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-05  3:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 14:04 [PATCH] kbuild: readd -w option when vmlinux.o or Module.symver is missing Masahiro Yamada
2023-01-05  3:34 ` Samuel Holland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®