summaryrefslogtreecommitdiffstats
path: root/scripts/link-vmlinux.sh
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-05-05 17:10:33 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-05-06 10:18:47 +0200
commit581b31c36cfc58df603c415ab6f3c795611c0ca1 (patch)
treea076348ed5959e8b879281242da823681569fc21 /scripts/link-vmlinux.sh
parent7080da8909844602b650c8959ecd7814d2829ea5 (diff)
downloadlinux-581b31c36cfc58df603c415ab6f3c795611c0ca1.tar.gz
linux-581b31c36cfc58df603c415ab6f3c795611c0ca1.tar.bz2
linux-581b31c36cfc58df603c415ab6f3c795611c0ca1.zip
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 <ast@fb.com> Reported-by: Yonghong Song <yhs@fb.com> Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux") Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'scripts/link-vmlinux.sh')
-rwxr-xr-xscripts/link-vmlinux.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 6a148d0d51bf..e3c06b9482a2 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"