[kbuild 1/5] Warn when building external modules without modversions

From: Andreas Gruenbacher
Date: Tue Jan 18 2005 - 14:38:33 EST


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.

The test works with CONFIG_MODVERSIONS enabled or disabled.

Signed-off-by: Andreas Gruenbacher <agruen@xxxxxxx>

Index: linux-2.6.11-rc1-bk6/Makefile
===================================================================
--- linux-2.6.11-rc1-bk6.orig/Makefile
+++ linux-2.6.11-rc1-bk6/Makefile
@@ -1093,9 +1093,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 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)

--
Andreas Gruenbacher <agruen@xxxxxxx>
SUSE Labs, SUSE LINUX PRODUCTS GMBH

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/