Thread (4 messages) 4 messages, 3 authors, 2022-01-06

[PATCH net] scripts/pahole-flags.sh: Make sure pahole --version works

flat view
STALE1735d

From: Saeed Mahameed <saeed@kernel.org>
Date: 2021-12-31 07:56:51
Also in: bpf
Subsystem: the rest · Maintainer: Linus Torvalds

From: Saeed Mahameed <saeedm@nvidia.com>

I had a broken pahole and it's been driving me crazy to see tons of the
following error messages on every build.

pahole: symbol lookup error: pahole: undefined symbol: btf_gen_floats
scripts/pahole-flags.sh: line 12: [: : integer expression expected
scripts/pahole-flags.sh: line 16: [: : integer expression expected

Address this by redirecting pahole --version stderr to devnull,
and validate stdout has a non empty string, otherwise exit silently.

Fixes: 9741e07ece7c ("kbuild: Unify options for BTF generation for vmlinux and modules")
CC: Andrii Nakryiko <andrii@kernel.org>
CC: Jiri Olsa <redacted>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 scripts/pahole-flags.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh
index e6093adf4c06..b3b53f890d40 100755
--- a/scripts/pahole-flags.sh
+++ b/scripts/pahole-flags.sh
@@ -7,7 +7,8 @@ if ! [ -x "$(command -v ${PAHOLE})" ]; then
 	exit 0
 fi
 
-pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
+pahole_ver=$(${PAHOLE} --version 2>/dev/null | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
+[ -z "${pahole_ver}" ] && exit 0
 
 if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then
 	# pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
-- 
2.33.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help