Skip to content

Commit 0aa24a7

Browse files
committed
kbuild: do not try to parse *.cmd files for objects provided by compiler
Guenter Roeck reported the build breakage for parisc and csky. I confirmed nios2 and openrisc are broken as well. The reason is that they borrow libgcc.a from the toolchains. For example, see this line in arch/parisc/Makefile: LIBGCC := $(shell $(CC) -print-libgcc-file-name) Some objects in libgcc.a are linked to vmlinux.o, but they do not have .*.cmd files. Obviously, there is no EXPORT_SYMBOL in external objects. Ignore them. (Most of the architectures import library code into the kernel tree. Perhaps those 4 architectures can do similar, but I do not know how challenging it is.) Fixes: f292d87 ("modpost: extract symbol versions from *.cmd files") Link: https://lore.kernel.org/linux-kbuild/[email protected]/T/#mac65c20c71c3e272db0350ecfba53fcd8905b0a0 Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Guenter Roeck <[email protected]>
1 parent c9db188 commit 0aa24a7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/link-vmlinux.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,16 @@ ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init need-builtin=1
344344
modpost_link vmlinux.o
345345
objtool_link vmlinux.o
346346

347-
# Generate the list of objects in vmlinux
347+
# Generate the list of in-tree objects in vmlinux
348+
#
349+
# This is used to retrieve symbol versions generated by genksyms.
348350
for f in ${KBUILD_VMLINUX_OBJS} ${KBUILD_VMLINUX_LIBS}; do
349351
case ${f} in
352+
*libgcc.a)
353+
# Some architectures do '$(CC) --print-libgcc-file-name' to
354+
# borrow libgcc.a from the toolchain.
355+
# There is no EXPORT_SYMBOL in external objects. Ignore this.
356+
;;
350357
*.a)
351358
${AR} t ${f} ;;
352359
*)

0 commit comments

Comments
 (0)