diff options
| -rw-r--r-- | tools/perf/util/setup.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 261a55e7e1b2..63f758c655d5 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py | |||
| @@ -9,12 +9,14 @@ def clang_has_option(option): | |||
| 9 | 9 | ||
| 10 | cc = getenv("CC") | 10 | cc = getenv("CC") |
| 11 | if cc == "clang": | 11 | if cc == "clang": |
| 12 | from _sysconfigdata import build_time_vars | 12 | from distutils.sysconfig import get_config_vars |
| 13 | build_time_vars["CFLAGS"] = sub("-specs=[^ ]+", "", build_time_vars["CFLAGS"]) | 13 | vars = get_config_vars() |
| 14 | if not clang_has_option("-mcet"): | 14 | for var in ('CFLAGS', 'OPT'): |
| 15 | build_time_vars["CFLAGS"] = sub("-mcet", "", build_time_vars["CFLAGS"]) | 15 | vars[var] = sub("-specs=[^ ]+", "", vars[var]) |
| 16 | if not clang_has_option("-fcf-protection"): | 16 | if not clang_has_option("-mcet"): |
| 17 | build_time_vars["CFLAGS"] = sub("-fcf-protection", "", build_time_vars["CFLAGS"]) | 17 | vars[var] = sub("-mcet", "", vars[var]) |
| 18 | if not clang_has_option("-fcf-protection"): | ||
| 19 | vars[var] = sub("-fcf-protection", "", vars[var]) | ||
| 18 | 20 | ||
| 19 | from distutils.core import setup, Extension | 21 | from distutils.core import setup, Extension |
| 20 | 22 | ||
