Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp279769ybl; Tue, 28 Jan 2020 23:56:17 -0800 (PST) X-Google-Smtp-Source: APXvYqw2YaDOEC7mIBH6NMgg0fdzjiY/DDU1Y1Hd4w3TqaXtO8Et1XG5x6InRjyptLMkLyg6aPHP X-Received: by 2002:aca:f1c2:: with SMTP id p185mr5705645oih.87.1580284577485; Tue, 28 Jan 2020 23:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580284577; cv=none; d=google.com; s=arc-20160816; b=lnoLFs2eUvhzboYhrPgOnB0pD33glK0s/sLbBL3kofMo7BiuaaIFMU7nEb969xfovf Wd6wZAZ3sYqLv4KnibvSaS3aAzA7F/+CYbVJTeJtjGx5NdkuSvyaR+GQxLr22LmIFurs cbo3BAu1hKDVdtsNqynV+bEBeSwFPGtBIbfsPeUf8SQxC+jtbny2sngDwbpbNe57FWE+ hb00dJzmxPdatlW46y84AUGBCMBg9aRHb8Pypiu8eJM31dTr/zXyqOiucxeEQi2GmKg/ dsMfyv2PkE5y616532nHTrhILdKeej8Pk3GL19trqy/tECWz3tS/iCCZza9hUNsH5Mc3 8lPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=3Q8owHXy33XcrZBh1M4F84KS5rHbxiQ9XitaKX7L6ko=; b=ZXG+Qh2/6LgMh9XQm4iIRHmCy8CIEIucZJ9vxi95pZ3rVFDWB0OHm8wASSVqbBRFQu PJNBfLnr2LuyIkmt6ROK9bv07hm5k3pPhXL86X/dEurLDweS8qWYF9oI00aWWa9GqG5G nR66bjGXuh5oNr5SxmvDLoU4w4E84exJriyB74aUiFxt/N1V0g6oaU96sfkfTIkaIXlF wzFpO3i0h90BRfRANq0dji9VfYkumLWkl8ru3a7qFzuVcehqAqRIMlOwCUvw6vkgo66T PlgJYpr5hWgQMiF7nGyjqhIDTRdPQhKMchqNvhavE8ZCOVLxP6iMmOcPRdZ+Z9DoPsUI t2lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X46e9thz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si732273oih.154.2020.01.28.23.56.04; Tue, 28 Jan 2020 23:56:17 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X46e9thz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726168AbgA2HzN (ORCPT + 99 others); Wed, 29 Jan 2020 02:55:13 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:55844 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726068AbgA2HzM (ORCPT ); Wed, 29 Jan 2020 02:55:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580284511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3Q8owHXy33XcrZBh1M4F84KS5rHbxiQ9XitaKX7L6ko=; b=X46e9thz8tD6FCvh2ETie8kDxVYrb7IOKQ3OxTdzyVPU3/+j8tHXd31zWU7uaAJ6ntVJWS c202SCMFrObIJF8hzIDQoVU31HWT9mabjiXvqem3v292VfEa+I47e73B2Pzp//BYwxNC5A htLOIKl/j00PjsOJfEVdj3lOY+WYqA8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-jCmaGiM6PmmQ6HVA82EhkA-1; Wed, 29 Jan 2020 02:55:05 -0500 X-MC-Unique: jCmaGiM6PmmQ6HVA82EhkA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0E741882CC9; Wed, 29 Jan 2020 07:55:03 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF6F4395; Wed, 29 Jan 2020 07:55:01 +0000 (UTC) Date: Wed, 29 Jan 2020 08:54:59 +0100 From: Jiri Olsa To: Sam Lunt Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, trivial@kernel.org Subject: Re: [PATCH] perf: Support Python 3.8+ in Makefile Message-ID: <20200129075459.GA1256499@krava> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 25, 2020 at 08:56:12AM -0600, Sam Lunt wrote: > 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. seems ok to me, but your patch came malformed, check below jirka > > Signed-off-by: Sam Lunt > --- > 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 c90f4146e5a2..ccf99351f058 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) patching file tools/perf/Makefile.config patch: **** malformed patch at line 108: 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) patching file tools/perf/Makefile.config patch: **** malformed patch at line 116: $(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) > > base-commit: d5d359b0ac3ffc319ca93c46a4cfd87093759ad6 > -- > 2.25.0 >