]> Git Repo - linux.git/commitdiff
perf python: Account for multiple words in CC
authorKhem Raj <[email protected]>
Mon, 5 Dec 2022 02:55:34 +0000 (18:55 -0800)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 14 Dec 2022 14:24:31 +0000 (11:24 -0300)
Sometimes build systems may append options e.g. --sysroot etc. to CC
variable especially in cross-compile environments like yocto project
where CC varable is composed of cross-compiler name and some needed
options for it to work in a relocatable environment.

Therefore separate out the compiler name from rest of the options in CC,
then add the options via second argument to Popen() API

Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Fangrui Song <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: John Keeping <[email protected]>
Cc: Leo Yan <[email protected]>
Cc: Michael Petlan <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Sedat Dilek <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/setup.py

index e80ffbbfacfb8cc0aa00a36e157c8f05c179cd76..4f265d0222c454e21b23ce9dfa7822c91e1ab904 100644 (file)
@@ -7,7 +7,7 @@ cc_is_clang = b"clang version" in Popen([cc.split()[0], "-v"], stderr=PIPE).stde
 src_feature_tests  = getenv('srctree') + '/tools/build/feature'
 
 def clang_has_option(option):
-    cc_output = Popen([cc, option, path.join(src_feature_tests, "test-hello.c") ], stderr=PIPE).stderr.readlines()
+    cc_output = Popen([cc.split()[0], str(cc.split()[1:]) + option, path.join(src_feature_tests, "test-hello.c") ], stderr=PIPE).stderr.readlines()
     return [o for o in cc_output if ((b"unknown argument" in o) or (b"is not supported" in o))] == [ ]
 
 if cc_is_clang:
This page took 0.056274 seconds and 4 git commands to generate.