aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe@linaro.org>2022-07-22 15:17:29 +0100
committerWill Deacon <will@kernel.org>2022-08-04 15:51:33 +0100
commit3863f34bd76723358b4ec7d44a12a4b6b990ceb5 (patch)
tree7b232b5a58ec58c3bb04740fabeba65f220ff0e3
parent6a1f699108e5c2a280d7cd1f1ae4816b8250a29f (diff)
downloadkvmtool-3863f34bd76723358b4ec7d44a12a4b6b990ceb5.tar.gz
Makefile: Add missing build dependencies
When running kvmtool after updating without doing a make clean, one might run into strange issues such as: Warning: Failed init: symbol_init Fatal: Initialisation failed or worse. This happens because symbol.o is not automatically rebuilt after a change of headers, because .symbol.o.d is not in the $(DEPS) variable. So if the layout of struct kvm_config changes, for example, symbols.o that was built for an older version will try to read kvm->vmlinux from the wrong location in struct kvm, and lkvm will die. Add all .d files to $(DEPS). Also include $(STATIC_DEPS) which was previously set but not used. Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Link: https://lore.kernel.org/r/20220722141731.64039-2-jean-philippe@linaro.org Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1f9903d8..f0df76f4 100644
--- a/Makefile
+++ b/Makefile
@@ -383,7 +383,7 @@ comma = ,
# The dependency file for the current target
depfile = $(subst $(comma),_,$(dir $@).$(notdir $@).d)
-DEPS := $(foreach obj,$(OBJS),\
+DEPS := $(foreach obj,$(OBJS) $(OBJS_DYNOPT) $(OTHEROBJS) $(GUEST_OBJS),\
$(subst $(comma),_,$(dir $(obj)).$(notdir $(obj)).d))
DEFINES += -D_FILE_OFFSET_BITS=64
@@ -590,6 +590,7 @@ cscope:
# Escape redundant work on cleaning up
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPS)
+-include $(STATIC_DEPS)
KVMTOOLS-VERSION-FILE:
@$(SHELL_PATH) util/KVMTOOLS-VERSION-GEN $(OUTPUT)