Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1342114ybb; Sat, 4 Apr 2020 01:45:29 -0700 (PDT) X-Google-Smtp-Source: APiQypKOiUpAHwpoFmNqLsaBR1G448XL8Udd7UhsEa0sbMki1EOJiKIHuZfI/uekB7v/bV1+dFmL X-Received: by 2002:a05:6830:15cf:: with SMTP id j15mr10237478otr.292.1585989928916; Sat, 04 Apr 2020 01:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585989928; cv=none; d=google.com; s=arc-20160816; b=yuj543QcJG64BRwS/m31lihl5pN02W0At8eofqmdyoZ9RTgeBOcakw2SKpTAF+Gsj5 +zHWy03vc/xXr/fOnoPMsdh16ZZSPBVDRRcL4P4hXUpHy8vX5Ggl6pUUg+zLiBv+7ReQ 3fH6pvTx7vMBeeMWub99m/yx/JPQZ1up0MKIQX692+af/aHXsv0B64wW4v8Dkt/86kOQ ChWpWLUhP4Z7H6XURf7hAvMzETuP99bHgW1FfTHQOoUiOxoZOlQ/JflOEcStkvpuGkAV h/+Yj9gtwsv/6f7HiJl5/mnOxxd4zgksClG/jSozYRntNP5zIR8uyNQq1BdmyDmGBxTV Ey8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=WOB84QuTwgmcNAJ4FGtYSEzSWYjWp/1saK8EKiDbVVM=; b=fTLB/NzzpGXBFgZ6Cjo2mcHyiCj2e47srJZD1AaHQR44LXZscLchNQkccbEF1Sg+qt giI83cm7poifoih+WaVgRv2Wj5lywKbnEXOcNMcAYps2MPthSda5OcOVC4wEXQ/iha47 Q5yQv134if6dK8P3NljylugJUDGGkXQTpcRpn2AIzL3Zimj3Phe5wTMsalM9SpPlbvNy PM5KgrDufqIIZ0f4PihqnNVm/2qUwwKpYbiJZTePHCFTJ10WR6MEIN9pwRw38OWh60nO SaSL6uttLigWFwr+0kxqyRkuASS3QWVzUQCEXpcXcj20uumgywk/oQ+ihgRtbz9dVyO3 04JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si4679990oia.194.2020.04.04.01.45.16; Sat, 04 Apr 2020 01:45:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbgDDIoa (ORCPT + 99 others); Sat, 4 Apr 2020 04:44:30 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:41480 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbgDDIlz (ORCPT ); Sat, 4 Apr 2020 04:41:55 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jKeN1-0000uS-Tt; Sat, 04 Apr 2020 10:41:40 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 8FDF31C047B; Sat, 4 Apr 2020 10:41:39 +0200 (CEST) Date: Sat, 04 Apr 2020 08:41:39 -0000 From: "tip-bot2 for Sam Lunt" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf tools: Support Python 3.8+ in Makefile Cc: Sam Lunt , He Zhe , Jiri Olsa , Alexander Shishkin , Mark Rutland , Namhyung Kim , Peter Zijlstra , trivial@kernel.org, stable@kernel.org, Arnaldo Carvalho de Melo , x86 , LKML In-Reply-To: References: MIME-Version: 1.0 Message-ID: <158598969917.28353.17967432793396671093.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/urgent branch of tip: Commit-ID: b9c9ce4e598e012ca7c1813fae2f4d02395807de Gitweb: https://git.kernel.org/tip/b9c9ce4e598e012ca7c1813fae2f4d02395807de Author: Sam Lunt AuthorDate: Fri, 31 Jan 2020 12:11:23 -06:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Fri, 03 Apr 2020 10:03:44 -03:00 perf tools: Support Python 3.8+ in Makefile Python 3.8 changed the output of 'python-config --ldflags' to no longer include the '-lpythonX.Y' flag (this apparently fixed an issue loading modules with a statically linked Python executable). The libpython feature check in linux/build/feature fails if the Python library is not included in FEATURE_CHECK_LDFLAGS-libpython variable. This adds a check in the Makefile to determine if PYTHON_CONFIG accepts the '--embed' flag and passes that flag alongside '--ldflags' if so. tools/perf is the only place the libpython feature check is used. Signed-off-by: Sam Lunt Tested-by: He Zhe Link: http://lore.kernel.org/lkml/c56be2e1-8111-9dfe-8298-f7d0f9ab7431@windriver.com Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: trivial@kernel.org Cc: stable@kernel.org Link: http://lore.kernel.org/lkml/20200131181123.tmamivhq4b7uqasr@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile.config | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index eb95c0c..12a8204 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -228,8 +228,17 @@ strip-libs = $(filter-out -l%,$(1)) PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG)) +# Python 3.8 changed the output of `python-config --ldflags` to not include the +# '-lpythonX.Y' flag unless '--embed' is also passed. The feature check for +# libpython fails if that flag is not included in LDFLAGS +ifeq ($(shell $(PYTHON_CONFIG_SQ) --ldflags --embed 2>&1 1>/dev/null; echo $$?), 0) + PYTHON_CONFIG_LDFLAGS := --ldflags --embed +else + PYTHON_CONFIG_LDFLAGS := --ldflags +endif + ifdef PYTHON_CONFIG - PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) + PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) $(PYTHON_CONFIG_LDFLAGS) 2>/dev/null) PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)