From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757568AbcCEINW (ORCPT ); Sat, 5 Mar 2016 03:13:22 -0500 Received: from torg.zytor.com ([198.137.202.12]:58476 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751356AbcCEINO (ORCPT ); Sat, 5 Mar 2016 03:13:14 -0500 Date: Sat, 5 Mar 2016 00:12:39 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: jolsa@kernel.org, hpa@zytor.com, acme@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de, jolsa@redhat.com, dsahern@gmail.com, namhyung@kernel.org, a.p.zijlstra@chello.nl, jwboyer@fedoraproject.org, jbastian@redhat.com Reply-To: jbastian@redhat.com, jwboyer@fedoraproject.org, a.p.zijlstra@chello.nl, namhyung@kernel.org, dsahern@gmail.com, jolsa@redhat.com, tglx@linutronix.de, acme@redhat.com, mingo@kernel.org, linux-kernel@vger.kernel.org, jolsa@kernel.org, hpa@zytor.com In-Reply-To: <20160227201350.GB28494@krava.redhat.com> References: <20160227201350.GB28494@krava.redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Fix python extension build Git-Commit-ID: 67d5268908283c187e0a460048a423256c2fb288 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 67d5268908283c187e0a460048a423256c2fb288 Gitweb: http://git.kernel.org/tip/67d5268908283c187e0a460048a423256c2fb288 Author: Jiri Olsa AuthorDate: Sat, 27 Feb 2016 21:21:12 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 29 Feb 2016 11:18:25 -0300 perf tools: Fix python extension build The util/python-ext-sources file contains source files required to build the python extension relative to $(srctree)/tools/perf, Such a file path $(FILE).c is handed over to the python extension build system, which builds the final object in the $(PYTHON_EXTBUILD)/tmp/$(FILE).o path. After the build is done all files from $(PYTHON_EXTBUILD)lib/ are carried as the result binaries. Above system fails when we add source file relative to ../lib, which we do for: ../lib/bitmap.c ../lib/find_bit.c ../lib/hweight.c ../lib/rbtree.c All above objects will be built like: $(PYTHON_EXTBUILD)/tmp/../lib/bitmap.c $(PYTHON_EXTBUILD)/tmp/../lib/find_bit.c $(PYTHON_EXTBUILD)/tmp/../lib/hweight.c $(PYTHON_EXTBUILD)/tmp/../lib/rbtree.c which accidentally happens to be final library path: $(PYTHON_EXTBUILD)/lib/ Changing setup.py to pass full paths of source files to Extension build class and thus keep all built objects under $(PYTHON_EXTBUILD)tmp directory. Reported-by: Jeff Bastian Signed-off-by: Jiri Olsa Tested-by: Josh Boyer Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: stable@vger.kernel.org # v4.2+ Link: http://lkml.kernel.org/r/20160227201350.GB28494@krava.redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 1833103..c868098 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -22,6 +22,7 @@ cflags = getenv('CFLAGS', '').split() # switch off several checks (need to be at the end of cflags list) cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter' ] +src_perf = getenv('srctree') + '/tools/perf' build_lib = getenv('PYTHON_EXTBUILD_LIB') build_tmp = getenv('PYTHON_EXTBUILD_TMP') libtraceevent = getenv('LIBTRACEEVENT') @@ -30,6 +31,9 @@ libapikfs = getenv('LIBAPI') ext_sources = [f.strip() for f in file('util/python-ext-sources') if len(f.strip()) > 0 and f[0] != '#'] +# use full paths with source files +ext_sources = map(lambda x: '%s/%s' % (src_perf, x) , ext_sources) + perf = Extension('perf', sources = ext_sources, include_dirs = ['util/include'],