From 32586f7a95744c8b48699c9ab85435a17d69651c Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 28 Apr 2016 16:27:44 +0200 Subject: [PATCH] tools/build: Fix bpf(2) feature test (fixes FTBFS on alpha, sh4; closes: #822364) --- debian/changelog | 2 ++ ...ild-remove-bpf-run-time-check-at-build-time.patch | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c1ee3d7d0..db193076d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -132,6 +132,8 @@ linux (4.5.2-1) UNRELEASED; urgency=medium result in file conflicts * linux-perf: Move tips.txt to /usr/share/doc/linux-perf- (Closes: #821741) + * tools/build: Fix bpf(2) feature test (fixes FTBFS on alpha, sh4; + closes: #822364) [ Aurelien Jarno ] * [mips*] Emulate unaligned LDXC1 and SDXC1 instructions. diff --git a/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch b/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch index 2db71eaf2..8c7980b7a 100644 --- a/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch +++ b/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch @@ -6,11 +6,21 @@ 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(). +Also fix the test for whether __NR_bpf is defined. + Signed-off-by: Ben Hutchings --- --- a/tools/build/feature/test-bpf.c +++ b/tools/build/feature/test-bpf.c -@@ -28,9 +28,5 @@ int main(void) +@@ -9,6 +9,7 @@ + # define __NR_bpf 321 + # elif defined(__aarch64__) + # define __NR_bpf 280 ++# else + # error __NR_bpf not defined. libbpf does not support your arch. + # endif + #endif +@@ -28,9 +29,5 @@ int main(void) attr.kern_version = 0; attr = attr;