[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsdKhLaPy-uzKsuH@x1>
Date: Thu, 22 Aug 2024 11:26:12 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Sedat Dilek <sedat.dilek@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Namhyung Kim <namhyung@...nel.org>, Ian Rogers <irogers@...gle.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>
Subject: Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
On Wed, Aug 21, 2024 at 09:23:36PM +0200, Sedat Dilek wrote:
> 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,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.12/object.h:/* PyObject_HEAD defines the initial segment of every PyObject. */
/usr/include/python3.12/object.h:#define PyObject_HEAD PyObject ob_base;
And:
struct pyrf_evsel {
PyObject_HEAD
struct evsel evsel;
};
So the cast is ok, I think we should disable that
-Wcast-function-type-mismatch for util/python.o when building with
clang.
Lemme try to cook a patch for you to test...
- Arnaldo
> /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-
Powered by blists - more mailing lists