File tree Expand file tree Collapse file tree 3 files changed +29
-21
lines changed Expand file tree Collapse file tree 3 files changed +29
-21
lines changed Original file line number Diff line number Diff line change @@ -1477,7 +1477,7 @@ endif # CONFIG_MODULES
1477
1477
# Directories & files removed with 'make clean'
1478
1478
CLEAN_FILES += include/ksym vmlinux.symvers modules-only.symvers \
1479
1479
modules.builtin modules.builtin.modinfo modules.nsdeps \
1480
- compile_commands.json .thinlto-cache
1480
+ compile_commands.json .thinlto-cache .vmlinux.objs
1481
1481
1482
1482
# Directories & files removed with 'make mrproper'
1483
1483
MRPROPER_FILES += include/config include/generated \
Original file line number Diff line number Diff line change @@ -57,6 +57,32 @@ vmlinux.symvers: vmlinux.o
57
57
58
58
__modpost: vmlinux.symvers
59
59
60
+ # Generate the list of in-tree objects in vmlinux
61
+ # ---------------------------------------------------------------------------
62
+
63
+ # This is used to retrieve symbol versions generated by genksyms.
64
+ ifdef CONFIG_MODVERSIONS
65
+ vmlinux.symvers: .vmlinux.objs
66
+ endif
67
+
68
+ # Ignore libgcc.a
69
+ # Some architectures do '$(CC) --print-libgcc-file-name' to borrow libgcc.a
70
+ # from the toolchain, but there is no EXPORT_SYMBOL in it.
71
+
72
+ quiet_cmd_vmlinux_objs = GEN $@
73
+ cmd_vmlinux_objs = \
74
+ for f in $(real-prereqs); do \
75
+ case $${f} in \
76
+ *libgcc.a) ;; \
77
+ *.a) $(AR) t $${f} ;; \
78
+ *) echo $${f} ;; \
79
+ esac \
80
+ done > $@
81
+
82
+ targets += .vmlinux.objs
83
+ .vmlinux.objs: $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS) FORCE
84
+ $(call if_changed,vmlinux_objs)
85
+
60
86
else
61
87
62
88
ifeq ($(KBUILD_EXTMOD),)
@@ -134,13 +160,13 @@ ifneq ($(KBUILD_MODPOST_NOFINAL),1)
134
160
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modfinal
135
161
endif
136
162
163
+ endif
164
+
137
165
PHONY += FORCE
138
166
FORCE:
139
167
140
168
existing-targets := $(wildcard $(sort $(targets)))
141
169
142
170
-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
143
171
144
- endif
145
-
146
172
.PHONY: $(PHONY)
Original file line number Diff line number Diff line change @@ -199,7 +199,6 @@ cleanup()
199
199
rm -f System.map
200
200
rm -f vmlinux
201
201
rm -f vmlinux.map
202
- rm -f .vmlinux.objs
203
202
rm -f .vmlinux.export.c
204
203
}
205
204
218
217
# link vmlinux.o
219
218
${MAKE} -f " ${srctree} /scripts/Makefile.vmlinux_o"
220
219
221
- # Generate the list of in-tree objects in vmlinux
222
- #
223
- # This is used to retrieve symbol versions generated by genksyms.
224
- for f in ${KBUILD_VMLINUX_OBJS} ${KBUILD_VMLINUX_LIBS} ; do
225
- case ${f} in
226
- * libgcc.a)
227
- # Some architectures do '$(CC) --print-libgcc-file-name' to
228
- # borrow libgcc.a from the toolchain.
229
- # There is no EXPORT_SYMBOL in external objects. Ignore this.
230
- ;;
231
- * .a)
232
- ${AR} t ${f} ;;
233
- * )
234
- echo ${f} ;;
235
- esac
236
- done > .vmlinux.objs
237
-
238
220
# modpost vmlinux.o to check for section mismatches
239
221
${MAKE} -f " ${srctree} /scripts/Makefile.modpost" MODPOST_VMLINUX=1
240
222
You can’t perform that action at this time.
0 commit comments