]>
Commit | Line | Data |
---|---|---|
f688f459 SL |
1 | From 2367684d939107d8ca438b485ec4547407455c32 Mon Sep 17 00:00:00 2001 |
2 | From: Stanislav Fomichev <sdf@google.com> | |
3 | Date: Thu, 24 Jan 2019 08:54:29 -0800 | |
4 | Subject: selftests/bpf: suppress readelf stderr when probing for BTF support | |
5 | ||
6 | [ Upstream commit 2f0921262ba943fe9d9f59037a033927d8c4789b ] | |
7 | ||
8 | Before: | |
9 | $ make -s -C tools/testing/selftests/bpf | |
10 | readelf: Error: Missing knowledge of 32-bit reloc types used in DWARF | |
11 | sections of machine number 247 | |
12 | readelf: Warning: unable to apply unsupported reloc type 10 to section | |
13 | .debug_info | |
14 | readelf: Warning: unable to apply unsupported reloc type 1 to section | |
15 | .debug_info | |
16 | readelf: Warning: unable to apply unsupported reloc type 10 to section | |
17 | .debug_info | |
18 | ||
19 | After: | |
20 | $ make -s -C tools/testing/selftests/bpf | |
21 | ||
22 | v2: | |
23 | * use llvm-readelf instead of redirecting binutils' readelf stderr to | |
24 | /dev/null | |
25 | ||
26 | Signed-off-by: Stanislav Fomichev <sdf@google.com> | |
27 | Acked-by: Song Liu <songliubraving@fb.com> | |
28 | Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> | |
29 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
30 | --- | |
31 | tools/testing/selftests/bpf/Makefile | 3 ++- | |
32 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
33 | ||
34 | diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile | |
35 | index 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 | -- | |
56 | 2.19.1 | |
57 |