path: root/Makefile
diff options
authorRasmus Villemoes <>2021-03-05 11:02:12 +0100
committerMasahiro Yamada <>2021-04-25 05:12:32 +0900
commit0b956e204132ce3fe4221a062638bf83a30e6200 (patch)
treed9da74a93307567eb8390c1a72a2e040974c7ea3 /Makefile
parent5cc1247204616528b427e276c97c5bc4c9612347 (diff)
kbuild: apply fixdep logic to
The patch adding CONFIG_VMLINUX_MAP revealed a small defect in the build system: takes decisions based on CONFIG_* options, but changing one of those does not always lead to vmlinux being linked again. For most of the CONFIG_* knobs referenced previously, this has probably been hidden by those knobs also affecting some object file, hence indirectly also vmlinux. But CONFIG_VMLINUX_MAP is only handled inside, and changing CONFIG_VMLINUX_MAP=n to CONFIG_VMLINUX_MAP=y does not cause the build system to re-link (and hence have emitted). Since that map file is mostly a debugging aid, this is merely a nuisance which is easily worked around by just deleting vmlinux and building again. But one could imagine other (possibly future) CONFIG options that actually do affect the vmlinux binary but which are not captured through some object file dependency. To fix this, make emit a .vmlinux.d file in the same format as the dependency files generated by gcc, and apply the fixdep logic to that. I've tested that this correctly works with both in-tree and out-of-tree builds. Signed-off-by: Rasmus Villemoes <> Signed-off-by: Masahiro Yamada <>
Diffstat (limited to 'Makefile')
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 80c82155ebb6..03e3ee982f14 100644
--- a/Makefile
+++ b/Makefile
@@ -1213,7 +1213,7 @@ cmd_link-vmlinux = \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
vmlinux: scripts/ autoksyms_recursive $(vmlinux-deps) FORCE
- +$(call if_changed,link-vmlinux)
+ +$(call if_changed_dep,link-vmlinux)
targets := vmlinux