From nobody Fri Dec 19 20:37:36 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 2FA521C37AF for ; Tue, 6 Aug 2024 11:32:27 +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=1722943949; cv=none; b=oa33niHGpbIYUbGY+9PWP3qNj97jOpJf913psYsv7+9cqkpr8EFP/nLj+i8FvB0Z5o2dOV3o3vnsHTH30ofCNiCsU/Yu6M7E6uKISCXNlUlFccQbbVbfIHM6HhTv1AQsaumQpuvzVgo4VSN6jkk1e9lO1ywjYTlp+MIw86a4lxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722943949; c=relaxed/simple; bh=lLK53uiQC3bZkEy2L61h0TC52VfEBeHo0ujP19/cMQU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gJSMbeFEl2cWuDihS1H0leUOIDBp3e24/z6WvD/tqhixhkd8DFFy4L2T8WhaDKEKscQauYIRmsYTuZ2a9la5HkeIJmzYg99MBoU8+9Pv1odU2ZNesToBdn2+IEIFnoB22kjGu6uAXCYjoYIEK746MnIOSfwnAbg75RDYCKzRM18= 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=dJbIN2Pt; 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="dJbIN2Pt" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-710afa8d1dfso367589b3a.3 for ; Tue, 06 Aug 2024 04:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1722943947; x=1723548747; 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=dJbIN2PtZ+E9NY80Cl3aqhv45lqfO6uRTujRxeKgUr4RX9ky6zejHffwNYwDPkDmxc 1Ow/H/p+dv1Jtkatf1p7D8LKMyoIS4G2Vdy7mIhm92j4njuPu/gy/sgg2tOssWjC8APT 1wOvY/A5+X7u/XsRJ3j76daPLaLXvlxrjVEzEbVAyXQ7eoAyl8wz665d62qiLIrSaUEq OZFR/qkkO09/bBqujjHPUawS8ZK/ZtB/SIguin6UUGxegWEePd88Jxumc87u87Rzc3Ry HOGai6DyeLPMh8nXLYJOXHRWPM2AeN+vSphjeFI6MS5GN1C/WPHHml9mGGeu/8MFAYr4 GEhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722943947; x=1723548747; 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=cuoIOi3V8FmiKBuMN3jEkyNNs/oRmoZoOYqGlhyAtVLE0LatHoezQMRcEb+eEOqrOg 6BIIvL9htrGNbQtSRdYKUJ0H65W+0SjuJtf6vGuSC9zmcSQMOwmgUNEgszRID3tWRNWl WVVmD2u3nAbPQcYveDiQ9cwDSwyCRWZWA8/L//1i/Bon5/6Rf0UyTGEkmVTMwmf2Krqi nyLAqMiA4y/z759Nuk7chcsktJtvmKmgn2DpEYlAtdR+7i0tH3VsR40tlBOs27ycaGzh gB6xog1Yaq9BDUaKXmITk66Auh/5kygCrYXvly/ZF8XT3Amum0lINSorTM6eSpTBFjQ1 iKJQ== X-Forwarded-Encrypted: i=1; AJvYcCX6gtblh3FYAC0oJRrtsbiSGlhGpiyyWxPD4C0LPgro8Vvr4kueEbCA7T26kK/Sle736GVCWuK3eKDLgltc1s0oaI54XpApy1lHLpPG X-Gm-Message-State: AOJu0YyQuaoaiByctz1VdKnP39ZhWkU47Fje2cXrVjN1kbaVaQ8VE2/F 0KIsDcKRBWlEo5ocqmEQXmg9uLNu6LkJrGwDV+SXVVm0k+zkSoepHcv6VCKrlgI= X-Google-Smtp-Source: AGHT+IEvdkKGe2EwXTxVWrJg30+nM5xJA83kRoJ4CpY+yFaFwFcp9sDq0HGbNJaOeQHwcSb9vc5rSA== X-Received: by 2002:a05:6a00:91d6:b0:70d:311b:8569 with SMTP id d2e1a72fcca58-7106d042f43mr12648556b3a.26.1722943947312; Tue, 06 Aug 2024 04:32:27 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7106ec010a9sm7037636b3a.10.2024.08.06.04.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:32:26 -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 1/3] perf: build: Fix static compilation error when libdw is not installed Date: Tue, 6 Aug 2024 19:32:08 +0800 Message-Id: <20240806113210.1649909-2-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806113210.1649909-1-yangjihong@bytedance.com> References: <20240806113210.1649909-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 20:37:36 2025 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 D5DA81C37AF for ; Tue, 6 Aug 2024 11:32:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722943955; cv=none; b=R//2ZxJNh2gwBZUm262XjnZ/GDmtRs8RXkdCH1LU09IpV2J1kpOV/HApbc9IbxUi9ru0TPIKPdLrmjP6volBn3tjqWmMQRTEdqEF6rRkbJezCm+UvYgvadL3a+4PKbAOhqsdJk990nW2SGJZ1uZZ1en4I8rSVzDJfgYZgBJk6Gk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722943955; c=relaxed/simple; bh=qIjEnSp/JD5JYvreiYWkbvBNFQ5Bxx+6BfLNwZTCc7s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VYcM47vnhhLDJkH/CNvpkGG+IVGNanlfr3v8ZtuRW4LPfeYrECz2YEapM5ec+W0ttNQkKy425Lfn5yka8OMSOJWw/5jruIFpbgDdLL3JUN9FyLFNFPjrqPLDJD04q+ee90RHtuZsbwkHPwlkBH063a4hgSFmeEri0XUJjEqT/w0= 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=D2Ul20yW; arc=none smtp.client-ip=209.85.210.181 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="D2Ul20yW" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-7105043330aso415645b3a.0 for ; Tue, 06 Aug 2024 04:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1722943953; x=1723548753; 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=D2Ul20yWvyrX0ZpDxGjW1oFrz1CNqh4TeVwOxMzQTeapL4y5lxFs+rIDTzHyrH1GU/ F9/6ybVUICer9d6B0Nnq1CDc2h1Hu8su/48T08+bq0EiiWnVaVA1g5BwLDivNNiTtse5 EMqXX9hClaXpmDNhJ+DAtxGxhxTYWK/wfGObc8QImQCk5HQl6be43hmmAZ+HHw1iigCP 4kAmiF8HPqjXpQ0QtSh1CvAIIybN4bHTlj2NUwA0vj3zShqXachO3FNn+iUvTWPCgTa1 FkubmOOAfc1K6qbygZhkFYNLqURRBKpJK27ryFSYp468q/pImLupLPhnoYb3/tuA8goF uT2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722943953; x=1723548753; 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=uXBDF1rU4HevavAC/nMQ2aY50JikxGbB1NbEs28+mIM9kaAKx80VRCLoHreDuQR5qd kP1NumTrvYVyqJw3y8vgGjrKiM4h56v9J8prMhhG4YC1DWrj+ofsP4TtrRr+D4jeyXVb Ieedh9yOvRmvC32ndRvwMYzWvzmEf9rfPlZrryJECgsBgsnEJTG2d43fS1RR2mLn8Q8A usPB6ozIaprD5nNSFYG//HYwDqJ23H9lkZqFjfSPWTSsjIuO6S6X4Kf+P8+PU3hr95/Z ktp4s3QGOwFVB66df2C5HjTNqfxcCS+Sqh1l242Dn4X9n3nBYuDg0GEBBsRy0vL9FkV6 xFdQ== X-Forwarded-Encrypted: i=1; AJvYcCXfghN4EEDUfmwaA54rN6Vy/cEK0soO8n26dMEsv7BdnAC/jG73+NrOl1oVCZWp3bfOiwfoJJPzs7vRBBtknXaVk6/xwdF0vmjKNjPp X-Gm-Message-State: AOJu0Yxnpy9z00yNWK7AD7nHzIFDcNSs8Omprp4Fr7qApw8Q6SNsoYtD ZChHk39/kpCoyJnMjCX0Cani+irDk8dDGs74xFCb8VZNAAPRLxMqVusJtRJxI0Y= X-Google-Smtp-Source: AGHT+IFLkMm1nd2fsBj1xrh3zpLNwTqpqzJAdGAu26eIbMgvxuF4IME8khxZS1c42atzcqMwOFNk0g== X-Received: by 2002:a05:6a00:1253:b0:70d:3587:c665 with SMTP id d2e1a72fcca58-7106cfa14damr15822735b3a.2.1722943953092; Tue, 06 Aug 2024 04:32:33 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7106ec010a9sm7037636b3a.10.2024.08.06.04.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:32:32 -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 2/3] perf: build: Fix build feature-dwarf_getlocations fail for old libdw Date: Tue, 6 Aug 2024 19:32:09 +0800 Message-Id: <20240806113210.1649909-3-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806113210.1649909-1-yangjihong@bytedance.com> References: <20240806113210.1649909-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 20:37:36 2025 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 75D0E1C37AF for ; Tue, 6 Aug 2024 11:32:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722943960; cv=none; b=R2rtfcXsZRxzy3UGf8AGxPdu7523w5eHE8bBUWENqEzZ7UOs7wOtiDmvl3glIXfaX0ASYEAJGa8VYxJ37AjC+nyaFE+/6HxIuW93x5q/mg6mVXizRalZ7A201vl9E/jZ991WeE6D4kI7SmIcN7mLdQ/zm1cAHbXI23mWrVqYTCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722943960; c=relaxed/simple; bh=bw7O6XpHC7r+m1CC4YZziOd6gskK8nQ4ogco5AG2D5U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=A89QF8hS4M4G8pVyGq10gy0vQxVl56QO2i6JZZ1b49QdopASQQ4XfusKoTHFj+ZhilFtPoTEyO0e4ITxZH6wwiMe1NGuUrcP2lPiLiu7MojHWy3sIsHofGXHhfEczXWG1x1JvWKgTKzkjIgfq3iXkdeNzC0aXTrQaXqI0BEuYdk= 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=gzFyxmw+; arc=none smtp.client-ip=209.85.210.182 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="gzFyxmw+" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-710afd56c99so316394b3a.0 for ; Tue, 06 Aug 2024 04:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1722943959; x=1723548759; 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=A3d7qHXqlvdC3QbsQBCsXeOqWxtvBelleMxdV+48O40=; b=gzFyxmw+Iky+a3VsqQhQRccntlv94QMZgB9D4RSELzMTABaDoN4YGTftCaQBZC7fn3 UHybZbLfY4chLLxXLjHi71nhOpgVOWYEaMpGgJ0NkyQ1EKVgdAgKQ9CSCes2pDwwaYrr TvPlze5Gq6XWITU5bzV3j1go4r2MY5Ew3t+AjYtpxKZPIyAOxpM6dorriOp17KrisoZP 5uLNaQXFVW3wAlaIsGolrZyKxlNOi27T47oxT7MzPBFrc0Zr1IfnpRO4xDh/Un30psFS 1RG3z1HWAx0Zm1yA4USxtR4qZ8Q71NUz3Nx7mRwHQNnnkBEs+jqlMRg7XubSNzc1yzEd iqoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722943959; x=1723548759; 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=A3d7qHXqlvdC3QbsQBCsXeOqWxtvBelleMxdV+48O40=; b=Wl+A1UsOtAhYlQ/amulKdV47EyFp5lJH79iq9Urb+L+F5MBOj/7Jm810cwwu2uiDbz IJIoY9jbQwer1XcNrtHbsy88tN498dk2gYFMQ/ZfiPG3ClfJsIw5Svn9npcDz+e5oCw8 6aYZ/6rLHGdrQ56VjNeyPSOzhUn9152FjCHhCLVxP9RFp6Wg8BzQ3r/GTfAx8KK098L6 4nqhJrnY4/aOGi1+i8ZYqZUOE2ToZneG6fafnn7gCX/B4yPLubGUpxesKkexdQFz4Nac ftDkdVlwxnRvwVHSDGjxIawE20I6ce813CB8rmMcSJucMuHj3MqIlzDvf2gyvvMRWFAW bdcQ== X-Forwarded-Encrypted: i=1; AJvYcCWYPe9KLfa51wwKFlt7e9l6D2spZrHnZui2DA5WfVUYcumon5p1cTOoOTJAnPHrGO2gbyKng3/mzpMpEsAdqfEkejgRP9b2OyyGh8hE X-Gm-Message-State: AOJu0YxwI+C64MfHC2ufSstNv10LCxruwNSt5SC5QDDcrtluOx5sLVIa d1vZfFOjV/f/wa3CWKKHEW9cUgTN2izwT5G0+tGnLlFsxzJ12cyFgINMoy+1354= X-Google-Smtp-Source: AGHT+IGqyXhOwbbxASKs3xPLtrpmSHfC7s3rObvLhLPzu6W/OCCW9ob084bsPdRxfXVrD+izaXegUw== X-Received: by 2002:a05:6a00:6f1f:b0:70d:2ab5:8677 with SMTP id d2e1a72fcca58-71065f1d9bdmr26800444b3a.10.1722943958615; Tue, 06 Aug 2024 04:32:38 -0700 (PDT) Received: from ubuntu20.04 ([203.208.189.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7106ec010a9sm7037636b3a.10.2024.08.06.04.32.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:32:37 -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 3/3] perf dwarf-aux: Fix build fail when HAVE_DWARF_GETLOCATIONS_SUPPORT undefined Date: Tue, 6 Aug 2024 19:32:10 +0800 Message-Id: <20240806113210.1649909-4-yangjihong@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806113210.1649909-1-yangjihong@bytedance.com> References: <20240806113210.1649909-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 =E2=80=98die_get_var_range=E2=80=99: util/dwarf-aux.h:184:10: error: =E2=80=98ENOTSUP=E2=80=99 undeclared (fir= st use in this function) 184 | return -ENOTSUP; | ^~~~~~~ util/dwarf-aux.h:184:10: note: each undeclared identifier is reported onl= y once for each function it appears in In file included from util/disasm.h:8, from util/annotate.h:16, from builtin-report.c:13: util/dwarf-aux.h: In function =E2=80=98die_get_var_range=E2=80=99: util/dwarf-aux.h:184:10: error: =E2=80=98ENOTSUP=E2=80=99 undeclared (fir= st use in this function) 184 | return -ENOTSUP; | ^~~~~~~ util/dwarf-aux.h:184:10: note: each undeclared identifier is reported onl= y once for each function it appears in LD arch/perf-in.o In file included from util/disasm.h:8, from util/annotate.h:16, from util/block-range.c:3: util/dwarf-aux.h: In function =E2=80=98die_get_var_range=E2=80=99: util/dwarf-aux.h:184:10: error: =E2=80=98ENOTSUP=E2=80=99 undeclared (fir= st use in this function) 184 | return -ENOTSUP; | ^~~~~~~ util/dwarf-aux.h:184:10: note: each undeclared identifier is reported onl= y once for each function it appears in CC trace/beauty/fcntl.o CC builtin-probe.o Fixes: 3796eba7c137 ("perf dwarf-aux: Move #else block of #ifdef HAVE_DWARF= _GETLOCATIONS_SUPPORT code to the header file") Signed-off-by: Yang Jihong --- 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