From: Arnaldo Carvalho de Melo Date: Thu, 22 Aug 2024 17:13:49 +0000 (-0300) Subject: perf python: Disable -Wno-cast-function-type-mismatch if present on clang X-Git-Tag: v6.10.14~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2bb1edc44683a8af56fe99a834f3af879d42c1b;p=thirdparty%2Fkernel%2Fstable.git perf python: Disable -Wno-cast-function-type-mismatch if present on clang commit 00dc514612fe98cfa117193b9df28f15e7c9db9c upstream. The -Wcast-function-type-mismatch option was introduced in clang 19 and its enabled by default, since we use -Werror, and python bindings do casts that are valid but trips this warning, disable it if present. Closes: https://lore.kernel.org/all/CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com Reported-by: Sedat Dilek Tested-by: Sedat Dilek Cc: Ian Rogers Cc: Ingo Molnar Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Peter Zijlstra Cc: stable@vger.kernel.org # To allow building with the upcoming clang 19 Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 3107f5aa8c9a0..0b8fe6828f352 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -63,6 +63,8 @@ cflags = getenv('CFLAGS', '').split() cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls', '-DPYTHON_PERF' ] if cc_is_clang: cflags += ["-Wno-unused-command-line-argument" ] + if clang_has_option("-Wno-cast-function-type-mismatch"): + cflags += ["-Wno-cast-function-type-mismatch" ] else: cflags += ['-Wno-cast-function-type' ]