From: Andrii Nakryiko Date: Mon, 6 May 2019 00:10:33 +0000 (-0700) Subject: kbuild: tolerate missing pahole when generating BTF X-Git-Tag: v5.4-rc1~1056^2~11^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=581b31c36cfc58df603c415ab6f3c795611c0ca1;p=platform%2Fkernel%2Flinux-rpi.git kbuild: tolerate missing pahole when generating BTF When BTF generation is enabled through CONFIG_DEBUG_INFO_BTF, scripts/link-vmlinux.sh detects if pahole version is too old and gracefully continues build process, skipping BTF generation build step. But if pahole is not available, build will still fail. This patch adds check for whether pahole exists at all and bails out gracefully, if not. Cc: Alexei Starovoitov Reported-by: Yonghong Song Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann --- diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 6a148d0..e3c06b9 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -96,6 +96,11 @@ gen_btf() { local pahole_ver; + if ! [ -x "$(command -v ${PAHOLE})" ]; then + info "BTF" "${1}: pahole (${PAHOLE}) is not available" + return 0 + fi + pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/') if [ "${pahole_ver}" -lt "113" ]; then info "BTF" "${1}: pahole version $(${PAHOLE} --version) is too old, need at least v1.13"