[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-g9lhgr162ao8ao29vvf0hgm1@git.kernel.org>
Date: Tue, 21 Feb 2017 00:10:23 -0800
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, linux-kernel@...r.kernel.org, jolsa@...nel.org,
dsahern@...il.com, adrian.hunter@...el.com, wangnan0@...wei.com,
namhyung@...nel.org, mingo@...nel.org, acme@...hat.com,
tglx@...utronix.de
Subject: [tip:perf/urgent] perf python: Filter out -specs=/a/b/c from the
python binding cc options
Commit-ID: 4be92cf018c391c4ecc5fd091fae8c152de3692f
Gitweb: http://git.kernel.org/tip/4be92cf018c391c4ecc5fd091fae8c152de3692f
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Wed, 15 Feb 2017 21:36:48 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 17 Feb 2017 10:31:13 -0300
perf python: Filter out -specs=/a/b/c from the python binding cc options
The -spec=/path/to/file can be used to change what gcc puts in the cc,
ld, etc command lines, but this is not present in clang, filter it out
at the setup.py file by changing python2's internal variable where it
keeps its initial CFLAGS value.
With this all of perf can be built in at least Fedora 25, fixing this
problem:
GEN /tmp/build/perf/python/perf.so
CC /tmp/build/perf/builtin-buildid-list.o
clang-4.0: error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Werror,-Wunused-command-line-argument]
clang-4.0: error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Werror,-Wunused-command-line-argument]
error: command 'clang' failed with exit status 1
Now I need to change all the containers where I have clang to build
perf with it, so that we can check that in other distros (opensuse, debian,
ubuntu, etc) this also works.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-g9lhgr162ao8ao29vvf0hgm1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/setup.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index c868098..af415fe 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -1,8 +1,15 @@
#!/usr/bin/python2
-from distutils.core import setup, Extension
from os import getenv
+cc = getenv("CC")
+if cc == "clang":
+ from _sysconfigdata import build_time_vars
+ from re import sub
+ build_time_vars["CFLAGS"] = sub("-specs=[^ ]+", "", build_time_vars["CFLAGS"])
+
+from distutils.core import setup, Extension
+
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
Powered by blists - more mailing lists