From: Alessandro Di Federico via qemu development <qemu-devel@nongnu.org>
To: Anton Johansson via qemu development <qemu-devel@nongnu.org>,
brian.cain@oss.qualcomm.com
Cc: Anton Johansson <anjo@rev.ng>,
pierrick.bouvier@oss.qualcomm.com, philmd@mailo.com
Subject: Re: [PATCH v2 40/50] test: helper-to-tcg docker tests
Date: Fri, 31 Jul 2026 13:48:15 +0200 [thread overview]
Message-ID: <20260731134815.051bc8e7@spawn> (raw)
In-Reply-To: <20260730031025.12926-41-anjo@rev.ng>
On Thu, 30 Jul 2026 05:10:14 +0200
Anton Johansson via qemu development <qemu-devel@nongnu.org> wrote:
> Adds a docker container with LLVM versions 15-21 and a docker test for
> building helper-to-tcg and running end-to-end tests along with running
> check-tcg, for testing targets such as Hexagon.
>
> Signed-off-by: Anton Johansson <anjo@rev.ng>
> --
> NOTE: Last I checked I had some troubles with C++17 support within the
> container, was a while ago though.
Maybe that was the clang 15 + -std=c++14 I reported on the other thread?
> ---
> tests/docker/dockerfiles/debian-llvm.docker | 38 +++++++++++++++++++
> tests/docker/test-helper-to-tcg | 41 +++++++++++++++++++++
> 2 files changed, 79 insertions(+)
> create mode 100644 tests/docker/dockerfiles/debian-llvm.docker
> create mode 100755 tests/docker/test-helper-to-tcg
>
> diff --git a/tests/docker/dockerfiles/debian-llvm.docker b/tests/docker/dockerfiles/debian-llvm.docker
> new file mode 100644
> index 0000000000..7bfc084a34
> --- /dev/null
> +++ b/tests/docker/dockerfiles/debian-llvm.docker
> @@ -0,0 +1,38 @@
> +FROM docker.io/library/debian:11-slim
Debian 11 uses an old glibc (2.31) that prevents me from building QEMU.
Specifically, I get an error about missing `MADV_POPULATE_READ` and
`MADV_POPULATE_WRITE`.
I suggest to switch to Debian 12, for which llvm.sh provides all the
versions we're interested in *and* is compatible with the hexagon
toolchain.
All other `.docker`s use Debian 13, but apt.llvm.org only provide 21
and 22 for it.
There's an entry for older version but Packages is empty:
https://apt.llvm.org/trixie/dists/llvm-toolchain-trixie-15/main/binary-amd64/Packages
> +
> +RUN apt update && \
> + DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
> + DEBIAN_FRONTEND=noninteractive eatmydata \
> + apt install -y --no-install-recommends \
> + bison \
> + ca-certificates \
> + flex \
> + gawk \
> + libmpc-dev \
> + libmpfr-dev \
> + libglib2.0-dev \
> + libpixman-1-dev \
> + make \
> + ninja-build \
> + rsync \
> + pkgconf \
> + wget \
> + lsb-release \
> + software-properties-common \
> + gnupg \
> + meson \
> + python3-pip \
> + python3-setuptools \
> + python3-venv \
> + python3-wheel
I had to add bzip2 and libfdt-dev.
> +
> +RUN /usr/bin/pip3 install tomli
Python 3.11 (in Debian 12) has tomllib in the standard library and this
line should be no longer necessary.
> +
> +RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
> +RUN ./llvm.sh 15 all
> +RUN ./llvm.sh 16 all
> +RUN ./llvm.sh 17 all
> +RUN ./llvm.sh 18 all
> +RUN ./llvm.sh 19 all
> +RUN ./llvm.sh 20 all
> +RUN ./llvm.sh 21 all
I suggest to limit building QEMU for the Hexagon target:
DEF_TARGET_LIST=hexagon-linux-user
Otherwise, I get a build error on the ARM target with clang 15:
../../src/hw/arm/fsl-imx8mp.c:684:56: error: initializer element is not a compile-time constant
fsl_imx8mp_memmap[FSL_IMX8MP_FLEXCAN1].addr,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
I guess this is temporary, given that clang 15 is supported AFAIU.
I also suggest to install the Hexagon toolchain, so we can actually
test Hexagon.
ENV TOOLCHAIN_RELEASE=22.1.8
ENV TOOLCHAIN_URL=https://artifacts.codelinaro.org/artifactory/codelinaro-toolchain-for-hexagon/${TOOLCHAIN_RELEASE}________/hexagon-debs-${TOOLCHAIN_RELEASE}________.tar.gz
RUN ./llvm.sh 22 && \
mkdir -p /tmp/hexagon-debs && \
wget -qO- "$TOOLCHAIN_URL" | tar -xzC /tmp/hexagon-debs && \
DEBIAN_FRONTEND=noninteractive apt-get install -y /tmp/hexagon-debs/*.deb && \
rm -rf /tmp/hexagon-debs
I tested all the containers from 15 to 21 and the toolchain is
correctly picked up and tests pass (except for `test_max_temps`,
reported in another thread).
Eventually we'll also want to use helper-to-tcg for xqciu RISC-V
extensions, but even then, I think Hexagon is going to be the target
exercising the most features of helper-to-tcg, so it's worth to throw
it against the whole range of versions of LLVM we want to support.
Brian: I don't remember what's the status of the Hexagon toolchain, but
being able to use the upstream LLVM for check-tcg would be nice.
Can you remind me if anything major is missing there?
> diff --git a/tests/docker/test-helper-to-tcg b/tests/docker/test-helper-to-tcg
> new file mode 100755
> index 0000000000..0c27040d60
> --- /dev/null
> +++ b/tests/docker/test-helper-to-tcg
> @@ -0,0 +1,41 @@
> +#!/bin/bash -e
> +
> +TEST_COMMAND=""
> +TARGET_LIST=""
> +
I think you need to `. common.rc` and...
> +cd "$BUILD_DIR"
> +
> +# Checks helper-to-tcg builds and passes unit tests
> +# for targetted LLVM versions. Run meson from QEMU source so helper-to-tcg tests can find
> +# `tcg-global-mappings.h`.
> +for version in {15..21}; do
> + llvm_config=llvm-config-${version}
> + build_dir="${BUILD_DIR}/build-helper-to-tcg-${version}"
> + cxx=$(${llvm_config} --bindir)/clang++
> + [ ! -d ${build_dir} ] && mkdir ${build_dir}
> + CXX=${cxx} meson setup ${build_dir} ${QEMU_SRC}/subprojects/helper-to-tcg -Dllvm_config_path=${llvm_config}
> + meson compile -C ${build_dir}
> + meson test -C ${build_dir} --suite 'helper-to-tcg:helper-to-tcg'
> +done
> +
> +# Runs check-tcg for all LLVM versions
> +llvm_config_main=llvm-config-15
> +bin_main=$(${llvm_config_main} --bindir)
> +cc_main=${bin_main}/clang
> +cxx_main=${bin_main}/clang++
> +for version in {15..21}; do
> + llvm_config=llvm-config-${version}
> + build_dir=build-qemu-${version}
> + bin=$(${llvm_config} --bindir)
> + cxx=${bin}/clang++
> + cc=${bin}/clang
> + [ ! -d ${build_dir} ] && mkdir ${build_dir}
> +
> + pushd ${build_dir}
> +
> + TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
> + build_qemu "--cc=${cc_main} --cxx=${cxx_main} -Dhelper-to-tcg:llvm_config_path=${llvm_config} --enable-debug-tcg"
> + check_tcg
...
check_qemu check-tcg
> +
> + popd
> +done
> --
> 2.52.0
Reviewed-by: Alessandro Di Federico <ale@rev.ng>
--
Alessandro Di Federico
rev.ng Labs
next prev parent reply other threads:[~2026-07-31 11:49 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 3:09 [PATCH v2 00/50] Introduce helper-to-tcg Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 01/50] accel/tcg: Add bitreverse and funnel-shift runtime helper functions Anton Johansson via qemu development
2026-07-30 8:04 ` Philippe Mathieu-Daudé
2026-07-30 14:43 ` Richard Henderson
2026-07-30 3:09 ` [PATCH v2 02/50] accel/tcg: Add getpc helper Anton Johansson via qemu development
2026-07-30 14:48 ` Richard Henderson
2026-07-30 3:09 ` [PATCH v2 03/50] tcg: Introduce tcg-global-mappings Anton Johansson via qemu development
2026-07-30 16:11 ` Richard Henderson
2026-07-30 3:09 ` [PATCH v2 04/50] tcg: Increase maximum TB size Anton Johansson via qemu development
2026-07-30 16:13 ` Richard Henderson
2026-07-30 3:09 ` [PATCH v2 05/50] tcg: Expose tcg_gen_ussub_sat() Anton Johansson via qemu development
2026-07-30 7:52 ` Philippe Mathieu-Daudé
2026-07-30 16:17 ` Richard Henderson
2026-07-30 3:09 ` [PATCH v2 06/50] Add helper-to-tcg subproject Anton Johansson via qemu development
2026-07-30 15:56 ` Alessandro Di Federico via qemu development
2026-07-30 3:09 ` [PATCH v2 07/50] helper-to-tcg: Introduce get-llvm-ir.py Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 08/50] helper-to-tcg: Handle LLVM version compatibility Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 09/50] helper-to-tcg: Introduce custom LLVM pipeline Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 10/50] helper-to-tcg: Add pipeline --debug and --debug-only Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 11/50] helper-to-tcg: Add simple error creation helper Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 12/50] helper-to-tcg: Introduce PrepareForOptPass Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 13/50] helper-to-tcg: PrepareForOptPass, demangle function names Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 14/50] helper-to-tcg: PrepareForOptPass, map annotations Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 15/50] helper-to-tcg: PrepareForOptPass, cull unused functions Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 16/50] helper-to-tcg: PrepareForOptPass, undef llvm.returnaddress Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 17/50] helper-to-tcg: PrepareForOptPass, fixup inline attributes Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 18/50] helper-to-tcg: PrepareForOptPass, collect debuginfo Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 19/50] helper-to-tcg: Pipeline, run optimization pass Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 20/50] helper-to-tcg: Introduce pseudo instructions Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 21/50] helper-to-tcg: Add guest vector layout description Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 22/50] helper-to-tcg: Introduce PrepareForTcgPass Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 23/50] helper-to-tcg: PrepareForTcgPass, remove functions with cycles Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 24/50] helper-to-tcg: PrepareForTcgPass, demote PHI nodes Anton Johansson via qemu development
2026-07-30 3:09 ` [PATCH v2 25/50] helper-to-tcg: PrepareForTcgPass, map TCG globals Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 26/50] helper-to-tcg: PrepareForTcgPass, transform GEPs Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 27/50] helper-to-tcg: PrepareForTcgPass, canonicalize IR Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 28/50] helper-to-tcg: PrepareForTcgPass, identity map trivial expressions Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 29/50] helper-to-tcg: Introduce TcgV structure Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 30/50] helper-to-tcg: Introduce TcgGenPass Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 31/50] helper-to-tcg: TcgGenPass, linearize basic blocks Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 32/50] helper-to-tcg: TcgGenPass, introduce Value <-> TcgV map Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 33/50] helper-to-tcg: TcgGenPass, add structs for string emission Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 34/50] helper-to-tcg: TcgGenPass, map arguments to TCG Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 35/50] helper-to-tcg: TcgGenPass, propagate constant expresssions Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 36/50] helper-to-tcg: TcgGenPass, allocate TCG registers Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 37/50] helper-to-tcg: TcgGenPass, emit TCG strings Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 38/50] helper-to-tcg: Add README Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 40/50] test: helper-to-tcg docker tests Anton Johansson via qemu development
2026-07-31 11:46 ` Alessandro Di Federico via qemu development
2026-07-31 11:48 ` Alessandro Di Federico via qemu development [this message]
2026-07-30 3:10 ` [PATCH v2 41/50] target/hexagon: Add get_tb_mmu_index() Anton Johansson via qemu development
2026-07-30 7:49 ` Philippe Mathieu-Daudé
2026-07-30 3:10 ` [PATCH v2 42/50] target/hexagon: Increase VECTOR_TEMPS_MAX Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 43/50] target/hexagon: Provide env to tcg global mapping Anton Johansson via qemu development
2026-07-30 16:28 ` Richard Henderson
2026-07-30 3:10 ` [PATCH v2 44/50] target/hexagon: Keep gen_slotval/check_noshuf for helper-to-tcg Anton Johansson via qemu development
2026-07-31 11:46 ` Alessandro Di Federico via qemu development
2026-07-30 3:10 ` [PATCH v2 45/50] target/hexagon: Emit annotations for helpers Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 46/50] target/hexagon: Split probe_and_commit helper Anton Johansson via qemu development
2026-07-30 7:50 ` Philippe Mathieu-Daudé
2026-07-30 3:10 ` [PATCH v2 47/50] target/hexagon: Use helper-to-tcg helper calls Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 48/50] target/hexagon: Manually call generated HVX instructions Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 49/50] target/hexagon: Use idef-parser as a fallback Anton Johansson via qemu development
2026-07-30 3:10 ` [PATCH v2 50/50] target/hexagon: Use helper-to-tcg Anton Johansson via qemu development
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=20260731134815.051bc8e7@spawn \
--to=qemu-devel@nongnu.org \
--cc=ale@rev.ng \
--cc=anjo@rev.ng \
--cc=brian.cain@oss.qualcomm.com \
--cc=philmd@mailo.com \
--cc=pierrick.bouvier@oss.qualcomm.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.