summaryrefslogtreecommitdiff
path: root/tools/perf/util/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/setup.py')
-rw-r--r--tools/perf/util/setup.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index dd289d15acfd..9cae2c472f4a 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -1,6 +1,7 @@
from os import getenv, path
from subprocess import Popen, PIPE
from re import sub
+import shlex
cc = getenv("CC")
assert cc, "Environment variable CC not set"
@@ -22,7 +23,9 @@ assert srctree, "Environment variable srctree, for the Linux sources, not set"
src_feature_tests = f'{srctree}/tools/build/feature'
def clang_has_option(option):
- cc_output = Popen([cc, cc_options + option, path.join(src_feature_tests, "test-hello.c") ], stderr=PIPE).stderr.readlines()
+ cmd = shlex.split(f"{cc} {cc_options} {option}")
+ cmd.append(path.join(src_feature_tests, "test-hello.c"))
+ cc_output = Popen(cmd, stderr=PIPE).stderr.readlines()
return [o for o in cc_output if ((b"unknown argument" in o) or (b"is not supported" in o) or (b"unknown warning option" in o))] == [ ]
if cc_is_clang: