linux-perf: Fix BPF feature detection

This commit is contained in:
Ben Hutchings 2018-10-08 19:04:03 +01:00
parent b61e29e69c
commit 88995ec002
2 changed files with 13 additions and 4 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
linux (4.18.10-3) UNRELEASED; urgency=medium
* linux-perf: Fix BPF feature detection
-- Ben Hutchings <ben@decadent.org.uk> Mon, 08 Oct 2018 19:02:53 +0100
linux (4.18.10-2) unstable; urgency=medium
[ Ben Hutchings ]

View File

@ -11,14 +11,17 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/tools/build/feature/test-bpf.c
+++ b/tools/build/feature/test-bpf.c
@@ -31,9 +31,5 @@ int main(void)
attr.kern_version = 0;
@@ -35,8 +35,10 @@ int main(void)
attr.prog_flags = 0;
- /*
/*
- * Test existence of __NR_bpf and BPF_PROG_LOAD.
- * This call should fail if we run the testcase.
- */
+ * bwh: Don't use the bpf() syscall as we might be building on a
+ * much older kernel. Do "use" the attr structure here to avoid
+ * a "set but not used" warning.
*/
- return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
+ (void)&attr;
+ return 0;
}