[PATCH v3 3/3] bpftool: Link zstd lib required by libelf

Leo Yan posted 3 patches 12 months ago
[PATCH v3 3/3] bpftool: Link zstd lib required by libelf
Posted by Leo Yan 12 months ago
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>
Tested-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/bpf/bpftool/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index a4263dfb5e03..dd9f3ec84201 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
@@ -132,6 +133,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
-- 
2.34.1
Re: [PATCH v3 3/3] bpftool: Link zstd lib required by libelf
Posted by Quentin Monnet 12 months ago
2024-12-15 22:12 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>
> Tested-by: Namhyung Kim <namhyung@kernel.org>
> Acked-by: Andrii Nakryiko <andrii@kernel.org>

Reviewed-by: Quentin Monnet <qmo@kernel.org>

Thank you! And thanks for the updated commit description in your first
patch, looks great.

Quentin
Re: [PATCH v3 3/3] bpftool: Link zstd lib required by libelf
Posted by Leo Yan 12 months ago
On Mon, Dec 16, 2024 at 11:23:29AM +0000, Quentin Monnet wrote:
> 
> 2024-12-15 22:12 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>
> > Tested-by: Namhyung Kim <namhyung@kernel.org>
> > Acked-by: Andrii Nakryiko <andrii@kernel.org>
> 
> Reviewed-by: Quentin Monnet <qmo@kernel.org>
> 
> Thank you! And thanks for the updated commit description in your first
> patch, looks great.

Thank you for continuous review, Quentin!

Leo
Re: [PATCH v3 3/3] bpftool: Link zstd lib required by libelf
Posted by Arnaldo Carvalho de Melo 12 months ago
On Mon, Dec 16, 2024 at 04:30:33PM +0000, Leo Yan wrote:
> On Mon, Dec 16, 2024 at 11:23:29AM +0000, Quentin Monnet wrote:
> > 
> > 2024-12-15 22:12 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>
> > > Tested-by: Namhyung Kim <namhyung@kernel.org>
> > > Acked-by: Andrii Nakryiko <andrii@kernel.org>
> > 
> > Reviewed-by: Quentin Monnet <qmo@kernel.org>
> > 
> > Thank you! And thanks for the updated commit description in your first
> > patch, looks great.
> 
> Thank you for continuous review, Quentin!

Applied locally and test building now, please holler if someone thinks
this should be processed somewhere else.

- Arnaldo