Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4341267ybv; Sun, 16 Feb 2020 20:01:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyfwidbGKI4BpDVFcmpgMyvqDPFIThIK7RcoT+l2tMtI3UaeNmWiNxW/GWcdpJyxKvynTyx X-Received: by 2002:aca:f584:: with SMTP id t126mr9158156oih.132.1581912063073; Sun, 16 Feb 2020 20:01:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581912063; cv=none; d=google.com; s=arc-20160816; b=l55ppQwWMJEfTpSr+xpBjwXlK1ppqwji4ddvFGP//1uw1FjVd5lW/ldiVBf8GXV5T5 fET5EDPFkcZKjOgvCOqNMRpqPuyK4QMTgTMYT+NJQ+7w6t12jf+nLWO/TJGQzcV0ZvKw CTEwqbMCEw9lYeD9/RpWGguPkqSbJxFyLY4rCV/qneTo+wLSTa8QXXFl5PDBEOXzdcTL tUzZ6uedoRIf4gfIA4U/Crwn093tddzjKVC4i43T5aFAlGQIpR90s9AsGG9TUUVoLqiO LnJOyZWPyDMEUsI84UJ/1paCO2V6+mpOTStAeor+ApqX0StBSd/ZV/WBTIyGuCAGUJLN MBiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=t/p/KNgTMRGenR9b8I9R9oMZz72NHPPjGGX6VEj7lj4=; b=X6EBEbtRTTp8JIY+D2LFB9/M+RBAi9P0sFyMi5uj2iI7B5yzBYuuzHSSX0NAnjLnLQ 6RtruxMLPpKqT05PDvQ1FYibWeGME2ZLS1bXeBpkdlZrIj9NDD/LDHPh4xx/98IbGmj2 ET2ojHX6iMAtktqYgkchioFjrGehBd3321FWQMBCVqZm0Ytzmaa8TRFUKCWpnm+woCfH eiAJmAc07q9wgfkg15oqOqtbe1Wke08NKQfUgAN24arpEGUWtGgQBVJ2JvciLOS+01R2 Fyxdh/J7ImoyX83iW3cKMW521oN8xq6hcpMqWrHkKfbt5tb/z+j+9H9zqp7jRNw1Vw19 POow== 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 j10si6434930otn.122.2020.02.16.20.00.50; Sun, 16 Feb 2020 20:01:03 -0800 (PST) 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 S1727967AbgBQEAO (ORCPT + 99 others); Sun, 16 Feb 2020 23:00:14 -0500 Received: from mail1.windriver.com ([147.11.146.13]:61478 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbgBQEAO (ORCPT ); Sun, 16 Feb 2020 23:00:14 -0500 X-Greylist: delayed 5719 seconds by postgrey-1.27 at vger.kernel.org; Sun, 16 Feb 2020 23:00:09 EST Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.2) with ESMTPS id 01H2OWAR013176 (version=TLSv1 cipher=AES256-SHA bits=256 verify=FAIL); Sun, 16 Feb 2020 18:24:32 -0800 (PST) Received: from [128.224.162.175] (128.224.162.175) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.468.0; Sun, 16 Feb 2020 18:24:31 -0800 Subject: Re: [PATCH 1/2] perf: Be compatible with all python versions when fetching ldflags To: Jiri Olsa CC: , , , , , , , Sam Lunt References: <1581618066-187262-1-git-send-email-zhe.he@windriver.com> <20200216222148.GA161771@krava> From: He Zhe Message-ID: <8cc46abf-208d-4aa4-8d0d-4922106bee6e@windriver.com> Date: Mon, 17 Feb 2020 10:24:27 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200216222148.GA161771@krava> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [128.224.162.175] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/17/20 6:22 AM, Jiri Olsa wrote: > On Fri, Feb 14, 2020 at 02:21:05AM +0800, zhe.he@windriver.com wrote: >> From: He Zhe >> >> Since Python v3.8.0, with the following commit >> 0a8e57248b91 ("bpo-36721: Add --embed option to python-config (GH-13500)"), > we got similar change recently.. might have not been picked up yet > > https://lore.kernel.org/lkml/20200131181123.tmamivhq4b7uqasr@gmail.com/ Thanks for pointing out. Zhe > > jirka > >> --embed option must be passed to "python3-config --ldflags --embed" or >> "python3-config --libs --embed" to get "-lpython3.8". >> >> To make it compatible with all Python versons, according to the suggestion >> in the commit log, we try with --embed first and then witout it if fails. >> >> Signed-off-by: He Zhe >> --- >> tools/perf/Makefile.config | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config >> index 80e55e7..b2eabcf 100644 >> --- a/tools/perf/Makefile.config >> +++ b/tools/perf/Makefile.config >> @@ -229,7 +229,7 @@ strip-libs = $(filter-out -l%,$(1)) >> PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG)) >> >> ifdef PYTHON_CONFIG >> - PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) >> + PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags --embed 2>/dev/null || $(PYTHON_CONFIG_SQ) --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) >> -- >> 2.7.4 >>