Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp599510pxj; Tue, 18 May 2021 10:00:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWXvDQfKbZMMQnCuGs1JkfuiGPWof3pYZB+xPI9CdP8nvZiSKm7JL5OLz7VXyzwu0FTS1T X-Received: by 2002:a17:906:2a08:: with SMTP id j8mr6907424eje.483.1621357217473; Tue, 18 May 2021 10:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621357217; cv=none; d=google.com; s=arc-20160816; b=SSak0neY8eCs++GacTUpmUx2TE0PWPnmcssYtGzeM0TSH+7YqcJDtCbKc9h/ujna8H krw/01pZn+hCu4olRSoaDi69u+cQJI9XdIaoWYLIzOC2Z+d3zNbC7ef8F+F9g4oiPljU uS73JySno8rqLRt3wVhkMK3dyenhsALBO5nSPrQRbjkKYyA6IztOYQ5/v0CjTV48SfC9 BWhVmjCaf5uWK9t/PevWAYKQgxZ1Q8aFe/OW4z9UXbJOtAhpshIYx9BB2Kt+kIuRYOZz vowmKqsbWeeJRhLG2qb7E9ecuAabPf7XKzcB9x80paDA6+4cZts2CswaYyCZu+lTr03i phkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WBKiRo3hr+d80Kb3PsNaRvcMuqVe2SsTSPX8fJxVOFA=; b=VdVtW7NlLM/AuM3G06NAUfFzVwLEvC+77+keHOXw4RvKssRvnP9dPvIlZjeUKSnec9 cfSSXuyc3RtiFUOea56/050dbspoCZQLiyqWOOAyTl3ixkb5Xcurc+jPT7AlWOvQlm0T vFhOYkVlZexVjZ6nB2aAoQFXtIKRVWRBG/dnhrWqgeXE5vpdlXUHV1fnY8++w35D353q F/eqQyqdJ6bgTYwhwPEuQxvbR+XBn8k8jKj1DoeS6S/jqjz3OD2kkAoUv5bmU32agbLA A/HRN3d4tjgA+7I/1TUTEE+oUqVviZ89RO5b9fSODii4T0U6HfLps0jHFX8Mfb2umSIE OIXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mThKyBUQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si14462844ejd.662.2021.05.18.09.59.53; Tue, 18 May 2021 10:00:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mThKyBUQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346410AbhEQQF7 (ORCPT + 99 others); Mon, 17 May 2021 12:05:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:52358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344301AbhEQPoP (ORCPT ); Mon, 17 May 2021 11:44:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C4FBD61406; Mon, 17 May 2021 14:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262595; bh=fBCwBoQIBu1Z/Im+ck+WQ9ZRSffBq64U6W6k0+CiYPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mThKyBUQFBjv60FKsTXXCDn+c/Eno/+iS7uvHYCXTGpLDmZ2hwCUcI2hzYYPNPYRO m80+7jc7M58EEuLwQIu7GhKm/mYRnJexnheVwapZ5WeKrFJ4rERdLGX8QRXmebrwXA W9K5tqNnyStePm1bNVODnNOIygCpoL+niPfRmgVg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Justin M. Forbes" , Jiri Olsa , Alexander Shishkin , Ian Rogers , Mark Rutland , Michael Petlan , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.10 221/289] perf tools: Fix dynamic libbpf link Date: Mon, 17 May 2021 16:02:26 +0200 Message-Id: <20210517140312.594711262@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa [ Upstream commit ad1237c30d975535a669746496cbed136aa5a045 ] Justin reported broken build with LIBBPF_DYNAMIC=1. When linking libbpf dynamically we need to use perf's hashmap object, because it's not exported in libbpf.so (only in libbpf.a). Following build is now passing: $ make LIBBPF_DYNAMIC=1 BUILD: Doing 'make -j8' parallel build ... $ ldd perf | grep libbpf libbpf.so.0 => /lib64/libbpf.so.0 (0x00007fa7630db000) Fixes: eee19501926d ("perf tools: Grab a copy of libbpf's hashmap") Reported-by: Justin M. Forbes Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ian Rogers Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210508205020.617984-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/Makefile.config | 1 + tools/perf/util/Build | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index ce8516e4de34..2abbd75fbf2e 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -530,6 +530,7 @@ ifndef NO_LIBELF ifdef LIBBPF_DYNAMIC ifeq ($(feature-libbpf), 1) EXTLIBS += -lbpf + $(call detected,CONFIG_LIBBPF_DYNAMIC) else dummy := $(error Error: No libbpf devel library found, please install libbpf-devel); endif diff --git a/tools/perf/util/Build b/tools/perf/util/Build index e2563d0154eb..0cf27354aa45 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -140,7 +140,14 @@ perf-$(CONFIG_LIBELF) += symbol-elf.o perf-$(CONFIG_LIBELF) += probe-file.o perf-$(CONFIG_LIBELF) += probe-event.o +ifdef CONFIG_LIBBPF_DYNAMIC + hashmap := 1 +endif ifndef CONFIG_LIBBPF + hashmap := 1 +endif + +ifdef hashmap perf-y += hashmap.o endif -- 2.30.2