History

btf: do not use CONFIG_OUTPUT_FORMAT

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.

Ilya Leoshkevich committed 7 years ago

Commit fdf37031 parent bb4b5c01 file · +4 −2Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/link-vmlinux.sh+4−2
@@ -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 vmlinux117 # 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/null122 ${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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t