Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf: build: Link lib 'zstd' for static build

When build static perf, Makefile reports the error:

Makefile.config:480: No libdw DWARF unwind found, Please install
elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR

The libdw has been installed on the system, but the build system fails
to build the feature detecting binary 'test-libdw-dwarf-unwind'. The
failure is caused by missing to link the lib 'zstd'.

Link lib 'zstd' for the static build, in the end, the dwarf feature can
be enabled in the static perf.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Tested-by: Ian Rogers <irogers@google.com>
Cc: amadio@gentoo.org
Cc: James Clark <james.clark@linaro.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Link: https://lore.kernel.org/r/20240717082211.524826-6-leo.yan@arm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Leo Yan and committed by
Namhyung Kim
f42596c7 91b6a536

+2 -2
+1 -1
tools/build/feature/Makefile
··· 170 170 171 171 DWARFLIBS := -ldw 172 172 ifeq ($(findstring -static,${LDFLAGS}),-static) 173 - DWARFLIBS += -lelf -lz -llzma -lbz2 173 + DWARFLIBS += -lelf -lz -llzma -lbz2 -lzstd 174 174 175 175 LIBDW_VERSION := $(shell $(PKG_CONFIG) --modversion libdw) 176 176 LIBDW_VERSION_1 := $(word 1, $(subst ., ,$(LIBDW_VERSION)))
+1 -1
tools/perf/Makefile.config
··· 152 152 endif 153 153 DWARFLIBS := -ldw 154 154 ifeq ($(findstring -static,${LDFLAGS}),-static) 155 - DWARFLIBS += -lelf -ldl -lz -llzma -lbz2 155 + DWARFLIBS += -lelf -ldl -lz -llzma -lbz2 -lzstd 156 156 157 157 LIBDW_VERSION := $(shell $(PKG_CONFIG) --modversion libdw) 158 158 LIBDW_VERSION_1 := $(word 1, $(subst ., ,$(LIBDW_VERSION)))