public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH kbuild RFC] kbuild: fix modpost throwing away module symvers when linking vmlinux.o
@ 2020-05-01 22:43 Marek Behún
  2020-05-02 18:29 ` Marek Behun
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Behún @ 2020-05-01 22:43 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Marek Behún, Masahiro Yamada, Michal Marek

If vmlinux.o is rebuilt after modules, the current modpost code throws
away the information already stored in Module.symvers. This is due to
commit mentioned in the Fixes tag, which introduced this
backward-incompatible change which may break ceratin build systems (such
as that of OpenWRT).

Add code to look if modules.order is present when doing modpost for
vmlinux.o, and if it is, include it in modpost.

The change introduced here is ugly, therefore this is only a RFC patch.
Please comment whether fixing this backward-incompatibility is
acceptable.

Fixes: a721588d9475 ("kbuild: modpost: do not parse unnecessary ...")
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 scripts/Makefile.modpost | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 952fff485546..d1eb4923e21b 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -60,7 +60,12 @@ MODPOST = scripts/mod/modpost						\
 ifdef MODPOST_VMLINUX
 
 quiet_cmd_modpost = MODPOST vmlinux.o
+ifeq ($(wildcard $(MODORDER)),)
       cmd_modpost = $(MODPOST) vmlinux.o
+else
+MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T -
+      cmd_modpost = sed 's/ko$$/o/' $(MODORDER) | $(MODPOST) vmlinux.o
+endif
 
 __modpost:
 	$(call cmd,modpost)
-- 
2.24.1

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

end of thread, other threads:[~2020-05-16  2:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-01 22:43 [PATCH kbuild RFC] kbuild: fix modpost throwing away module symvers when linking vmlinux.o Marek Behún
2020-05-02 18:29 ` Marek Behun
2020-05-16  2:44   ` Masahiro Yamada

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