Skip to content

Commit 2f09212

Browse files
fomichevborkmann
authored andcommitted
selftests/bpf: suppress readelf stderr when probing for BTF support
Before: $ make -s -C tools/testing/selftests/bpf readelf: Error: Missing knowledge of 32-bit reloc types used in DWARF sections of machine number 247 readelf: Warning: unable to apply unsupported reloc type 10 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 1 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 10 to section .debug_info After: $ make -s -C tools/testing/selftests/bpf v2: * use llvm-readelf instead of redirecting binutils' readelf stderr to /dev/null Signed-off-by: Stanislav Fomichev <[email protected]> Acked-by: Song Liu <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent d9ff286 commit 2f09212

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ $(BPFOBJ): force
9595
CLANG ?= clang
9696
LLC ?= llc
9797
LLVM_OBJCOPY ?= llvm-objcopy
98+
LLVM_READELF ?= llvm-readelf
9899
BTF_PAHOLE ?= pahole
99100

100101
PROBE := $(shell $(LLC) -march=bpf -mcpu=probe -filetype=null /dev/null 2>&1)
@@ -131,7 +132,7 @@ BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
131132
BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
132133
BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
133134
$(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
134-
readelf -S ./llvm_btf_verify.o | grep BTF; \
135+
$(LLVM_READELF) -S ./llvm_btf_verify.o | grep BTF; \
135136
/bin/rm -f ./llvm_btf_verify.o)
136137

137138
ifneq ($(BTF_LLVM_PROBE),)

0 commit comments

Comments
 (0)