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

From: Sedat Dilek
Date: Wed Aug 21 2024 - 15:24:24 EST


Hi,

yesterday I jumped to Linux v6.11-rc4+.

Today, I played with perf.

I use the SLIM LLVM toolchains from kernel.org.

Link: https://mirrors.edge.kernel.org/pub/tools/llvm/files/

LLVM-18 is OK.

LLVM-19 produces ERRORS.

[ REPRODUCER ]

##LLVM_MVER="18"
LLVM_MVER="19"

# Debian LLVM
##LLVM_TOOLCHAIN_PATH="/usr/lib/llvm-${LLVM_MVER}/bin"
# Selfmade LLVM
LLVM_TOOLCHAIN_PATH="/opt/llvm/bin"
if [ -d ${LLVM_TOOLCHAIN_PATH} ]; then
export PATH="${LLVM_TOOLCHAIN_PATH}:${PATH}"
fi

PYTHON_VER="3.12"
MAKE="make"
MAKE_OPTS="V=1 -j1 HOSTCC=clang-$LLVM_MVER HOSTLD=ld.lld
HOSTAR=llvm-ar CC=clang-$LLVM_MVER LD=ld.lld AR=llvm-ar
STRIP=llvm-strip"
##MAKE_OPTS="$MAKE_OPTS NO_LIBTRACEEVENT=1"
##MAKE_OPTS="$MAKE_OPTS NO_LIBDEBUGINFOD=1"

echo "LLVM MVER ........ $LLVM_MVER"
echo "Path settings .... $PATH"
echo "Python version ... $PYTHON_VER"
echo "make line ........ $MAKE $MAKE_OPTS"

LANG=C LC_ALL=C make -C tools/perf clean 2>&1 | tee ../make-log_perf-clean.txt

LANG=C LC_ALL=C $MAKE $MAKE_OPTS -C tools/perf
PYTHON=python${PYTHON_VER} install-bin 2>&1 | tee
../make-log_perf-install_bin_python${PYTHON_VER}_llvm${LLVM_MVER}.txt

[ ERRORS ]

'/usr/bin/python3.12' util/setup.py \
--quiet build_ext; \
cp python_ext_build/lib/perf*.so python/
/home/dileks/src/linux/git/tools/perf/util/python.c:816:15: error:
cast from 'PyObject *(*)(struct pyrf_evsel *, PyObject *, PyObject *)'
(aka 'struct _object *(*)(str
uct pyrf_evsel *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible funct
ion type [-Werror,-Wcast-function-type-mismatch]
816 | .ml_meth = (PyCFunction)pyrf_evsel__open,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1050:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1050 | .ml_meth = (PyCFunction)pyrf_evlist__mmap,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1056:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1056 | .ml_meth = (PyCFunction)pyrf_evlist__open,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1062:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1062 | .ml_meth = (PyCFunction)pyrf_evlist__poll,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1068:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1068 | .ml_meth = (PyCFunction)pyrf_evlist__get_pollfd,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1074:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1074 | .ml_meth = (PyCFunction)pyrf_evlist__add,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1080:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1080 | .ml_meth = (PyCFunction)pyrf_evlist__read_on_cpu,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1244:15: error:
cast from 'PyObject *(*)(struct pyrf_evsel *, PyObject *, PyObject *)'
(aka 'struct _object *(*)(st
ruct pyrf_evsel *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible func
tion type [-Werror,-Wcast-function-type-mismatch]
1244 | .ml_meth = (PyCFunction) pyrf__tracepoint,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 errors generated.
error: command '/opt/llvm/bin/clang-19' failed with exit code 1
cp: cannot stat 'python_ext_build/lib/perf*.so': No such file or directory
make[2]: *** [Makefile.perf:737:
python/perf.cpython-312-x86_64-linux-gnu.so] Error 1
make[1]: *** [Makefile.perf:290: sub-make] Error 2
make: *** [Makefile:113: install-bin] Error 2
make: Leaving directory '/home/dileks/src/linux/git/tools/perf'

INFO: Full build-log is attached.

Any known issue?

Thanks,

Best regards,
-Sedat-

Attachment: make-log_perf-install_bin_python3.12_llvm19.txt.zst
Description: application/zstd

Attachment: make-log_perf-install_bin_python3.12_llvm19.txt.zst.sha256
Description: Binary data