2022-12-28 00:44:42

by Ahelenia Ziemiańska

[permalink] [raw]
Subject: [PATCH 2/2] perf python: don't run the linker for clang feature tests

This, for me, slightly-more-than-halves the time it takes to run
for a in "-mcet" "-fcf-protection" "-fstack-clash-protection" \
"-fstack-protector-strong" "-fno-semantic-interposition" \
"-ffat-lto-objects"; do
cc "$a" ../build/feature/test-hello.c -o /dev/null; done
from just over 600ms.

Signed-off-by: Ahelenia Ziemiańska <[email protected]>
---
tools/perf/util/setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 58239e1cdb2a..400c99cd7734 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -16,7 +16,7 @@ cc_is_clang = b"clang version" in Popen([cc, "-v"], stderr=PIPE).stderr.readline
src_feature_tests = getenv('srctree') + '/tools/build/feature'

def clang_has_option(option):
- cc_output = Popen([cc, cc_options + option + "-o /dev/null", path.join(src_feature_tests, "test-hello.c") ], stderr=PIPE).stderr.readlines()
+ cc_output = Popen([cc, cc_options + option + "-c -o /dev/null", 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:
--
2.30.2


Attachments:
(No filename) (1.27 kB)
signature.asc (849.00 B)
Download all attachments