]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.7/selftests-bpf-suppress-readelf-stderr-when-probing-f.patch
Linux 5.0.7
[thirdparty/kernel/stable-queue.git] / releases / 5.0.7 / selftests-bpf-suppress-readelf-stderr-when-probing-f.patch
CommitLineData
f688f459
SL
1From 2367684d939107d8ca438b485ec4547407455c32 Mon Sep 17 00:00:00 2001
2From: Stanislav Fomichev <sdf@google.com>
3Date: Thu, 24 Jan 2019 08:54:29 -0800
4Subject: selftests/bpf: suppress readelf stderr when probing for BTF support
5
6[ Upstream commit 2f0921262ba943fe9d9f59037a033927d8c4789b ]
7
8Before:
9$ make -s -C tools/testing/selftests/bpf
10readelf: Error: Missing knowledge of 32-bit reloc types used in DWARF
11sections of machine number 247
12readelf: Warning: unable to apply unsupported reloc type 10 to section
13.debug_info
14readelf: Warning: unable to apply unsupported reloc type 1 to section
15.debug_info
16readelf: Warning: unable to apply unsupported reloc type 10 to section
17.debug_info
18
19After:
20$ make -s -C tools/testing/selftests/bpf
21
22v2:
23* use llvm-readelf instead of redirecting binutils' readelf stderr to
24 /dev/null
25
26Signed-off-by: Stanislav Fomichev <sdf@google.com>
27Acked-by: Song Liu <songliubraving@fb.com>
28Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
29Signed-off-by: Sasha Levin <sashal@kernel.org>
30---
31 tools/testing/selftests/bpf/Makefile | 3 ++-
32 1 file changed, 2 insertions(+), 1 deletion(-)
33
34diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
35index 41ab7a3668b3..936f726f7cd9 100644
36--- a/tools/testing/selftests/bpf/Makefile
37+++ b/tools/testing/selftests/bpf/Makefile
38@@ -96,6 +96,7 @@ $(BPFOBJ): force
39 CLANG ?= clang
40 LLC ?= llc
41 LLVM_OBJCOPY ?= llvm-objcopy
42+LLVM_READELF ?= llvm-readelf
43 BTF_PAHOLE ?= pahole
44
45 PROBE := $(shell $(LLC) -march=bpf -mcpu=probe -filetype=null /dev/null 2>&1)
46@@ -132,7 +133,7 @@ BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
47 BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
48 BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
49 $(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
50- readelf -S ./llvm_btf_verify.o | grep BTF; \
51+ $(LLVM_READELF) -S ./llvm_btf_verify.o | grep BTF; \
52 /bin/rm -f ./llvm_btf_verify.o)
53
54 ifneq ($(BTF_LLVM_PROBE),)
55--
562.19.1
57