From nobody Fri Nov 29 13:43:46 2024 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 5FEB920B35 for ; Thu, 19 Sep 2024 01:35:41 +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=1726709744; cv=none; b=ccRoYs+iXfatreVEEdLiVa8FLfRtU2D3OMI4S1ar850GRbUXNoBYA4JpUsjyF6kIJ3I0EY3AScGwKaGjuqHYHHd9eq2IrJrfSBShbID78y+un58Q40PV0uSOBMeOMlCMM0+73lHXYIywG4TkgaXfh16gh0vWDOs8Pw9y1LH25IE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726709744; c=relaxed/simple; bh=F8b1g0Z92Ug19zyp6jdn3B4tPcHN849288VrkCnUjIA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gQUPME3tTxr3Ld0b9NAM8YDmQ7qlMHN87mCWpJlazfLTcmyJye+0f49rDzkIgzr3F0bIlrTJ1YsMtzGbr4e57jkJuJZiQl0CYeBwRBAHCY2BWqYS+LSaxiluRAPPcKsljF9rxouWtb397zOHpU1pBqM4PCClvVs/gM3JsMWnS5Y= 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=S2lA03LY; 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="S2lA03LY" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-7179069d029so221313b3a.2 for ; Wed, 18 Sep 2024 18:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1726709740; x=1727314540; 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=6PRoelqNRnL/2mNFBQIluG5bm8U+edM43UW4Amub3LA=; b=S2lA03LYEWc4BDSAzAnAmd7kYqJ3LPl81V4f9eQLl3bSVJgD5PGPy+zF5UQX4MOK8I RJx3z44fN0LC338zpq6MA4YzEZIT4QW/tWa/cG0iIZvHuBj4zW/OwtMjwvkMYZpH7poh SI5huoJgL0+UYBBW1HKSnbXnuo9BqugoApR9FGcs4TfcqDv6pX8+7+Bldr4l44eIHyEx 63bYjEcdN77AuEvIbNu7AO4q4GVU8fd72YJ/09mWOTuZj6BPpMW6DNLWmukmDeoCi65s +c2upaj6spkCTad522CIqbESygcELibXEZC6vp4S0qGfglo9RcVSqPxrVv98Pm+jz0Pr JNGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726709740; x=1727314540; 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=6PRoelqNRnL/2mNFBQIluG5bm8U+edM43UW4Amub3LA=; b=JI4P+sKKXOLewG5lT5428U0KPlXhIYPS4ZxYl2wLe2ba3hNy8jqCLz7Lqgg3Z0SREK Sl4A6pg5s+CJpy/EcVmpMyQGXCqzu46BRtt4bfUntoYYwV/YFe0QCxhbl2uLgElnJ36L v14bGRBgZYwJsgPYVYREbBh+vo4xeS6BiKTfUVNQhBvRK4t6PcTW5nOS6XXCgn9NeufE nnr/IJSM/U9Ham5EqU5yAS/1bky4wFurIhgynrr9fwVFShuaZsUNjMMji4mX/xwEADgK K9z1PHSM/Urn/Ja/1ggs78uzizxjpcva/lN7LmFwvAO+gsineM5SUS1dftdwDJHgMse+ krGA== X-Forwarded-Encrypted: i=1; AJvYcCWexv/Rxmrw/IxGXDSJt/VmKBt1wpGtEGgCTEGtM/gxEOQ3ez03BwYlhcSNJLUduJi7guwnyTgSg0uUin8=@vger.kernel.org X-Gm-Message-State: AOJu0YwQtHFxWG1ZbRNyRm3wRt9niI8XgQFU95utRd/6J9+yiWI+GVch 3gG0BmYwa89p8iBc6iBUl7lwS75usa0GnpUypgZl5+vgMLEczypJitICLvA5tms= X-Google-Smtp-Source: AGHT+IHbp4ok7dwua8+rGMyIXaJ4OmQHsgI/Zg3VmaOM5LiSUWeDv79Fh3Tgx0+xDLeSw5mSA3VQvQ== X-Received: by 2002:a05:6a00:1799:b0:714:1bd8:35f7 with SMTP id d2e1a72fcca58-71936a60297mr27646676b3a.15.1726709740529; Wed, 18 Sep 2024 18:35:40 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.11]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944bc9ed9sm7282482b3a.209.2024.09.18.18.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 18:35:39 -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, james.clark@arm.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, leo.yan@arm.com Cc: yangjihong@bytedance.com Subject: [PATCH RESEND v3 1/3] perf: build: Fix static compilation error when libdw is not installed Date: Thu, 19 Sep 2024 09:35:11 +0800 Message-Id: <20240919013513.118527-2-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240919013513.118527-1-yangjihong@bytedance.com> References: <20240919013513.118527-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") Reviewed-by: Leo Yan Signed-off-by: Yang Jihong Acked-by: Namhyung Kim --- 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 5938cf799dc6..6f1c961f0ede 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -172,7 +172,7 @@ DWARFLIBS :=3D -ldw ifeq ($(findstring -static,${LDFLAGS}),-static) DWARFLIBS +=3D -lelf -lz -llzma -lbz2 -lzstd =20 - LIBDW_VERSION :=3D $(shell $(PKG_CONFIG) --modversion libdw) + LIBDW_VERSION :=3D $(shell $(PKG_CONFIG) --modversion libdw).0.0 LIBDW_VERSION_1 :=3D $(word 1, $(subst ., ,$(LIBDW_VERSION))) LIBDW_VERSION_2 :=3D $(word 2, $(subst ., ,$(LIBDW_VERSION))) =20 diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 4dcf7a0fd235..0049fd41cf57 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -149,7 +149,7 @@ DWARFLIBS :=3D -ldw ifeq ($(findstring -static,${LDFLAGS}),-static) DWARFLIBS +=3D -lelf -ldl -lz -llzma -lbz2 -lzstd =20 - LIBDW_VERSION :=3D $(shell $(PKG_CONFIG) --modversion libdw) + LIBDW_VERSION :=3D $(shell $(PKG_CONFIG) --modversion libdw).0.0 LIBDW_VERSION_1 :=3D $(word 1, $(subst ., ,$(LIBDW_VERSION))) LIBDW_VERSION_2 :=3D $(word 2, $(subst ., ,$(LIBDW_VERSION))) =20 --=20 2.25.1 From nobody Fri Nov 29 13:43:46 2024 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 96705335A7 for ; Thu, 19 Sep 2024 01:35:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726709749; cv=none; b=nq0LDx/4Lmiw5hCR3w2FfjauR6ubcgmDeA0Z9MX+NSXTi+sdGldwtcBhfaHvXXaX0p6AWWRC4pSb36KDCP5+Sfa9F+4y6JULV/bUmwwfFc1EF+oA8SCJyezm2I6lYao3U4OKj4ZIBoFkO7s/9oltuGIkRAa7ZXeTecopmH0BW14= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726709749; c=relaxed/simple; bh=PjKZwYz/qw8iWT80kCLlkaaJkclWhXR9GCyS8HXcdZM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Jkm8aiF6mSLc1lrVGQltDjPNErGH4NVqztWmKm8h0bIdlM7PYrlnxYM4SMX7Sq8Z5jLdK6nO1c9Um0byPIN+Dy88Re7B1dPyXERUSDqs+teeuBU4+jIJJTA4zrz31gICF1KKCKH/vtjoUU9bmqD+d2aWWFAiqiGDVFYTXN/kjGM= 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=Dhd/3g2+; arc=none smtp.client-ip=209.85.210.175 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="Dhd/3g2+" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-71971d2099cso224044b3a.2 for ; Wed, 18 Sep 2024 18:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1726709747; x=1727314547; 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=dRPR2z4bSKPgcYHClioZjkMZaKzgMP6y1ywJmn+vlyw=; b=Dhd/3g2+MgHW0brRUMZTY7JsZYZ/ZKkXEsf/E+3VLeSl939BGgNbgkFMhvf0MbrZzK EgPAeSnVkwPjD7uYD1KPXIDOzc50x2oiGzXOe6wbB+vDaOy62n7iN7xp8u9KMZ2L7ls4 EeQBzzYIgsRgJEKMVjW6uFLsrozVBmGq0o63oNNUYhsBG32IcmE3QTctynbyMfz0c8Ti WlBVNkE5v6zhhPgwYWz/a29R6VrgLZ+5pZnASOehmKoLJ8ZRoW68g5eltKUehDn22rLy k384w30W1Icxj45p9mSARoQ5FLvLTUArd0GmKj5vFoABzwPk6Yuoz0o2XhNZJ1xkkz4j /nXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726709747; x=1727314547; 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=dRPR2z4bSKPgcYHClioZjkMZaKzgMP6y1ywJmn+vlyw=; b=HauGsam7M8Auvy6cmkw6u7QzlUQ6Nfnbvyc9c5UvdZDammhO0NPeVHu9xqH9SWqEqS GGZ8zXNDV5rxC5GMwz9UOxpJU8HHm4Qm+6en6VMLeEGK2ZiE2ROLscBJFBgVl27ZxYpT 9tC/9WonK2ruA0DsQ5R3inc/8VuWNUm1dKZUZaEEZ2AOKw843aDla4XLOp5Gqv8d7k6/ mARXTt2TS81Sl5HTH69jLrWBPe7EQwNld9oAL3JqTrpVyv87sU8F5VE7Ao1J8UNeGvn3 iAWn0ChoTmqENadJOH8Kpk0dHjx5CgG8dEPHsHl7QH5eTL3mJUgO8mR0WwuqcxDti+Gq HOWg== X-Forwarded-Encrypted: i=1; AJvYcCWrvslO8u0iQhiuZPH9THkhF72hkLg4Zs3Op9fwwn2wSG+KWzuo0SF+CrIxtElKI+ItpiC2wpNoMRH4o1k=@vger.kernel.org X-Gm-Message-State: AOJu0YyBv6ClHhhMOK8iyeRiq2aqZWFbTZLq1yGYXBMPZkWGW5sf7q22 u2D0JemFeVHLMHj0STXvGz8U4k5DhlmnhInrihNkHSb2o4gRc5RTZala0P1nLzY= X-Google-Smtp-Source: AGHT+IHJmMjgMpHs8cK/HKaUs5kUDu2r20vARZpe1WeIcoN+SfDr0aRr0YIJACU2NRUalrc6n6Fr5Q== X-Received: by 2002:a05:6a00:2d17:b0:717:9483:5887 with SMTP id d2e1a72fcca58-71936a4b6a0mr29329476b3a.8.1726709746807; Wed, 18 Sep 2024 18:35:46 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.11]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944bc9ed9sm7282482b3a.209.2024.09.18.18.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 18:35:46 -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, james.clark@arm.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, leo.yan@arm.com Cc: yangjihong@bytedance.com Subject: [PATCH RESEND v3 2/3] perf: build: Fix build feature-dwarf_getlocations fail for old libdw Date: Thu, 19 Sep 2024 09:35:12 +0800 Message-Id: <20240919013513.118527-3-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240919013513.118527-1-yangjihong@bytedance.com> References: <20240919013513.118527-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") Reviewed-by: Leo Yan Signed-off-by: Yang Jihong Acked-by: Namhyung Kim --- tools/build/feature/Makefile | 3 +++ tools/perf/Makefile.config | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 6f1c961f0ede..1658596188bf 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -181,6 +181,9 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) ifeq ($(shell test $(LIBDW_VERSION_2) -lt 177; echo $$?),0) DWARFLIBS +=3D -lebl endif + + # Must put -ldl after -lebl for dependency + DWARFLIBS +=3D -ldl endif =20 $(OUTPUT)test-dwarf.bin: diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 0049fd41cf57..4ddb27a48eed 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -147,7 +147,7 @@ ifdef LIBDW_DIR endif DWARFLIBS :=3D -ldw ifeq ($(findstring -static,${LDFLAGS}),-static) - DWARFLIBS +=3D -lelf -ldl -lz -llzma -lbz2 -lzstd + DWARFLIBS +=3D -lelf -lz -llzma -lbz2 -lzstd =20 LIBDW_VERSION :=3D $(shell $(PKG_CONFIG) --modversion libdw).0.0 LIBDW_VERSION_1 :=3D $(word 1, $(subst ., ,$(LIBDW_VERSION))) @@ -158,6 +158,9 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) ifeq ($(shell test $(LIBDW_VERSION_2) -lt 177; echo $$?),0) DWARFLIBS +=3D -lebl endif + + # Must put -ldl after -lebl for dependency + DWARFLIBS +=3D -ldl endif FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind :=3D $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind :=3D $(LIBDW_LDFLAGS) $(DWARFLIBS) --=20 2.25.1 From nobody Fri Nov 29 13:43:46 2024 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 BAEBA5FEE6 for ; Thu, 19 Sep 2024 01:35:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726709755; cv=none; b=PLglSF0Z79nGOov2xk2+ottNPWJfTuugiD0QqgYrGzzQHQpNQBWTZ5f9LE7V9GZQH6OKk5Gljxrge1peLuO6FdxtGhoQ/i7giEquonS4m9mFUej9L+JwKPznS5phi4Bg1e3TqW64ytfl+v55ENlHtABWyZYUcdExvdHwfZlOruU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726709755; c=relaxed/simple; bh=quPAw/YDVglqeBc/pZOlGo1b4LH4gcDFKP2lbdn6t4Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XZ2DkbhsR5D1AhkovM6HDIcW8afK+ElUzqv0QMxrvR+ZoOmeJPnUzr8PHwKEW93JOC8yHMlAfmf61F2H+7q7jpIbzpLaI5vZQgqOz/00n4jcPHFk/lApvZo1eWeP4t9AdkD57O+/bVG5IVSGAz4nBdlRbOBbje3iJdACDS1kr1k= 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=Q78xypdg; arc=none smtp.client-ip=209.85.210.175 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="Q78xypdg" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-718d91eef2eso216593b3a.1 for ; Wed, 18 Sep 2024 18:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1726709753; x=1727314553; 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=npTyP93XedPkwqp1pklFR6c6ybhIMeDgxugJALQqnq8=; b=Q78xypdg+Rf2PqrM634/YVRwe6ss8TYa2ZTVXRA5TXGWZcldDfL2kisP5DYSDU8opT dwkEX/dX22mC3q/affO/eNEnGEeiMptGe/diSXkS7fU50Ob/bkpfUW8OiROFioPDL7v+ M9VJip1S9PCM9+NtCKoaupP9aBH4jXH0yWhUGQROj463bmY5ol6TIYxU4B5xRzaRQ2pO AvpyrcFbkbOCGl8dgf0Y0ztr3bR/NrdTJSltYCq6Wt+MVAuS0gyM2QMKkYaVlsPqjHDn zWIu3CkLNrShkak3Tprk+AvaJ0VrFoWTjd53puUi0lL1td9XgWOftBEDnuE+s3W729of mAnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726709753; x=1727314553; 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=npTyP93XedPkwqp1pklFR6c6ybhIMeDgxugJALQqnq8=; b=G4SsVCNu9NDNPzUKXmLytlynNay7ABri4UC/NXmUHfhovveQvdXhX8sR5UnHR8NB4E e1jW1vFEJ8tt5f+M8O1sItbSZ8NAsXnFViq6FNgL15gJZN8NvqaH1TugdkXokOB1BEmO WG9UmF23IG75KxX8T8VCGAk8xso0WeJiYJu5wMPV7E4HzxPVjnDKjPD0/LXn6QbHWLnV 3R2a314WjUaFhfkXnO4Cf66T6xFHQjJtiH8RuEJkmgE3nCZu4C10e+p7EooDNNa2k/Xm Bdw8S4ruX1QAXaRmdX9snpiC6T2uWtL9nBCb5EfWZ17x8ZJrgMXHJDsAunvHIyQNUfJf a0Nw== X-Forwarded-Encrypted: i=1; AJvYcCXiPY5FmMqMRbGxr0iAZ2vwkF0gZhrQq0W/DgK25jc2mDbyk5ezJ7Az+vjzs6a0kGl8V3E51GUihyx3fIU=@vger.kernel.org X-Gm-Message-State: AOJu0YwGM+e7nrsVQtunpPrB9O80lbH3KrJGFFrF9ZUSOV4u/cEorrVH YL5gnu0UZsbiPFJzgrFBpCrzPOwxelVyi9cRHSIwAHbrWxLKPNIBHQn1Aetc8fs= X-Google-Smtp-Source: AGHT+IHxbKgK7PAsYYuZNq3ZCOnnJEros1Mxbwcwe7M8IhLy178PSrgisJMSb75ooD3rqXnIF3RmwA== X-Received: by 2002:a05:6a00:98c:b0:70d:36ad:3f67 with SMTP id d2e1a72fcca58-7198e2dcef6mr2079730b3a.11.1726709753039; Wed, 18 Sep 2024 18:35:53 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.11]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944bc9ed9sm7282482b3a.209.2024.09.18.18.35.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 18:35:52 -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, james.clark@arm.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, leo.yan@arm.com Cc: yangjihong@bytedance.com Subject: [PATCH RESEND v3 3/3] perf dwarf-aux: Fix build fail when HAVE_DWARF_GETLOCATIONS_SUPPORT undefined Date: Thu, 19 Sep 2024 09:35:13 +0800 Message-Id: <20240919013513.118527-4-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240919013513.118527-1-yangjihong@bytedance.com> References: <20240919013513.118527-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") Reviewed-by: Leo Yan Signed-off-by: Yang Jihong Acked-by: Namhyung Kim --- 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 336a3a183a78..f0d702b9ad75 100644 --- a/tools/perf/util/dwarf-aux.h +++ b/tools/perf/util/dwarf-aux.h @@ -6,6 +6,7 @@ */ =20 #include +#include #include #include #include --=20 2.25.1