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

From: Arnaldo Carvalho de Melo
Date: Thu Aug 22 2024 - 11:35:23 EST


On Wed, Aug 21, 2024 at 01:37:25PM -0700, Namhyung Kim wrote:
> Hello,
>
> On Wed, Aug 21, 2024 at 12:37 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
> >
> > As a workaround:
> >
> > dileks@iniza:~/src/linux/git$ git diff
> > diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
> > index 142e9d447ce7..db45e6fe7a21 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' ]
> > if cc_is_clang:
> > cflags += ["-Wno-unused-command-line-argument" ]
> > + cflags += ["-Wno-cast-function-type-mismatch" ]
> > +
> > else:
> > cflags += ['-Wno-cast-function-type' ]
> >
>
> Thanks for the fix. I wasn't aware of the issue and the fix
> looks good to me. I'll add it to perf-tools if nobody objects.

It doesn't work, please see the alternative patch I sent, if you try
that in a clang that doesn't have that warning option, it will fail,
i.e. clang 18 fails with the above patch.

- Arnaldo

> Thanks,
> Namhyung
>
>
> > dileks@iniza:~/src/linux/git$ ~/bin/perf -vv
> > perf version 6.11.0-rc4
> > dwarf: [ on ] # HAVE_DWARF_SUPPORT
> > dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT
> > syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT
> > libbfd: [ OFF ] # HAVE_LIBBFD_SUPPORT
> > debuginfod: [ on ] # HAVE_DEBUGINFOD_SUPPORT
> > libelf: [ on ] # HAVE_LIBELF_SUPPORT
> > libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT
> > numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT
> > libperl: [ on ] # HAVE_LIBPERL_SUPPORT
> > libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT
> > libslang: [ on ] # HAVE_SLANG_SUPPORT
> > libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT
> > libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT
> > libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT
> > libcapstone: [ on ] # HAVE_LIBCAPSTONE_SUPPORT
> > zlib: [ on ] # HAVE_ZLIB_SUPPORT
> > lzma: [ on ] # HAVE_LZMA_SUPPORT
> > get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT
> > bpf: [ on ] # HAVE_LIBBPF_SUPPORT
> > aio: [ on ] # HAVE_AIO_SUPPORT
> > zstd: [ on ] # HAVE_ZSTD_SUPPORT
> > libpfm4: [ on ] # HAVE_LIBPFM
> > libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
> > bpf_skeletons: [ on ] # HAVE_BPF_SKEL
> > dwarf-unwind-support: [ on ] # HAVE_DWARF_UNWIND_SUPPORT
> > libopencsd: [ OFF ] # HAVE_CSTRACE_SUPPORT
> >
> > -Sedat-