linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: "Thomas Ilsche" <thomas.ilsche@tu-dresden.de>,
	"David Carrillo-Cisneros" <davidcc@google.com>,
	linux-kernel@vger.kernel.org, "Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Wang Nan" <wangnan0@huawei.com>, "He Kuang" <hekuang@huawei.com>,
	"Michal Marek" <mmarek@suse.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Stephane Eranian" <eranian@google.com>,
	"Paul Turner" <pjt@google.com>
Subject: Re: [PATCH 1/4] perf tools: pass PYTHON config to feature detection
Date: Tue, 7 Feb 2017 00:19:42 +0900	[thread overview]
Message-ID: <20170206151942.GD2156@danjae.aot.lge.com> (raw)
In-Reply-To: <20170206131930.GA11283@kernel.org>

On Mon, Feb 06, 2017 at 10:19:30AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Feb 01, 2017 at 10:38:01PM -0800, David Carrillo-Cisneros escreveu:
> > Python's CC and link Makefile variables were not passed to feature
> > detection, causing feature detection to use system's Python rather than
> > PYTHON_CONFIG's one. This created a mismatch between the detected Python
> > support and the one actually used by perf when PYTHON_CONFIG is specified.
> > 
> > Fix it by moving Python's variable initialization to before feature
> > detection and pass FLAGS_PYTHON_EMBED to Python's feature detection's
> > build target.
> 
> Hi Namhyung, Thomas, since this was last touched in the cset below, can you
> please check this if possible and provide Acked-by tags?
> 
> Thanks,
> 
> commit 56c7d79e49776084b852e451bda5f59dc3bcf894
> Author: Namhyung Kim <namhyung@kernel.org>
> Date:   Tue Jul 29 15:57:19 2014 +0900
> 
>     perf tools: Fix make PYTHON override
>     
>     Thomas reported that make PYTHON=python2 is not work on some systems.  I
>     can reproduce it on my ArchLinux box too.
>     
>     This is because it's overridden by config/feature-checks/Makefile
>     regardless of PYTHON setting.  I guess it's a bug slipped into during
>     the feature checking change.
>     
>     Actually, we don't need to check python-config in the feature-checks.
>     We can just pass appropriate FEATURE_CHECK_*FLAGS.
>     
>     Reported-by: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
>     Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>     Tested-by: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
> 
>  
> > Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
> > ---
> >  tools/build/feature/Makefile |  2 +-
> >  tools/perf/Makefile.config   | 23 ++++++++++-------------
> >  2 files changed, 11 insertions(+), 14 deletions(-)
> > 
> > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> > index b564a2eea039..3dd2c600d250 100644
> > --- a/tools/build/feature/Makefile
> > +++ b/tools/build/feature/Makefile
> > @@ -171,7 +171,7 @@ $(OUTPUT)test-libperl.bin:
> >  	$(BUILD) $(FLAGS_PERL_EMBED)
> >  
> >  $(OUTPUT)test-libpython.bin:
> > -	$(BUILD)
> > +	$(BUILD) $(FLAGS_PYTHON_EMBED)
> >  
> >  $(OUTPUT)test-libpython-version.bin:
> >  	$(BUILD)
> > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> > index 03cf947755b9..41f5c41c5660 100644
> > --- a/tools/perf/Makefile.config
> > +++ b/tools/perf/Makefile.config
> > @@ -166,10 +166,18 @@ PYTHON2_CONFIG := \
> >  override PYTHON_CONFIG := \
> >    $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))
> >  
> > +grep-libs  = $(filter -l%,$(1))
> > +strip-libs  = $(filter-out -l%,$(1))
> > +
> >  PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
> >  
> > -PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
> > -PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
> > +ifdef PYTHON_CONFIG
> > +  PYTHON_EMBED_LDOPTS := $(shell $(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) --cflags 2>/dev/null)
> > +  FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
> > +endif
> >  
> >  FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
> >  FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)

Hmm.. I guess these feature check flags should be passed to the above
Makefile but it seems not.

Thanks,
Namhyung


> > @@ -542,8 +550,6 @@ ifndef NO_GTK2
> >    endif
> >  endif
> >  
> > -grep-libs  = $(filter -l%,$(1))
> > -strip-libs = $(filter-out -l%,$(1))
> >  
> >  ifdef NO_LIBPERL
> >    CFLAGS += -DNO_LIBPERL
> > @@ -591,18 +597,9 @@ else
> >        $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev)
> >      else
> >  
> > -      PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
> > -
> > -      PYTHON_EMBED_LDOPTS := $(shell $(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) --cflags 2>/dev/null)
> > -      FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
> > -
> >        ifneq ($(feature-libpython), 1)
> >          $(call disable-python,No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev)
> >        else
> > -
> >          ifneq ($(feature-libpython-version), 1)
> >            $(warning Python 3 is not yet supported; please set)
> >            $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
> > -- 
> > 2.11.0.483.g087da7b7c-goog

  reply	other threads:[~2017-02-06 15:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02  6:38 [PATCH 0/4] Fixes for perf build and feature detection David Carrillo-Cisneros
2017-02-02  6:38 ` [PATCH 1/4] perf tools: pass PYTHON config to " David Carrillo-Cisneros
2017-02-06 13:19   ` Arnaldo Carvalho de Melo
2017-02-06 15:19     ` Namhyung Kim [this message]
2017-02-07 19:47   ` Arnaldo Carvalho de Melo
2017-02-08  3:15     ` David Carrillo-Cisneros
2017-02-08  5:28       ` [PATCH v2] tools lib traceevent: Robustify do_generate_dynamic_list_file David Carrillo-Cisneros
2017-02-08 12:44         ` Arnaldo Carvalho de Melo
2017-02-08 13:24           ` Arnaldo Carvalho de Melo
2017-02-09  5:03             ` David Carrillo-Cisneros
2017-02-10  7:47         ` [tip:perf/core] " tip-bot for David Carrillo-Cisneros
2017-02-02  6:38 ` [PATCH 2/4] " David Carrillo-Cisneros
2017-02-06 17:45   ` Arnaldo Carvalho de Melo
2017-02-02  6:38 ` [PATCH 3/4] tools lib feature: Do not redefine compiler configuration David Carrillo-Cisneros
2017-02-06 13:38   ` Arnaldo Carvalho de Melo
2017-02-06 15:42     ` Jiri Olsa
2017-02-02  6:38 ` [PATCH 4/4] tools include: Fix include path for uapi/asm-generic/mman.h David Carrillo-Cisneros
2017-02-02 12:56   ` Jiri Olsa
2017-02-06 18:25   ` Arnaldo Carvalho de Melo
2017-02-06 20:09     ` David Carrillo-Cisneros
2017-02-02 12:56 ` [PATCH 0/4] Fixes for perf build and feature detection Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170206151942.GD2156@danjae.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=davidcc@google.com \
    --cc=eranian@google.com \
    --cc=hekuang@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mmarek@suse.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=thomas.ilsche@tu-dresden.de \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).