summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorPu Lehui <pulehui@huawei.com>2021-10-21 20:39:13 +0800
committerAlexei Starovoitov <ast@kernel.org>2021-10-21 15:09:23 -0700
commit44ce0ac11e4e6dd1aee2e41e7d74f95f3b961cfb (patch)
tree1e8ec97aaa8f85730fcdb21008af17704638987b /samples
parentdb5b6a46f43aba3473c8b6b1d11aff1fa2aa354b (diff)
downloadlinux-44ce0ac11e4e6dd1aee2e41e7d74f95f3b961cfb.tar.bz2
samples: bpf: Suppress readelf stderr when probing for BTF support
When compiling bpf samples, the following warning appears: 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 Same problem was mentioned in commit 2f0921262ba9 ("selftests/bpf: suppress readelf stderr when probing for BTF support"), let's use readelf that supports btf. Signed-off-by: Pu Lehui <pulehui@huawei.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20211021123913.48833-1-pulehui@huawei.com
Diffstat (limited to 'samples')
-rw-r--r--samples/bpf/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 4c5ad15f8d28..c8106835f209 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -229,6 +229,7 @@ CLANG ?= clang
OPT ?= opt
LLVM_DIS ?= llvm-dis
LLVM_OBJCOPY ?= llvm-objcopy
+LLVM_READELF ?= llvm-readelf
BTF_PAHOLE ?= pahole
# Detect that we're cross compiling and use the cross compiler
@@ -252,7 +253,7 @@ BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
$(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
- readelf -S ./llvm_btf_verify.o | grep BTF; \
+ $(LLVM_READELF) -S ./llvm_btf_verify.o | grep BTF; \
/bin/rm -f ./llvm_btf_verify.o)
BPF_EXTRA_CFLAGS += -fno-stack-protector