summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2016-01-26 21:50:18 -0500
committerNicolas Pitre <nicolas.pitre@linaro.org>2016-03-29 16:30:57 -0400
commit23121ca2b56b583c43512e4d7a926343be937714 (patch)
tree19b0d865046cd3163046aa52124947c0e89d1c2f /Makefile
parentc1a95fda2a40ae8c7aad3fa44fa7718a3710eb2d (diff)
kbuild: create/adjust generated/autoksyms.h
Given the list of exported symbols needed by all modules, we can create a header file containing preprocessor defines for each of those symbols. Also, when some symbols are added and/or removed from the list, we can update the time on the corresponding files used as build dependencies for those symbols. And finally, if any symbol did change state, the corresponding source files must be rebuilt. The insertion or removal of an EXPORT_SYMBOL() entry within a module may create or remove the need for another exported symbol. This is why this operation has to be repeated until the list of needed exported symbols becomes stable. Only then the final kernel and modules link take place. Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 451acbebee97..9f93d2595d25 100644
--- a/Makefile
+++ b/Makefile
@@ -933,6 +933,10 @@ quiet_cmd_link-vmlinux = LINK $@
933# Include targets which we want to 933# Include targets which we want to
934# execute if the rest of the kernel build went well. 934# execute if the rest of the kernel build went well.
935vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE 935vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
936ifdef CONFIG_TRIM_UNUSED_KSYMS
937 $(Q)$(CONFIG_SHELL) scripts/adjust_autoksyms.sh \
938 "$(MAKE) KBUILD_MODULES=1 -f $(srctree)/Makefile autoksyms_recursive"
939endif
936ifdef CONFIG_HEADERS_CHECK 940ifdef CONFIG_HEADERS_CHECK
937 $(Q)$(MAKE) -f $(srctree)/Makefile headers_check 941 $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
938endif 942endif
@@ -947,6 +951,15 @@ ifdef CONFIG_GDB_SCRIPTS
947endif 951endif
948 +$(call if_changed,link-vmlinux) 952 +$(call if_changed,link-vmlinux)
949 953
954autoksyms_recursive: $(vmlinux-deps)
955 $(Q)$(CONFIG_SHELL) scripts/adjust_autoksyms.sh \
956 "$(MAKE) KBUILD_MODULES=1 -f $(srctree)/Makefile autoksyms_recursive"
957PHONY += autoksyms_recursive
958
959# standalone target for easier testing
960include/generated/autoksyms.h: FORCE
961 $(Q)$(CONFIG_SHELL) scripts/adjust_autoksyms.sh true
962
950# The actual objects are generated when descending, 963# The actual objects are generated when descending,
951# make sure no implicit rule kicks in 964# make sure no implicit rule kicks in
952$(sort $(vmlinux-deps)): $(vmlinux-dirs) ; 965$(sort $(vmlinux-deps)): $(vmlinux-dirs) ;