.vmlinux.objs is used by modpost, so scripts/Makefile.modpost is a better place to generate it. It is used only when CONFIG_MODVERSIONS=y. It should be guarded by "ifdef CONFIG_MODVERSIONS".
Showing the changes to scripts (2 of 3 files). Show all
Unified · Split
| @@ -57,6 +57,32 @@ vmlinux.symvers: vmlinux.o · 56 unmodified lines | ||
| 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,6 +160,8 @@ ifneq ($(KBUILD_MODPOST_NOFINAL),1) · 71 unmodified lines | ||
| 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 | |
| @@ -141,6 +169,4 @@ existing-targets := $(wildcard $(sort $(targets))) · 1 unmodified line | ||
| 141 | 169 | |
| 142 | 170 | -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) |
| 143 | 171 | |
| 144 | −endif | |
| 145 | − | |
| 146 | 172 | .PHONY: $(PHONY) |
| @@ -199,7 +199,6 @@ cleanup() · 198 unmodified lines | ||
| 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,23 +217,6 @@ fi · 12 unmodified lines | ||
| 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 | |