From c31998793f0f2cb515b903829fef8bc1585bae47 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 21 Feb 2016 15:36:15 +0000 Subject: [PATCH] tools/build: Remove bpf() run-time check at build time --- debian/changelog | 1 + debian/patches/series | 1 + ...ove-bpf-run-time-check-at-build-time.patch | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 debian/patches/tools-build-remove-bpf-run-time-check-at-build-time.patch diff --git a/debian/changelog b/debian/changelog index d0115ef56..7329ff611 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ linux-tools (4.5~rc4-1~exp1) UNRELEASED; urgency=medium [ Ben Hutchings ] * lockdep: Add missing macros * Adjust VPATH to work for check-hyperv (and simplify the modpost wrapper) + * tools/build: Remove bpf() run-time check at build time -- Ben Hutchings Thu, 18 Feb 2016 03:19:14 +0000 diff --git a/debian/patches/series b/debian/patches/series index 1d7e9974d..59c555c35 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -18,3 +18,4 @@ perf-fix-misleadingly-indented-assignment-whitespace.patch perf-tools-fix-unused-variables-x86_-32-64-_regoffse.patch revert-perf-tools-x86-build-perf-on-older-user-space.patch lockdep-add-missing-macros.patch +tools-build-remove-bpf-run-time-check-at-build-time.patch diff --git a/debian/patches/tools-build-remove-bpf-run-time-check-at-build-time.patch b/debian/patches/tools-build-remove-bpf-run-time-check-at-build-time.patch new file mode 100644 index 000000000..3a570b351 --- /dev/null +++ b/debian/patches/tools-build-remove-bpf-run-time-check-at-build-time.patch @@ -0,0 +1,24 @@ +From: Ben Hutchings +Date: Sun, 21 Feb 2016 15:33:15 +0000 +Subject: tools/build: Remove bpf() run-time check at build time + +It is not correct to test that a syscall works on the build system's +kernel. We might be building on an earlier kernel version or with +security restrictions that block bpf(). + +Signed-off-by: Ben Hutchings +--- +--- a/tools/build/feature/test-bpf.c ++++ b/tools/build/feature/test-bpf.c +@@ -27,10 +27,5 @@ int main(void) + attr.log_level = 0; + attr.kern_version = 0; + +- attr = attr; +- /* +- * Test existence of __NR_bpf and BPF_PROG_LOAD. +- * This call should fail if we run the testcase. +- */ +- return syscall(__NR_bpf, BPF_PROG_LOAD, attr, sizeof(attr)); ++ return 0; + }