Skip to content

Commit 44ce0ac

Browse files
Pu LehuiAlexei Starovoitov
authored andcommitted
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 2f09212 ("selftests/bpf: suppress readelf stderr when probing for BTF support"), let's use readelf that supports btf. Signed-off-by: Pu Lehui <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: John Fastabend <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent db5b6a4 commit 44ce0ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

samples/bpf/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ CLANG ?= clang
229229
OPT ?= opt
230230
LLVM_DIS ?= llvm-dis
231231
LLVM_OBJCOPY ?= llvm-objcopy
232+
LLVM_READELF ?= llvm-readelf
232233
BTF_PAHOLE ?= pahole
233234

234235
# 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)
252253
BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
253254
BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
254255
$(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
255-
readelf -S ./llvm_btf_verify.o | grep BTF; \
256+
$(LLVM_READELF) -S ./llvm_btf_verify.o | grep BTF; \
256257
/bin/rm -f ./llvm_btf_verify.o)
257258

258259
BPF_EXTRA_CFLAGS += -fno-stack-protector

0 commit comments

Comments
 (0)