Building s390 kernel with CONFIG_DEBUG_INFO_BTF fails, because CONFIG_OUTPUT_FORMAT is not defined. As a matter of fact, this variable appears to be x86-only, so other arches might be affected as well. Fix by obtaining this value from objdump output, just like it's already done for bin_arch. The exact objdump invocation is "inspired" by arch/powerpc/boot/wrapper. Also, use LANG=C for the existing bin_arch objdump invocation to avoid potential build issues on systems with non-English locale.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -115,10 +115,12 @@ gen_btf() · 114 unmodified lines | |||
| 115 | LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1} | 115 | LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1} |
| 116 | 116 | ||
| 117 | # dump .BTF section into raw binary file to link with final vmlinux | 117 | # dump .BTF section into raw binary file to link with final vmlinux |
| 118 | bin_arch=$(${OBJDUMP} -f ${1} | grep architecture | \ | 118 | bin_arch=$(LANG=C ${OBJDUMP} -f ${1} | grep architecture | \ |
| 119 | cut -d, -f1 | cut -d' ' -f2) | 119 | cut -d, -f1 | cut -d' ' -f2) |
| 120 | bin_format=$(LANG=C ${OBJDUMP} -f ${1} | grep 'file format' | \ | ||
| 121 | awk '{print $4}') | ||
| 120 | ${OBJCOPY} --dump-section .BTF=.btf.vmlinux.bin ${1} 2>/dev/null | 122 | ${OBJCOPY} --dump-section .BTF=.btf.vmlinux.bin ${1} 2>/dev/null |
| 121 | ${OBJCOPY} -I binary -O ${CONFIG_OUTPUT_FORMAT} -B ${bin_arch} \ | 123 | ${OBJCOPY} -I binary -O ${bin_format} -B ${bin_arch} \ |
| 122 | --rename-section .data=.BTF .btf.vmlinux.bin ${2} | 124 | --rename-section .data=.BTF .btf.vmlinux.bin ${2} |
| 123 | } | 125 | } |
| 124 | 126 | ||