From nobody Fri Dec 19 19:18:10 2025 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9FF11C4602 for ; Tue, 6 Aug 2024 11:48:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722944899; cv=none; b=PfxmkmpCmrzisQMcUVbYa7bz1NsWaHNz543w5O1EhNpJFGVaubH4+88a1o6ZxwPG97vkG5t3neSGITN29KHGatTwA+MRDCnL/SuuvQvHakJUY4XYTzw4AomBux9Vsg+JtzE10QD10eXOW7+iA3Bb2UKevqKTaJlWeR60tXjPt5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722944899; c=relaxed/simple; bh=lLK53uiQC3bZkEy2L61h0TC52VfEBeHo0ujP19/cMQU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tf/2NQKTFr3qBlwmqRyubSx7SSiWbDFrTIUD2WHLIA4xsJsDa0h1odmctok0/KeVkohIhSg3jXF7vQ/za0YnusLmiB8ezy7fJY2txHEsx4BzQEki5q+SgyqcJpsLuA5tzC7CNbPsDTotIHcbnK6Dr0Kv7DKbv6Nb9bxBTBMXRm0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=Ekw7O+Bk; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="Ekw7O+Bk" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-70cec4aa1e4so348074b3a.1 for ; Tue, 06 Aug 2024 04:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1722944897; x=1723549697; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=szK4YRuHQJi5DajMaeZdCXTgp1QcycA8fBZf8lAoRyI=; b=Ekw7O+BktCuwZYCq4vKqDcl6JBeXVbY3JXFhbfuG0sOVzWr1ldnFl6QiATgiOVWKkb SQr8I7hroGItrlcwoIHq+0pQcjJaCLcKdy97LL8RubBYZ04krJByhikEkLS2W0Fj6Bco mGW73wXnO3B7th/Q/H2aYLudvbelNLlL2P4AfpI2jWPOP9u/mGBCKyHR1+tRfto0l97D cn3kY/oiZoRvZWAvs4HiZqC0H+fWa3kT4ZUUG+BWGi0lW49ycBBMiAzQiiMgsVo5BY7n yr1T2PaxfkKUNr003+sgfj5cqqUF/F7KhZkHjn3y+rXRjC9fk3/8mhWxLwHznGOCFdeQ JUmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944897; x=1723549697; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=szK4YRuHQJi5DajMaeZdCXTgp1QcycA8fBZf8lAoRyI=; b=hh0WP3ec98Uv9vuVD8ek1hpl3+ARvtBXf6i/P3AKugJoMCuQBF2IBiDs23RkqTQ4Oz vZrNQPM9wOeXUA+A9MMLRhNzLZHhmzJG/V59EMtEQQTcG0SlnXHMR++iWBnW2YAmTuCs Orpccdxo5euveM8+lConMQdUkRXdgaiIu8nPSvKXb1iHPv72OwODvL8D6nn+pJKuip5L xI8xHPxQ9Th0T5tauYn33crMU6KTIGVSlvexlUtCFM6gPCzyJtP39IT00usBIna4Uw9J J8UKS0aODpmShW1uOuqsYuLHqG83mpT0D9Kv1LZ3NY80JgX33bEoAsa2CITYBmvJjaaj Qx9Q== X-Forwarded-Encrypted: i=1; AJvYcCVkhTZKIW3UyRjghlpxCwI6Mbez+89U3N5BGZ/1vfPPENXf8409v5iaG/uv6UbyaMDJCWHs61z+V9gH2toSvvExPz0DOXZbundLXXpS X-Gm-Message-State: AOJu0Yza+Mb38rt9Ld+Tj5Hpm+GQ1oVJI37gc6ipVoMGJWC3Y+Hk7fJd csyWCUtWZJXhYIMq7/04r7Hy0gPiglxUkqxJb7TNB5RHIvkRofXjb06mfVKhP/4= X-Google-Smtp-Source: AGHT+IFdZ7eYHp2tmqJYcz5HMBgb90qZGuZ8bq6DyGDAHkGFzGLnob6VV7mkGgw4Wou6vWzfbqVFtQ== X-Received: by 2002:a05:6a20:7faa:b0:1c3:b47d:d53f with SMTP id adf61e73a8af0-1c6995a1f7emr19507362637.25.1722944896989; Tue, 06 Aug 2024 04:48:16 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7106ec43944sm6831705b3a.75.2024.08.06.04.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:48:16 -0700 (PDT) From: Yang Jihong To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: yangjihong@bytedance.com Subject: [PATCH v2 1/3] perf: build: Fix static compilation error when libdw is not installed Date: Tue, 6 Aug 2024 19:47:59 +0800 Message-Id: <20240806114801.1652417-2-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806114801.1652417-1-yangjihong@bytedance.com> References: <20240806114801.1652417-1-yangjihong@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If libdw is not installed in build environment, the output of 'pkg-config --modversion libdw' is empty, causing LIBDW_VERSION_2 to be empty and the shell test will have the following error: /bin/sh: 1: test: -lt: unexpected operator Before: $ pkg-config --modversion libdw Package libdw was not found in the pkg-config search path. Perhaps you should add the directory containing `libdw.pc' to the PKG_CONFIG_PATH environment variable No package 'libdw' found $ make LDFLAGS=3D-static -j16 BUILD: Doing 'make -j20' parallel build Package libdw was not found in the pkg-config search path. Perhaps you should add the directory containing `libdw.pc' to the PKG_CONFIG_PATH environment variable No package 'libdw' found /bin/sh: 1: test: -lt: unexpected operator After: 1. libdw is not installed: $ pkg-config --modversion libdw Package libdw was not found in the pkg-config search path. Perhaps you should add the directory containing `libdw.pc' to the PKG_CONFIG_PATH environment variable No package 'libdw' found $ make LDFLAGS=3D-static -j16 BUILD: Doing 'make -j20' parallel build Package libdw was not found in the pkg-config search path. Perhaps you should add the directory containing `libdw.pc' to the PKG_CONFIG_PATH environment variable No package 'libdw' found Makefile.config:473: No libdw DWARF unwind found, Please install elfutils= -devel/libdw-dev >=3D 0.158 and/or set LIBDW_DIR 2. libdw version is lower than 0.177 $ pkg-config --modversion libdw 0.176 $ make LDFLAGS=3D-static -j16 BUILD: Doing 'make -j20' parallel build Auto-detecting system features: ... dwarf: [ on ] INSTALL libsubcmd_headers INSTALL libapi_headers INSTALL libperf_headers INSTALL libsymbol_headers INSTALL libbpf_headers LINK perf 3. libdw version is higher than 0.177 $ pkg-config --modversion libdw 0.186 $ make LDFLAGS=3D-static -j16 BUILD: Doing 'make -j20' parallel build Auto-detecting system features: ... dwarf: [ on ] CC util/bpf-utils.o CC util/pfm.o LD util/perf-util-in.o LD perf-util-in.o AR libperf-util.a LINK perf Fixes: 536661da6ea1 ("perf: build: Only link libebl.a for old libdw") Signed-off-by: Yang Jihong --- tools/build/feature/Makefile | 2 +- tools/perf/Makefile.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 12796808f07a..b18513ec4da6 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -178,7 +178,7 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) =20 # Elfutils merged libebl.a into libdw.a starting from version 0.177, # Link libebl.a only if libdw is older than this version. - ifeq ($(shell test $(LIBDW_VERSION_2) -lt 177; echo $$?),0) + ifeq ($(shell test $(LIBDW_VERSION_2)0 -lt 1770; echo $$?),0) DWARFLIBS +=3D -lebl endif endif diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index fa679db61f62..7d1003d2efb2 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -160,7 +160,7 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) =20 # Elfutils merged libebl.a into libdw.a starting from version 0.177, # Link libebl.a only if libdw is older than this version. - ifeq ($(shell test $(LIBDW_VERSION_2) -lt 177; echo $$?),0) + ifeq ($(shell test $(LIBDW_VERSION_2)0 -lt 1770; echo $$?),0) DWARFLIBS +=3D -lebl endif endif --=20 2.25.1 From nobody Fri Dec 19 19:18:10 2025 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 222271C4602 for ; Tue, 6 Aug 2024 11:48:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722944904; cv=none; b=EBSKHn11ljDFr52eYliBzjBK+U31galpVEBa6fC4QBSbqI1bojpITP/f3Hw6jX6b2eTzajejiBFwpgDvtRpITD9RBy4qinlGs3lFKVq8UcLH3SGL4vnstIjwjKumRd0BmNtt+8xp1m8tQ/J7eq8UPGsOJn9O4Cqi3rmu6eVjFms= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722944904; c=relaxed/simple; bh=qIjEnSp/JD5JYvreiYWkbvBNFQ5Bxx+6BfLNwZTCc7s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LRqU0AL5Q2wsH3Ne3JbG/O7pQESdUVU8QUv0w7h6kO7QGE+SEmv3jiRqoKLqMEPsCgRtqmN/uNGMcOppsd5pHtJnOQqMpF8IQiEYKx2OuknFKqDUGNpsq4++OewDm3AJxG9SdC6AhY72DGdIwcoZhFlwTxRkyuuyNEIVG4xUhwo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=caJoPGOh; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="caJoPGOh" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-70eb73a9f14so322967b3a.2 for ; Tue, 06 Aug 2024 04:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1722944902; x=1723549702; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IAh5UOxYiMS3JZXwzAnpcBRKJRQgjrownZOetlAThLM=; b=caJoPGOh+t/yGXHj90WGjnDWT+5uyxWYRmuK/YWB+UAJGSwPeLCA6yR0+gh+N/I5+5 kDp+HODBX3hM5NZgbf/gBlAjolv7Z2bRRtxtqdl5Ea1uMRT+8lN9JQZ53cXfgMMqiMZD xu1LGW9mHwflx7XQS5XIhpXJtJzxpFjKf4ziGaVhKdlTF9AnIoI3JuLsmALzCfmnauWH o30uXNf8v10E7mwiJmAtI/02ajxZ7ByY9Gt9CmwUKiXLVgiWeC80+eIrDSJeUPcI5CoP Q0rM4Yq7YN+Os2yCi3X5XLIRycAm9sIjefo21kdOZvJG0dCTyQnrKMJv65/O19mRQPJq KgOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944902; x=1723549702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IAh5UOxYiMS3JZXwzAnpcBRKJRQgjrownZOetlAThLM=; b=f0voXL3UKSWT9dgCC3DmDmGmsqqOsVv8ph0SgsWy3Xuca21GKJpDUeNjH2Qc6wb3PT 8RPCDC7T/4khU+bjbSg0VvoyuWMnnEdxm+oMFaxizXosqAJYrdrd2fZkb+8nioi8Ambe 8f22Ud5QSRsiJ56lFk8MB2i9OWk5rAbpZZVYn6jHqO7EV+StXubimubiNVuGcoiW1pyP Xt1rFZzDtDnTDBHAl5bTHVosFBIFzIIpykZV+uIqv4rMl4BQwceDEE6totq//esJju+4 aPQLPd1B/ataQEj1HUmU5KiyULw+73gqv0opXlRE6//g9htoSnr4IE7YYk1oOtsF649c FvGQ== X-Forwarded-Encrypted: i=1; AJvYcCXW1H1ws98RfzqM1wI8ZgBUlED8jkxGwOCdTdySWFOUQVe641H4ZpL4OGV2V5A5jh4/sBiz44htlaTTXjcteRLIce/eNNexmdI53VPQ X-Gm-Message-State: AOJu0YwK9+jfsJXbSeZg3xKBtIa/qAHQdOeRyj3t5/WX5hsw4LpKUauw bWTphucY+Hpn+XDqc1EZNjUti40scPqGM78T72p5SdBCEFmuexjIvY92oDejdFw= X-Google-Smtp-Source: AGHT+IGETLylbGwprz73Zkb8SQDnD4ImVbvWets0mlYTX8wJt4kjBTZn14Hr8rpwYH7jmye+eOK5pw== X-Received: by 2002:a05:6a00:b53:b0:70d:2837:6089 with SMTP id d2e1a72fcca58-7106cfbb944mr19895801b3a.11.1722944902392; Tue, 06 Aug 2024 04:48:22 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7106ec43944sm6831705b3a.75.2024.08.06.04.48.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:48:21 -0700 (PDT) From: Yang Jihong To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: yangjihong@bytedance.com Subject: [PATCH v2 2/3] perf: build: Fix build feature-dwarf_getlocations fail for old libdw Date: Tue, 6 Aug 2024 19:48:00 +0800 Message-Id: <20240806114801.1652417-3-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806114801.1652417-1-yangjihong@bytedance.com> References: <20240806114801.1652417-1-yangjihong@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For libdw versions below 0.177, need to link libdl.a in addition to libbebl.a during static compilation, otherwise feature-dwarf_getlocations compilation will fail. Before: $ make LDFLAGS=3D-static BUILD: Doing 'make -j20' parallel build Makefile.config:483: Old libdw.h, finding variables at given 'perf probe'= point will not work, install elfutils-devel/libdw-dev >=3D 0.157 $ cat ../build/feature/test-dwarf_getlocations.make.output /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/li= bebl.a(eblclosebackend.o): in function `ebl_closebackend': (.text+0x20): undefined reference to `dlclose' collect2: error: ld returned 1 exit status After: $ make LDFLAGS=3D-static Auto-detecting system features: ... dwarf: [ on ] $ ./perf probe Usage: perf probe [] 'PROBEDEF' ['PROBEDEF' ...] or: perf probe [] --add 'PROBEDEF' [--add 'PROBEDEF' ...] or: perf probe [] --del '[GROUP:]EVENT' ... or: perf probe --list [GROUP:]EVENT ... Fixes: 536661da6ea1 ("perf: build: Only link libebl.a for old libdw") Signed-off-by: Yang Jihong --- tools/build/feature/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index b18513ec4da6..1fc651cae9e5 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -179,7 +179,7 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) # Elfutils merged libebl.a into libdw.a starting from version 0.177, # Link libebl.a only if libdw is older than this version. ifeq ($(shell test $(LIBDW_VERSION_2)0 -lt 1770; echo $$?),0) - DWARFLIBS +=3D -lebl + DWARFLIBS +=3D -lebl -ldl endif endif =20 --=20 2.25.1 From nobody Fri Dec 19 19:18:10 2025 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3FD51C463E for ; Tue, 6 Aug 2024 11:48:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722944910; cv=none; b=ZhUl6R/7Kni8RClUyWmJB/lRoScroyLPz8NShXyXXag05YLeDykdtF/vsSVNUFQ4ljacgXUgIK+Rct+D4XIxByLFnnogWBW8+Q5z/pewy4DLDxZ4ENVPPQjnU4iYIwD62r7/TYxFDAOlEuJQJE23FwLHbVy+YtbDE98n1nr3M/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722944910; c=relaxed/simple; bh=w5HQUkEOQZ9OiMAzw+TwotIyqt5lF9ZFZ6Io5hL+Vpg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qu7aGwRcYduwU30Ak0uLdH9S90HVaiStqBBNjuGy048vs2YNOc1nrN3vNtnpBYMERyliQsYcZ7WkgrIUja9WavzyDFTCEbTMEwxhaIWRbT6xevXf23CxH76pNpAstc38wZl2/kFqVqF5Glu/YW4r5qyza/diErfs2VgSr4YlvfE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=krL8wpTU; arc=none smtp.client-ip=209.85.160.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="krL8wpTU" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-261112c303bso345298fac.1 for ; Tue, 06 Aug 2024 04:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1722944908; x=1723549708; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HHmg1SR6T64IROlakovGV4e3PjU8whLQ8HGL2eHtGe0=; b=krL8wpTUfKRG8ru4VZdVkWyeL3x0Jrgy+829XPRjtT2oM284hrTYcjy1BcBVaFpsp4 SbfYfQdKYLr/mlYOZx4kNdebdJ8CZlqDZT0LAI1GU5JASyAy+u6JCdGv5uS1S2lXNzjC aKBpP/uohepaxqwjZH8MoIv1PKmC0xE4uzBTmhT4ABherGj8Ye9inaRY4a8PcKXdagC4 PsIvjol1uab8Z9h1192CK6Y0TMEzoMif4bn/ezvyU49QWrhgYyZ0PJZs5jaqsA/gUd81 gBhPNqKacI1pCJHDuvAetrik4W3UgEvxEQ0BV1W33cHpXuus3RXc2cASHFX3cdE7GjFk rPMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722944908; x=1723549708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HHmg1SR6T64IROlakovGV4e3PjU8whLQ8HGL2eHtGe0=; b=QbkApJZ8hoTWRtGuf7p4qRP+bztCsVSFJPiz9YpuMij3eMqych/hBQHu2eh6vMYDKS ZV9zMCqv3ZTqURw+HS5rXyvpHNOxr6z6QE1aZ0BbVmmY3VGFCmyONO0NLbxnjXeu7P/j Y2/62CU5Xfdwgrys2gOfrePBIo0FLdVL2YxkWACpLnMJneuZ+UQOA7CFv3uVNE/iBK0e cqF924jmUXTYTVbSrWDfYQxk1nX97OvIykyw835AwRbSUyciDYdFOg9/BwbjY1rVml7e QV8242Pz7bNDTJpZHHO8N/sm7aP/Tw81ZXmSACJxc3johfgEkQsOMDwAXaTEAAhViePf tpsA== X-Forwarded-Encrypted: i=1; AJvYcCW7dercuMGbUaeAlhX+v7QGOLcn5Z7/DOidOQTFQcOU3v/r35lrC13dFTCA4qS3dKOfH/YtJvRelHxXz8AaaMx2Ch9oVqrCNEjePdmC X-Gm-Message-State: AOJu0Yx3wG/fiVY+sreWVKYgMyObwwjqDoRBkYUu7uAQerfMohNPIWUc x5icUg+JRcwXoV9VIFTOZUUpyzAkQO9PIQk5VVQf54/ANj1qpmAee5mQYceyObo= X-Google-Smtp-Source: AGHT+IGdkJ8/XmVLszO0PEPUN3TJ0RbZR+khjrBSEWmw3Rmb098Lzmz2r3RamSHWf5aQzQ8x+42NYA== X-Received: by 2002:a05:6870:96a2:b0:254:a917:cb38 with SMTP id 586e51a60fabf-26891d4058bmr20651507fac.27.1722944907835; Tue, 06 Aug 2024 04:48:27 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7106ec43944sm6831705b3a.75.2024.08.06.04.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:48:27 -0700 (PDT) From: Yang Jihong To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: yangjihong@bytedance.com Subject: [PATCH v2 3/3] perf dwarf-aux: Fix build fail when HAVE_DWARF_GETLOCATIONS_SUPPORT undefined Date: Tue, 6 Aug 2024 19:48:01 +0800 Message-Id: <20240806114801.1652417-4-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806114801.1652417-1-yangjihong@bytedance.com> References: <20240806114801.1652417-1-yangjihong@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit 3796eba7c137 move #else block of #ifdef HAVE_DWARF_GETLOCATIONS_SUPP= ORT code from dwarf-aux.c to dwarf-aux.h, in which die_get_var_range() used ENO= TSUP macro, but dwarf-aux.h was not self-contained and did not include file errn= o.h. As a result, the build failed when HAVE_DWARF_GETLOCATIONS_SUPPORT macro wa= s not defined, and the error log is as follows: In file included from util/disasm.h:8, from util/annotate.h:16, from builtin-top.c:23: util/dwarf-aux.h: In function 'die_get_var_range': util/dwarf-aux.h:184:10: error: 'ENOTSUP' undeclared (first use in this f= unction) 184 | return -ENOTSUP; | ^~~~~~~ util/dwarf-aux.h:184:10: note: each undeclared identifier is reported onl= y once for each function it appears Fixes: 3796eba7c137 ("perf dwarf-aux: Move #else block of #ifdef HAVE_DWARF= _GETLOCATIONS_SUPPORT code to the header file") Signed-off-by: Yang Jihong Reviewed-by: Leo Yan --- tools/perf/util/dwarf-aux.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/dwarf-aux.h b/tools/perf/util/dwarf-aux.h index 24446412b869..d2903894538e 100644 --- a/tools/perf/util/dwarf-aux.h +++ b/tools/perf/util/dwarf-aux.h @@ -5,6 +5,7 @@ * dwarf-aux.h : libdw auxiliary interfaces */ =20 +#include #include #include #include --=20 2.25.1