aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/Makefile.modpost
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.modpost')
-rw-r--r--scripts/Makefile.modpost30
1 files changed, 28 insertions, 2 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 911606496341..04ad00917b2f 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -57,6 +57,32 @@ vmlinux.symvers: vmlinux.o
__modpost: vmlinux.symvers
+# Generate the list of in-tree objects in vmlinux
+# ---------------------------------------------------------------------------
+
+# This is used to retrieve symbol versions generated by genksyms.
+ifdef CONFIG_MODVERSIONS
+vmlinux.symvers: .vmlinux.objs
+endif
+
+# Ignore libgcc.a
+# Some architectures do '$(CC) --print-libgcc-file-name' to borrow libgcc.a
+# from the toolchain, but there is no EXPORT_SYMBOL in it.
+
+quiet_cmd_vmlinux_objs = GEN $@
+ cmd_vmlinux_objs = \
+ for f in $(real-prereqs); do \
+ case $${f} in \
+ *libgcc.a) ;; \
+ *.a) $(AR) t $${f} ;; \
+ *) echo $${f} ;; \
+ esac \
+ done > $@
+
+targets += .vmlinux.objs
+.vmlinux.objs: $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS) FORCE
+ $(call if_changed,vmlinux_objs)
+
else
ifeq ($(KBUILD_EXTMOD),)
@@ -134,6 +160,8 @@ ifneq ($(KBUILD_MODPOST_NOFINAL),1)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modfinal
endif
+endif
+
PHONY += FORCE
FORCE:
@@ -141,6 +169,4 @@ existing-targets := $(wildcard $(sort $(targets)))
-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
-endif
-
.PHONY: $(PHONY)