diff mbox series

[v2,3/3] bpftool: Link zstd lib required by libelf

Message ID 20241211093114.263742-4-leo.yan@arm.com (mailing list archive)
State New
Delegated to: BPF
Headers show
Series bpftool: Fix the static linkage failure | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch
bpf/vmtest-bpf-PR fail merge-conflict

Commit Message

Leo Yan Dec. 11, 2024, 9:31 a.m. UTC
When the feature-libelf-zstd is detected, the zstd lib is required by
libelf.  Link the zstd lib in this case.

Signed-off-by: Leo Yan <leo.yan@arm.com>
---
 tools/bpf/bpftool/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Quentin Monnet Dec. 11, 2024, 12:48 p.m. UTC | #1
2024-12-11 09:31 UTC+0000 ~ Leo Yan <leo.yan@arm.com>
> When the feature-libelf-zstd is detected, the zstd lib is required by
> libelf.  Link the zstd lib in this case.
> 
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
>  tools/bpf/bpftool/Makefile | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index a4263dfb5e03..469f841abaff 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -106,6 +106,7 @@ FEATURE_TESTS += libbfd-liberty
>  FEATURE_TESTS += libbfd-liberty-z
>  FEATURE_TESTS += disassembler-four-args
>  FEATURE_TESTS += disassembler-init-styled
> +FEATURE_TESTS += libelf-zstd
>  
>  FEATURE_DISPLAY := clang-bpf-co-re
>  FEATURE_DISPLAY += llvm
> @@ -113,6 +114,7 @@ FEATURE_DISPLAY += libcap
>  FEATURE_DISPLAY += libbfd
>  FEATURE_DISPLAY += libbfd-liberty
>  FEATURE_DISPLAY += libbfd-liberty-z
> +FEATURE_DISPLAY += libelf-zstd


Let's not display this one, please, it brings no information to the user
about what features bpftool will support.

Looks good otherwise, thank you!


>  
>  check_feat := 1
>  NON_CHECK_FEAT_TARGETS := clean uninstall doc doc-clean doc-install doc-uninstall
> @@ -132,6 +134,12 @@ endif
>  
>  LIBS = $(LIBBPF) -lelf -lz
>  LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
> +
> +ifeq ($(feature-libelf-zstd),1)
> +LIBS += -lzstd
> +LIBS_BOOTSTRAP += -lzstd
> +endif
> +
>  ifeq ($(feature-libcap), 1)
>  CFLAGS += -DUSE_LIBCAP
>  LIBS += -lcap
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index a4263dfb5e03..469f841abaff 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -106,6 +106,7 @@  FEATURE_TESTS += libbfd-liberty
 FEATURE_TESTS += libbfd-liberty-z
 FEATURE_TESTS += disassembler-four-args
 FEATURE_TESTS += disassembler-init-styled
+FEATURE_TESTS += libelf-zstd
 
 FEATURE_DISPLAY := clang-bpf-co-re
 FEATURE_DISPLAY += llvm
@@ -113,6 +114,7 @@  FEATURE_DISPLAY += libcap
 FEATURE_DISPLAY += libbfd
 FEATURE_DISPLAY += libbfd-liberty
 FEATURE_DISPLAY += libbfd-liberty-z
+FEATURE_DISPLAY += libelf-zstd
 
 check_feat := 1
 NON_CHECK_FEAT_TARGETS := clean uninstall doc doc-clean doc-install doc-uninstall
@@ -132,6 +134,12 @@  endif
 
 LIBS = $(LIBBPF) -lelf -lz
 LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+
+ifeq ($(feature-libelf-zstd),1)
+LIBS += -lzstd
+LIBS_BOOTSTRAP += -lzstd
+endif
+
 ifeq ($(feature-libcap), 1)
 CFLAGS += -DUSE_LIBCAP
 LIBS += -lcap