* [PATCH bpf-next v2] selftests/bpf: suppress readelf stderr when probing for BTF support
@ 2019-01-24 16:54 Stanislav Fomichev
2019-01-24 18:14 ` Song Liu
2019-01-25 0:53 ` Daniel Borkmann
0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2019-01-24 16:54 UTC (permalink / raw)
To: netdev; +Cc: davem, ast, daniel, Stanislav Fomichev
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 <sdf@google.com>
---
tools/testing/selftests/bpf/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 70229de510f5..1cca5f2567c2 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -95,6 +95,7 @@ $(BPFOBJ): force
CLANG ?= clang
LLC ?= llc
LLVM_OBJCOPY ?= llvm-objcopy
+LLVM_READELF ?= llvm-readelf
BTF_PAHOLE ?= pahole
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)
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)
ifneq ($(BTF_LLVM_PROBE),)
--
2.20.1.321.g9e740568ce-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH bpf-next v2] selftests/bpf: suppress readelf stderr when probing for BTF support
2019-01-24 16:54 [PATCH bpf-next v2] selftests/bpf: suppress readelf stderr when probing for BTF support Stanislav Fomichev
@ 2019-01-24 18:14 ` Song Liu
2019-01-25 0:53 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2019-01-24 18:14 UTC (permalink / raw)
To: Stanislav Fomichev
Cc: Networking, David S . Miller, Alexei Starovoitov, Daniel Borkmann
On Thu, Jan 24, 2019 at 8:57 AM Stanislav Fomichev <sdf@google.com> wrote:
>
> 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 <sdf@google.com>
This looks good.
Acked-by: Song Liu <songliubraving@fb.com>
Thanks!
> ---
> tools/testing/selftests/bpf/Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 70229de510f5..1cca5f2567c2 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -95,6 +95,7 @@ $(BPFOBJ): force
> CLANG ?= clang
> LLC ?= llc
> LLVM_OBJCOPY ?= llvm-objcopy
> +LLVM_READELF ?= llvm-readelf
> BTF_PAHOLE ?= pahole
>
> 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)
> 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)
>
> ifneq ($(BTF_LLVM_PROBE),)
> --
> 2.20.1.321.g9e740568ce-goog
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH bpf-next v2] selftests/bpf: suppress readelf stderr when probing for BTF support
2019-01-24 16:54 [PATCH bpf-next v2] selftests/bpf: suppress readelf stderr when probing for BTF support Stanislav Fomichev
2019-01-24 18:14 ` Song Liu
@ 2019-01-25 0:53 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2019-01-25 0:53 UTC (permalink / raw)
To: Stanislav Fomichev, netdev; +Cc: davem, ast
On 01/24/2019 05:54 PM, Stanislav Fomichev wrote:
> 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 <sdf@google.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-25 0:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-24 16:54 [PATCH bpf-next v2] selftests/bpf: suppress readelf stderr when probing for BTF support Stanislav Fomichev
2019-01-24 18:14 ` Song Liu
2019-01-25 0:53 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).