From patchwork Wed Dec 11 09:31:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13903271 X-Patchwork-Delegate: bpf@iogearbox.net Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA42E1DFE26; Wed, 11 Dec 2024 09:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733909495; cv=none; b=b663YQXN3op/a1gzd6I6XwUiokv2Iwr0yH1hU0dEZtP6NhODukXcAQFOWBZQXZ/HZ04j7s5O7SUSDOTV+6N7s3STpnI1+PWUXJCZo90GNH+Mo5/pa7g1Ifih35SsNCNXM6kXvsCc7mpcQO8D9GZSA14qK4MlHypxZ5jMsemjuy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733909495; c=relaxed/simple; bh=X9+Xj3FxZhc2xOgYA2XMpUSAuIEXmIqjePznJEy0+fI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KA6cqfuEkWAhabqddzUMi0ArmsMQabWIqBB009KswHgt1vsCA7BbqDZWqm6U6iNYhii/hbqYVQ/Z2wZvjogGweXsk1lOjmfXpsEU9EIgFGmB62nTcVubjdqd5vNL4BKnn4686qA/5Zu5hcx1sIt99qPy6R5QoNxka71Aqouu6vI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2AFFC16F2; Wed, 11 Dec 2024 01:32:01 -0800 (PST) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B48153F5A1; Wed, 11 Dec 2024 01:31:29 -0800 (PST) From: Leo Yan To: Quentin Monnet , Arnaldo Carvalho de Melo , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Nick Terrell , Ian Rogers , Adrian Hunter , "Liang, Kan" , James Clark , Guilherme Amadio , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Leo Yan Subject: [PATCH v2 2/3] perf: build: Minor improvement for linking libzstd Date: Wed, 11 Dec 2024 09:31:13 +0000 Message-Id: <20241211093114.263742-3-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241211093114.263742-1-leo.yan@arm.com> References: <20241211093114.263742-1-leo.yan@arm.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The zstd library will be automatically linked automatically 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 --- tools/perf/Makefile.config | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 0e4f6a860ae2..155cb9d20011 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)