[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191003102915.28301-2-yamada.masahiro@socionext.com>
Date: Thu, 3 Oct 2019 19:29:13 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: linux-kbuild@...r.kernel.org
Cc: Sam Ravnborg <sam@...nborg.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Michal Marek <michal.lkml@...kovi.net>,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/4] modpost: do not parse vmlinux for external module builds
When building external modules, $(objtree)/Module.symvers is scanned
for symbol information of vmlinux and in-tree modules.
Additionally, vmlinux is parsed if it exists in $(objtree)/.
This is totally redundant since all the necessary information is
contained in $(objtree)/Module.symvers.
Do not parse vmlinux at all for external module builds. This makes
sense because vmlinux is deleted by 'make clean'.
'make clean' leaves all the build artifacts for building external
modules. vmlinux is unneeded for that.
Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---
scripts/Makefile.modpost | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 952fff485546..72109d201196 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -67,8 +67,12 @@ __modpost:
else
+MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T -
+
+ifeq ($(KBUILD_EXTMOD),)
+MODPOST += $(wildcard vmlinux)
+else
# When building external modules load the Kbuild file to retrieve EXTRA_SYMBOLS info
-ifneq ($(KBUILD_EXTMOD),)
# set src + obj - they may be used when building the .mod.c file
obj := $(KBUILD_EXTMOD)
@@ -79,8 +83,6 @@ include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
$(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)
endif
-MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - $(wildcard vmlinux)
-
# find all modules listed in modules.order
modules := $(sort $(shell cat $(MODORDER)))
--
2.17.1
Powered by blists - more mailing lists