From: Leo Yan Date: Sun, 15 Dec 2024 22:12:23 +0000 (+0000) Subject: bpftool: Link zstd lib required by libelf X-Git-Tag: v6.14-rc1~29^2~125 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=fee9c03b25829adcc5539da1081d6219fe7ccbcd;p=linux-block.git bpftool: Link zstd lib required by libelf When the feature libelf-zstd is detected, the zstd lib is required by libelf. Link the zstd lib in this case. Reviewed-by: Quentin Monnet Signed-off-by: Leo Yan Tested-by: Namhyung Kim Acked-by: Andrii Nakryiko Cc: Adrian Hunter Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Eduard Zingerman Cc: Guilherme Amadio Cc: Hao Luo Cc: Ian Rogers Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Kan Liang Cc: Martin KaFai Lau Cc: Nick Terrell Cc: Song Liu Cc: Stanislav Fomichev Cc: Yonghong Song Link: https://lore.kernel.org/r/20241215221223.293205-4-leo.yan@arm.com Signed-off-by: Arnaldo Carvalho de Melo --- 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