All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>
Subject: Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
Date: Thu, 22 Aug 2024 11:26:12 -0300	[thread overview]
Message-ID: <ZsdKhLaPy-uzKsuH@x1> (raw)
In-Reply-To: <CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com>

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-




  parent reply	other threads:[~2024-08-22 14:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 19:23 [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3 Sedat Dilek
2024-08-21 19:37 ` Sedat Dilek
2024-08-21 20:37   ` Namhyung Kim
2024-08-22 15:34     ` Arnaldo Carvalho de Melo
2024-08-22 14:26 ` Arnaldo Carvalho de Melo [this message]
2024-08-22 15:09   ` Arnaldo Carvalho de Melo
2024-08-22 17:02     ` Sedat Dilek
2024-08-22 17:12       ` Arnaldo Carvalho de Melo
2024-08-22 17:19         ` Arnaldo Carvalho de Melo
2024-08-22 17:31           ` Sedat Dilek
2024-08-22 17:40             ` Arnaldo Carvalho de Melo
2024-08-22 17:59               ` Sedat Dilek
2024-08-22 18:17                 ` Namhyung Kim
2024-08-22 18:20                   ` Arnaldo Carvalho de Melo
2024-08-22 18:29                     ` Sedat Dilek
2024-08-22 20:11                     ` Namhyung Kim
2024-08-22 20:26                       ` Arnaldo Carvalho de Melo
2024-08-22 20:30                         ` Namhyung Kim
2024-08-23 13:58                           ` Sedat Dilek
2024-08-23 15:03                             ` Namhyung Kim
2024-08-22 18:17                 ` Arnaldo Carvalho de Melo
2024-08-22 18:19                   ` Sedat Dilek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZsdKhLaPy-uzKsuH@x1 \
    --to=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=nathan@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sedat.dilek@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.