Skip to contentSkip to conversation

perf python: Remove -fstack-clash-protection when building with some clang versions

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jan 22, 2019 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  a5dcc4ca9129f12a07722f41b6c5e8d7f71f4063
Gitweb:     https://git.kernel.org/tip/a5dcc4ca9129f12a07722f41b6c5e8d7f71f4063
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 18 Jan 2019 11:34:15 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 21 Jan 2019 17:38:56 -0300

perf python: Remove -fstack-clash-protection when building with some clang versions

These options are not present in some (all?) clang versions, so when we build for a distro that has a gcc new enough to have these options and that the distro python build config settings use them but clang doesn't support, b00m.

This is the case with fedora rawhide (now gearing towards f30), so check if clang has the and remove the missing ones from CFLAGS.

---
 tools/perf/util/setup.py | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/setup.py +2 -0
index 63f758c655d5..64d1f36dee99 100644
@@ -17,6 +17,8 @@ if cc == "clang":
             vars[var] = sub("-mcet", "", vars[var])
         if not clang_has_option("-fcf-protection"):
             vars[var] = sub("-fcf-protection", "", vars[var])
+        if not clang_has_option("-fstack-clash-protection"):
+            vars[var] = sub("-fstack-clash-protection", "", vars[var])
 
 from distutils.core import setup, Extension