Skip to content

Commit

Permalink
modpost: do not parse vmlinux for external module builds
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
masahir0y committed Nov 11, 2019
1 parent fab546e commit 1747269
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/Makefile.modpost
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ __modpost:

else

ifneq ($(KBUILD_EXTMOD),)
MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T -

ifeq ($(KBUILD_EXTMOD),)
MODPOST += $(wildcard vmlinux)
else

# set src + obj - they may be used in the modules's Makefile
obj := $(KBUILD_EXTMOD)
Expand All @@ -78,8 +82,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)))

Expand Down

0 comments on commit 1747269

Please sign in to comment.