* [PATCH bpf-next] samples: bpf: Suppress readelf stderr when probing for BTF support
@ 2021-10-21 12:39 Pu Lehui
2021-10-21 19:21 ` John Fastabend
2021-11-03 2:30 ` Yonghong Song
0 siblings, 2 replies; 3+ messages in thread
From: Pu Lehui @ 2021-10-21 12:39 UTC (permalink / raw)
To: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
kpsingh, nathan, ndesaulniers
Cc: netdev, bpf, linux-kernel, llvm, pulehui
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>
---
samples/bpf/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 2366242edb7c..a886dff1ba89 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
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH bpf-next] samples: bpf: Suppress readelf stderr when probing for BTF support
2021-10-21 12:39 [PATCH bpf-next] samples: bpf: Suppress readelf stderr when probing for BTF support Pu Lehui
@ 2021-10-21 19:21 ` John Fastabend
2021-11-03 2:30 ` Yonghong Song
1 sibling, 0 replies; 3+ messages in thread
From: John Fastabend @ 2021-10-21 19:21 UTC (permalink / raw)
To: Pu Lehui, ast, daniel, andrii, kafai, songliubraving, yhs,
john.fastabend, kpsingh, nathan, ndesaulniers
Cc: netdev, bpf, linux-kernel, llvm, pulehui
Pu Lehui wrote:
> 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>
> ---
Thanks.
Acked-by: John Fastabend <john.fastabend@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] samples: bpf: Suppress readelf stderr when probing for BTF support
2021-10-21 12:39 [PATCH bpf-next] samples: bpf: Suppress readelf stderr when probing for BTF support Pu Lehui
2021-10-21 19:21 ` John Fastabend
@ 2021-11-03 2:30 ` Yonghong Song
1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2021-11-03 2:30 UTC (permalink / raw)
To: Pu Lehui, ast, daniel, andrii, kafai, songliubraving,
john.fastabend, kpsingh, nathan, ndesaulniers
Cc: netdev, bpf, linux-kernel, llvm
On 10/21/21 5:39 AM, Pu Lehui wrote:
> 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>
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-03 2:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 12:39 [PATCH bpf-next] samples: bpf: Suppress readelf stderr when probing for BTF support Pu Lehui
2021-10-21 19:21 ` John Fastabend
2021-11-03 2:30 ` Yonghong Song
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.