Commit 38759db6 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Sam Ravnborg

kbuild: Warn when building external modules without modversions

This adds a warning when building external modules (M= or SUBDIRS=
syntax) and there is no Module.symvers in the object tree. A missing
Module.symvers is a clear sign that the kernel tree itself was never
compiled. The resulting modules will work, but no symbol version
information will be attached to kernel symbols the module uses (because
that information comes from Module.symvers), and so the module will be
more unsafe.
Futhermore the external module will not record what other modules it is
depended on.

The test works with CONFIG_MODVERSIONS enabled or disabled.
Signed-off-by: default avatarAndreas Gruenbacher <agruen@suse.de>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent a29c189e
......@@ -1094,9 +1094,17 @@ KBUILD_MODULES := 1
crmodverdir:
$(Q)mkdir -p $(MODVERDIR)
.PHONY: $(objtree)/Module.symvers
$(objtree)/Module.symvers:
@test -e $(objtree)/Module.symvers || ( \
echo; \
echo "WARNING: Symbol version dump $(objtree)/Module.symvers is " \
"missing; modules will have no dependencies and modversions."; \
echo )
module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))
.PHONY: $(module-dirs) modules
$(module-dirs): crmodverdir
$(module-dirs): crmodverdir $(objtree)/Module.symvers
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
modules: $(module-dirs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment