From: Arnaldo Carvalho de Melo Date: Thu, 22 Aug 2024 17:13:49 +0000 (-0300) Subject: perf python: Allow checking for the existence of warning options in clang X-Git-Tag: v6.12-rc1~109^2~126 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=b81162302001f41157f6e93654aaccc30e817e2a;p=linux-block.git perf python: Allow checking for the existence of warning options in clang We'll need to check if an warning option introduced in clang 19 is available on the clang version being used, so cover the error message emitted when testing for a -W option. Tested-by: Sedat Dilek Cc: Ian Rogers Cc: Ingo Molnar Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Peter Zijlstra Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 142e9d447ce7..26c0f2614fe9 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -17,7 +17,7 @@ src_feature_tests = getenv('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() - return [o for o in cc_output if ((b"unknown argument" in o) or (b"is not supported" in o))] == [ ] + 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: from sysconfig import get_config_vars