aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2003-01-24 09:52:47 -0600
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2003-01-24 09:52:47 -0600
commite4ccd604a353b3d4e61e99d04ac9a2bdd8b66ec4 (patch)
treec49b53a7701f5fa94e43a7194fa8df9a3d7660d9 /Makefile
parentcaa9e0e04c20ce4f6884066cb2f4d4e33db07178 (diff)
downloadhistory-e4ccd604a353b3d4e61e99d04ac9a2bdd8b66ec4.tar.gz
kbuild: Don't build final .ko yet when descending with CONFIG_MODVERSIONING
With CONFIG_MODVERSIONING, we need to record the versions of the unresolved symbols in the final <module>.ko, which we only know after we finished the descending build. So we only build <module>.o in that case. Also, keep track of the modules we built, the post-processing step needs a list of all modules. Keeping track is done by touching .tmp_versions/path/to/module.ko
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 8b0f647bb9996..308673b8b2e5e 100644
--- a/Makefile
+++ b/Makefile
@@ -260,6 +260,20 @@ ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer
endif
+# When we're building modules with modversions, we need to consider
+# the built-in objects during the descend as well, in order to
+# make sure the checksums are uptodate before we use them.
+
+ifdef CONFIG_MODVERSIONING
+ifeq ($(KBUILD_MODULES),1)
+ifneq ($(KBUILD_BUILTIN),1)
+ KBUILD_BUILTIN := 1
+endif
+endif
+endif
+
+export MODVERDIR := .tmp_versions
+
#
# INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root.
@@ -388,6 +402,16 @@ $(SUBDIRS): prepare
.PHONY: prepare
prepare: include/linux/version.h include/asm include/config/MARKER
+ifdef CONFIG_MODVERSIONING
+ifdef KBUILD_MODULES
+ifeq ($(origin SUBDIRS),file)
+ $(Q)rm -rf $(MODVERDIR)
+else
+ @echo '*** Warning: Overriding SUBDIRS on the command line can cause'
+ @echo '*** inconsistencies with module symbol versions'
+endif
+endif
+endif
@echo ' Starting the build. KBUILD_BUILTIN=$(KBUILD_BUILTIN) KBUILD_MODULES=$(KBUILD_MODULES)'
# We need to build init/vermagic.o before descending since all modules