From: Leo Yan Date: Sun, 15 Dec 2024 22:12:22 +0000 (+0000) Subject: perf build: Minor improvement for linking libzstd X-Git-Tag: ceph-for-6.15-rc4~382^2~121 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=44b44ffd5dcef03d273ad070d0b02a65a323f5f6;p=ceph-client.git perf build: Minor improvement for linking libzstd The zstd library will be automatically linked by detecting the feature libzstd. It is no need to explicitly link it for static builds, so remove the redundant linkage. It is contradictory to detect the feature libelf-zstd while the build configuration NO_LIBZSTD is set. Report an error for reminding users not to set NO_LIBZSTD. 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: Quentin Monnet Cc: Song Liu Cc: Stanislav Fomichev Cc: Yonghong Song Link: https://lore.kernel.org/r/20241215221223.293205-3-leo.yan@arm.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 37b793b299faa..f71afc04fd7a4 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -171,7 +171,7 @@ ifdef LIBDW_DIR endif DWARFLIBS := -ldw ifeq ($(findstring -static,${LDFLAGS}),-static) - DWARFLIBS += -lelf -lz -llzma -lbz2 -lzstd + DWARFLIBS += -lelf -lz -llzma -lbz2 LIBDW_VERSION := $(shell $(PKG_CONFIG) --modversion libdw).0.0 LIBDW_VERSION_1 := $(word 1, $(subst ., ,$(LIBDW_VERSION))) @@ -566,6 +566,12 @@ ifndef NO_LIBELF CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT endif + ifeq ($(feature-libelf-zstd), 1) + ifdef NO_LIBZSTD + $(error Error: libzstd is required by libelf, please do not set NO_LIBZSTD) + endif + endif + ifndef NO_LIBDEBUGINFOD $(call feature_check,libdebuginfod) ifeq ($(feature-libdebuginfod), 1)