Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3

From: Arnaldo Carvalho de Melo
Date: Thu Aug 22 2024 - 13:12:53 EST


On Thu, Aug 22, 2024 at 07:02:52PM +0200, Sedat Dilek wrote:
> On Thu, Aug 22, 2024 at 5:10 PM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> > +++ 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
> > @@ -63,6 +63,8 @@ cflags = getenv('CFLAGS', '').split()
> > cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls' ]
> > 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' ]

> I tried with your diff with SLIM LLVM toolchains 18 and 19.

> Both work - see attached build-logs.

> Yes, are right that LLVM/Clang v19 was first introducing:

> -Wcast-function-type-mismatch / -Wno-cast-function-type-mismatch

> [4] says for LLVM 18.1.8:

> -Wcast-function-type
> -Wcast-function-type-strict

> Feel free to add my Reported-by/Tested-by credentials if you sent a full patch.

Thanks for the report and test of the fix, I'll add both tags,

Best regards,

- Arnaldo

> Thanks.
>
> BR,
> -Sedat-
>
> [1] https://mirrors.edge.kernel.org/pub/tools/llvm/
> [2] https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-18.1.8-x86_64.tar.xz
> [3] https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-19.1.0-rc3-x86_64.tar.xz
> [4] https://releases.llvm.org/18.1.8/tools/clang/docs/DiagnosticsReference.html
> [5] https://clang.llvm.org/docs/DiagnosticsReference.html