From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Clark Williams <williams@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Adrian Hunter <adrian.hunter@intel.com>
Subject: [PATCH 7/8] perf python: Remove -fstack-protector-strong if clang doesn't have it
Date: Mon, 8 Jul 2019 12:42:06 -0300 [thread overview]
Message-ID: <20190708154207.11403-8-acme@kernel.org> (raw)
In-Reply-To: <20190708154207.11403-1-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Some distros put -fstack-protector-strong in the compiler flags to be
used to build python extensions, but then, the clang version in that
distro doesn't know about that, only gcc does.
Check if that is the case and remove it from the set of options used to
build the python binding with clang.
Case at hand:
oraclelinux:7
$ head -2 /etc/os-release
NAME="Oracle Linux Server"
VERSION="7.6"
$ grep stack-protector /usr/lib64/python2.7/_sysconfigdata.py | head -1 | cut -c-120
'CFLAGS': '-fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --para
$
gcc version 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) (GCC)
clang version 3.4.2 (tags/RELEASE_34/dot2-final)
clang: error: unknown argument: '-fstack-protector-strong'
clang: error: unknown argument: '-fstack-protector-strong'
error: command 'clang' failed with exit status 1
cp: cannot stat '/tmp/build/perf/python_ext_build/lib/perf*.so': No such file or directory
make[2]: *** [/tmp/build/perf/python/perf.so] Error 1
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-brmp2415zxpbhz45etkgjoma@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/setup.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 5b5a167b43ce..a1a68a2fa917 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -17,6 +17,8 @@ if cc == "clang":
vars[var] = sub("-fcf-protection", "", vars[var])
if not clang_has_option("-fstack-clash-protection"):
vars[var] = sub("-fstack-clash-protection", "", vars[var])
+ if not clang_has_option("-fstack-protector-strong"):
+ vars[var] = sub("-fstack-protector-strong", "", vars[var])
from distutils.core import setup, Extension
--
2.20.1
next prev parent reply other threads:[~2019-07-08 15:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 15:41 [GIT PULL 0/8] perf/urgent fixes Arnaldo Carvalho de Melo
2019-07-08 15:42 ` [PATCH 1/8] tools arch kvm: Sync kvm headers with the kernel sources Arnaldo Carvalho de Melo
2019-07-08 15:42 ` [PATCH 2/8] perf header: Assign proper ff->ph in perf_event__synthesize_features() Arnaldo Carvalho de Melo
2019-07-08 15:42 ` [PATCH 3/8] perf thread: Allow references to thread objects after machine__exit() Arnaldo Carvalho de Melo
2019-07-08 15:42 ` [PATCH 4/8] perf evsel: Do not rely on errno values for precise_ip fallback Arnaldo Carvalho de Melo
2019-07-13 12:42 ` Konstantin Kharlamov
2019-07-08 15:42 ` [PATCH 5/8] perf tests: Fix record+probe_libc_inet_pton.sh for powerpc64 Arnaldo Carvalho de Melo
2019-07-08 15:42 ` [PATCH 6/8] perf annotate TUI browser: Do not use member from variable within its own initialization Arnaldo Carvalho de Melo
2019-07-08 15:42 ` Arnaldo Carvalho de Melo [this message]
2019-07-08 15:42 ` [PATCH 8/8] perf jvmti: Address gcc string overflow warning for strncpy() Arnaldo Carvalho de Melo
2019-07-08 21:50 ` [GIT PULL 0/8] perf/urgent fixes Arnaldo Carvalho de Melo
2019-07-08 21:54 ` Arnaldo Carvalho de Melo
2019-07-09 11:23 ` Ingo Molnar
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=20190708154207.11403-8-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.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).