tcg tests 20260925
Subsystems (2)
The following changes since commit 80c1d80c10a0676728d65874a9641eb578626d7c:
Merge tag 'pull-hex-20260924' of https://github.com/qualcomm/qemu into staging (2026-09-24 19:35:55 -0700)
are available in the Git repository at:
https://gitlab.com/p-b-o/qemu tags/pbouvier/pr/tcg-tests-20260925
for you to fetch changes up to 2ed098a7f2549781fc06e5228bf1fddcaf402db1:
tests/tcg: add alternative cross-compilers for macos (homebrew) (2026-09-25 17:04:17 +0000)
----------------------------------------------------------------
Changes:
- [PATCH] tests/tcg/meson.build: reintroduce build-tcg target (Pierrick Bouvier <[email protected]>)
- [PATCH] tests/docker/dockerfiles/debian-loongarch-cross: update (Pierrick Bouvier <[email protected]>)
- [PATCH] tests/tcg/meson.build: compile test with -fno-stack-protector (Pierrick Bouvier <[email protected]>)
- [PATCH v2 0/6] tests/tcg: use x86_64 cross containers on all host (Pierrick Bouvier <[email protected]>)
- [PATCH 0/4] tests/tcg/meson.build: detect additional cross compilers (Pierrick Bouvier <[email protected]>)
----------------------------------------------------------------
Pierrick Bouvier (13):
tests/tcg/meson.build: reintroduce build-tcg target tests/docker/dockerfiles/debian-loongarch-cross: update toolchain tests/tcg/meson.build: compile test with -fno-stack-protector by default tests/tcg/meson.build: force use of linux/amd64 platform for containers tests/lcitool/refresh: generate dockerfiles using --host-arch x86_64 tests/docker/dockerfiles/debian-all-test: remove arch specific bits tests/tcg/meson.build: remove cc_docker_host_arch tests/tcg/loongarch64/system: deactivate loongarch64-softmmu-memory (hang on aarch64 host) tests/tcg/x86_64: speed up compilation of avx, mmx and 3dnow tests tests/tcg/meson.build: report correct cc in summary
tests/tcg/meson.build: introduce cc_alt (alternative cross compiler) tests/tcg: add alternative cross-compilers for fedora
tests/tcg: add alternative cross-compilers for macos (homebrew)
.gitlab-ci.d/macos.yml | 7 -- tests/docker/dockerfiles/alpine.docker | 2 +- tests/docker/dockerfiles/centos9.docker | 2 +- .../dockerfiles/debian-all-test-cross.docker | 39 +++++---- tests/docker/dockerfiles/debian-amd64-cross.docker | 4 +- tests/docker/dockerfiles/debian-arm64-cross.docker | 4 +- tests/docker/dockerfiles/debian-armhf-cross.docker | 4 +- tests/docker/dockerfiles/debian-i686-cross.docker | 4 +- .../dockerfiles/debian-loongarch-cross.docker | 2 +- .../docker/dockerfiles/debian-ppc64el-cross.docker | 4 +- .../docker/dockerfiles/debian-riscv64-cross.docker | 4 +- tests/docker/dockerfiles/debian-s390x-cross.docker | 4 +- tests/docker/dockerfiles/debian.docker | 4 +- .../docker/dockerfiles/fedora-rust-nightly.docker | 2 +- tests/docker/dockerfiles/fedora-win64-cross.docker | 2 +- tests/docker/dockerfiles/fedora.docker | 2 +- tests/docker/dockerfiles/opensuse-leap.docker | 2 +- tests/docker/dockerfiles/ubuntu2404.docker | 2 +- tests/lcitool/libvirt-ci | 2 +- tests/lcitool/refresh | 37 +++++---- tests/tcg/aarch64/meson.build | 4 +- tests/tcg/aarch64/system/meson.build | 2 +- tests/tcg/aarch64_be/meson.build | 2 +- tests/tcg/alpha/meson.build | 2 - tests/tcg/alpha/system/meson.build | 1 - tests/tcg/arm/meson.build | 2 - tests/tcg/arm/system/meson.build | 2 +- tests/tcg/hexagon/meson.build | 1 - tests/tcg/hppa/meson.build | 1 - tests/tcg/i386/meson.build | 2 - tests/tcg/i386/system/meson.build | 2 +- tests/tcg/loongarch64/meson.build | 2 - tests/tcg/loongarch64/system/meson.build | 6 +- tests/tcg/m68k/meson.build | 1 - tests/tcg/meson.build | 92 +++++++++++++--------- tests/tcg/mips/meson.build | 1 - tests/tcg/mips64/meson.build | 1 - tests/tcg/mips64el/meson.build | 1 - tests/tcg/or1k/meson.build | 1 - tests/tcg/ppc64/meson.build | 1 - tests/tcg/ppc64le/meson.build | 2 +- tests/tcg/riscv64/meson.build | 4 +- tests/tcg/riscv64/system/meson.build | 2 +- tests/tcg/s390x/meson.build | 4 +- tests/tcg/s390x/system/meson.build | 2 +- tests/tcg/sh4/meson.build | 1 - tests/tcg/tricore/meson.build | 1 - tests/tcg/x86_64/meson.build | 10 +-- tests/tcg/x86_64/system/meson.build | 2 +- tests/tcg/xtensa/meson.build | 3 - 50 files changed, 142 insertions(+), 149 deletions(-)
[PULL 01/13] tests/tcg/meson.build: reintroduce build-tcg target
The refactoring introduced a new target named tcg-tests to build all ... tcg tests.
Previously, this target was named build-tcg. Keep both for compatiblity sake if people were relying on it.
--- tests/tcg/meson.build | 2 ++ 1 file changed, 2 insertions(+)
tests/tcg/meson.build +2 -0
@@ -524,4 +524,6 @@ endforeach if exe_targets.length() > 0 # finally create a top level target to rebuild all tests alias_target('tcg-tests', exe_targets) + # before, this target was called build-tcg. Keep it for compatibility sake. + alias_target('build-tcg', exe_targets) endif
Signature · 1 line
2.47.3
[PULL 03/13] tests/tcg/meson.build: compile test with -fno-stack-protector by default
In reply to Pierrick BouvierSome compilers enable stack protection by default (for instance, on archlinux). This produce a compilation error on some of our tests:
/usr/sbin/x86_64-linux-gnu-gcc tests/tcg/multiarch/system/interrupt.c -o tests/tcg/x86_64-softmmu-interrupt.test -static -MMD -MF tests/tcg/x86_64-softmmu-interrupt.d -Wall -Werror -O0 -g -fno-strict-aliasing -nostdlib -ffreestanding -Wa,--noexecstack -I tests/tcg/x86_64/system/../../minilib tests/tcg/x86_64/system/../../minilib/printf.c ../tests/tcg/x86_64/system/boot.S -Wl,-T ../tests/tcg/x86_64/system/kernel.ld -Wl,-melf_x86_64 -Wl,--no-warn-rwx-segments -Wl,--build-id=none -lgcc /usr/bin/ld: /tmp/ccs11W6S.o: in function `print_num':
tests/tcg/x86_64/system/../../minilib/printf.c:45:(.text+0xec): undefined reference to `__stack_chk_fail'/usr/bin/ld: /tmp/ccs11W6S.o: in function `ml_printf':
tests/tcg/x86_64/system/../../minilib/printf.c:136:(.text+0x549): undefined reference to `__stack_chk_fail'
collect2: error: ld returned 1 exit status
This flag has been previously added, but was removed when moving tcg tests to meson, with the goal to identify which systems require it.
https://gitlab.com/qemu-project/qemu/-/commit/580731dcc87eb27a2b0dc20ec331f1ce51864c97
One of these system is archlinux.
Thus, disable stack protection by default. It has no impact on tests results.
--- tests/tcg/meson.build | 6 ++++++ 1 file changed, 6 insertions(+)
tests/tcg/meson.build +6 -0
@@ -426,6 +426,12 @@ foreach target, plan: tcg_tests '-MMD', '-MF', '@DEPFILE@', '-Wall', '-Werror', '-O0', '-g', '-fno-strict-aliasing', + # Some host compilers (like archlinux) + # have stack protection enabled by default. + # This results in a linking error for some + # of our tests due to missing symbol + # __stack_chk_fail. Thus, disable it. + '-fno-stack-protector', cflags], depfile: exe_name + '.d', output: exe_name + '.test',
Signature · 1 line
2.47.3
[PULL 11/13] tests/tcg/meson.build: introduce cc_alt (alternative cross compiler)
In reply to Pierrick BouvierThis allows each target to provide an additional list of cross compilers to check. With this, we can detect default cc for common setups (debian/fedora/macos) without user having to provide a --cross-cc-* option.
In addition, it allows us to pick up host compilers for various hosts. (debian and archlinux have $arch-linux-gnu-gcc installed with gcc package by default, but not fedora).
--- tests/tcg/meson.build | 46 +++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 19 deletions(-)
tests/tcg/meson.build +27 -19
@@ -21,6 +21,7 @@ tcg_tests = {} # { # 'name_of_target': { # 'cc': 'cross_compiler', +# 'cc_alt': ['list of alternative cross compilers', ...] # 'cc_dockerfile': 'name_of_dockerfile', # 'cc_feat_cflags': { # 'name': ['feature cflags'],
@@ -210,7 +211,7 @@ foreach target, plan: tcg_tests # return a clear error if user misspell a target entry foreach key, _ : plan - allowed = ['cc', 'cc_dockerfile', 'cc_feat_cflags', + allowed = ['cc', 'cc_alt', 'cc_dockerfile', 'cc_feat_cflags', 'folder', 'gdb_arch', 'gdb_feat_version', 'qemu', 'tests'] if key not in allowed error('unknown tcg test plan entry \'' + key + '\' for target ' + target +
@@ -218,15 +219,18 @@ foreach target, plan: tcg_tests endif endforeach - cc = find_program(plan['cc'], required : false) + cc_list = [plan['cc']] + if 'cc_alt' in plan + cc_list += plan['cc_alt'] + endif + cc_cflags = [] - check_flags = [] check_required = false cross_cc = get_option('tcg_tests_cross_cc_' + cc_arch) if cross_cc != '' - # we make sure cross cc exists - cc = find_program(cross_cc, required: true) + # prepend requested cross_cc + cc_list = [cross_cc, cc_list] check_required = true endif cross_cflags = get_option('tcg_tests_cross_cflags_' + cc_arch)
@@ -236,22 +240,26 @@ foreach target, plan: tcg_tests check_flags = cc_cflags check_required = true endif - - cc_from_system = cc.found() - has_cc = cc.found() - if has_cc - if target.endswith('softmmu') - check_flags += ['-nostdlib', '-ffreestanding', '-r'] - else - check_flags += ['-static'] - endif - - cmd = run_command([cc, files('test_cc.c'), check_flags, '-o', '/dev/null'], - check: check_required) - has_cc = cmd.returncode() == 0 - cc_from_system = has_cc + if target.endswith('softmmu') + check_flags += ['-nostdlib', '-ffreestanding', '-r'] + else + check_flags += ['-static'] endif + has_cc = false + foreach possible_cc: cc_list + cc = find_program(possible_cc, required: check_required) + if cc.found() + cmd = run_command([cc, files('test_cc.c'), check_flags, '-o', '/dev/null'], + check: check_required) + if cmd.returncode() == 0 + has_cc = true + break + endif + endif + endforeach + + cc_from_system = has_cc build_test_depends = [] build_test_depend_files = []
Signature · 1 line
2.47.3
[PULL 13/13] tests/tcg: add alternative cross-compilers for macos (homebrew)
In reply to Pierrick BouvierAdd support for cross compilers that can be installed with
homebrew: https://github.com/orgs/Homebrew/packages?tab=packages&q=-gcc
- i686-elf-gcc
- x86_64-elf-gcc
- aarch64-elf-gcc
- m68k-elf-gcc (ignored since we don't have system tests for m68k)
- riscv64-elf-gcc
- arm-none-eabi-gcc
Those toolchain target bare metal, so can be used for softmmu targets only (macos has no user target anyway).
With this, we can also cleanup our CI for MacOS since it does not require any --cross-prefix anymore.
--- .gitlab-ci.d/macos.yml | 7 ------- tests/tcg/aarch64/system/meson.build | 2 +- tests/tcg/arm/system/meson.build | 1 + tests/tcg/i386/system/meson.build | 1 + tests/tcg/riscv64/system/meson.build | 2 +- tests/tcg/x86_64/system/meson.build | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-)
.gitlab-ci.d/macos.yml +0 -7
@@ -41,10 +41,6 @@ aarch64-macos-15-build: PKG_CONFIG_PATH: /opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig CONFIGURE_ARGS: --target-list=aarch64-softmmu,arm-softmmu,i386-softmmu,x86_64-softmmu - --cross-prefix-aarch64=aarch64-elf- - --cross-prefix-arm=arm-none-eabi- - --cross-prefix-i386=i686-elf- - --cross-prefix-x86_64=x86_64-elf- --disable-plugins TEST_TARGETS: check-unit check-tcg
@@ -59,8 +55,5 @@ aarch64-macos-26-build: PKG_CONFIG_PATH: /opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig CONFIGURE_ARGS: --target-list=aarch64-softmmu,i386-softmmu,x86_64-softmmu - --cross-prefix-aarch64=aarch64-elf- - --cross-prefix-i386=i686-elf- - --cross-prefix-x86_64=x86_64-elf- --disable-plugins TEST_TARGETS: check-unit check-tcg
tests/tcg/aarch64/system/meson.build +1 -1
@@ -96,7 +96,7 @@ if 'qemu-system-aarch64' in emulators tcg_tests += { 'aarch64-softmmu': { 'cc': cc, - 'cc_alt': cc_alt, + 'cc_alt': cc_alt + ['aarch64-elf-gcc'], 'cc_dockerfile': cc_dockerfile, 'cc_feat_cflags': cc_feat_cflags, 'folder': 'aarch64/system',
tests/tcg/arm/system/meson.build +1 -0
@@ -64,6 +64,7 @@ if 'qemu-system-arm' in emulators tcg_tests += { 'arm-softmmu': { 'cc': cc, + 'cc_alt': ['arm-none-eabi-gcc'], 'cc_dockerfile': cc_dockerfile, 'folder': 'arm/system', 'gdb_arch': 'arm',
tests/tcg/i386/system/meson.build +1 -0
@@ -42,6 +42,7 @@ if 'qemu-system-i386' in emulators tcg_tests += { 'i386-softmmu': { 'cc': cc, + 'cc_alt': ['i686-elf-gcc'], 'cc_dockerfile': cc_dockerfile, 'folder': 'i386/system', 'gdb_arch': 'i386',
tests/tcg/riscv64/system/meson.build +1 -1
@@ -65,7 +65,7 @@ if 'qemu-system-riscv64' in emulators tcg_tests += { 'riscv64-softmmu': { 'cc': cc, - 'cc_alt': cc_alt, + 'cc_alt': cc_alt + ['riscv64-elf-gcc'], 'cc_dockerfile': cc_dockerfile, 'folder': 'riscv64', 'gdb_arch': 'riscv64',
tests/tcg/x86_64/system/meson.build +1 -1
@@ -52,7 +52,7 @@ if 'qemu-system-x86_64' in emulators tcg_tests += { 'x86_64-softmmu': { 'cc': cc, - 'cc_alt': cc_alt, + 'cc_alt': cc_alt + ['x86_64-elf-gcc'], 'cc_dockerfile': cc_dockerfile, 'folder': 'x86_64/system', 'gdb_arch': 'x86_64',
Signature · 1 line
2.47.3
[PULL 09/13] tests/tcg/x86_64: speed up compilation of avx, mmx and 3dnow tests
In reply to Pierrick BouvierWhen profiling build of tcg-tests on aarch64 host (compiler running with qemu-user-binfmt), it was found that those tests were the longest to compile:
- avx: 1min
- mmx: 8s
- 3dnow: 2s (normal time, but for consistency, apply same flag than others).
Compiling with -O0 (default), compilation times are reduced by 50% for those files. Since they use inline assembly, result is unchanged and optimizations don't matter.
--- tests/tcg/x86_64/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/tcg/x86_64/meson.build +3 -3
@@ -31,18 +31,18 @@ tests += { '../i386/test-i386-ssse3.c': {}, '../i386/test-3dnow.c': { 'cflags': ['-I', meson.current_build_dir(), - '-masm=intel', '-O'], + '-masm=intel'], 'depends': [test_3dnow_h], }, '../i386/test-avx.c': { 'cflags': ['-I', meson.current_build_dir(), - '-mavx', '-masm=intel', '-O'], + '-mavx', '-masm=intel'], 'depends': [test_avx_h], }, '../i386/test-flags.c': {}, '../i386/test-mmx.c': { 'cflags': ['-I', meson.current_build_dir(), - '-masm=intel', '-O'], + '-masm=intel'], 'depends': [test_mmx_h], }, '../i386/test-i386.c': {
Signature · 1 line
2.47.3
[PULL 10/13] tests/tcg/meson.build: report correct cc in summary
In reply to Pierrick BouvierSummary didn't consider that cc could have been set using --cross-cc* options, and was wrongly reporting default cc declared in test suite. Fix that by reporting path of compiler found.
--- tests/tcg/meson.build | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tests/tcg/meson.build +4 -3
@@ -290,9 +290,10 @@ foreach target, plan: tcg_tests summary_cc = false if has_cc - summary_cc = plan['cc'] - if not cc_from_system - summary_cc += ' (from \'qemu/' + plan['cc_dockerfile'] + '\' container)' + if cc_from_system + summary_cc = cc.full_path() + else + summary_cc = plan['cc'] + ' (from \'qemu/' + plan['cc_dockerfile'] + '\' container)' endif endif tcg_tests_summary += {'cc for ' + target: summary_cc}
Signature · 1 line
2.47.3
[PULL 07/13] tests/tcg/meson.build: remove cc_docker_host_arch
In reply to Pierrick BouvierNow we know all container images used for tcg-tests are x86_64 only, we don't need to specify anymore which arch they support.
--- tests/tcg/aarch64/meson.build | 2 -- tests/tcg/aarch64/system/meson.build | 1 - tests/tcg/aarch64_be/meson.build | 1 - tests/tcg/alpha/meson.build | 2 -- tests/tcg/alpha/system/meson.build | 1 - tests/tcg/arm/meson.build | 2 -- tests/tcg/arm/system/meson.build | 1 - tests/tcg/hexagon/meson.build | 1 - tests/tcg/hppa/meson.build | 1 - tests/tcg/i386/meson.build | 2 -- tests/tcg/i386/system/meson.build | 1 - tests/tcg/loongarch64/meson.build | 2 -- tests/tcg/loongarch64/system/meson.build | 1 - tests/tcg/m68k/meson.build | 1 - tests/tcg/meson.build | 11 +---------- tests/tcg/mips/meson.build | 1 - tests/tcg/mips64/meson.build | 1 - tests/tcg/mips64el/meson.build | 1 - tests/tcg/or1k/meson.build | 1 - tests/tcg/ppc64/meson.build | 1 - tests/tcg/ppc64le/meson.build | 1 - tests/tcg/riscv64/meson.build | 2 -- tests/tcg/riscv64/system/meson.build | 1 - tests/tcg/s390x/meson.build | 2 -- tests/tcg/s390x/system/meson.build | 1 - tests/tcg/sh4/meson.build | 1 - tests/tcg/tricore/meson.build | 1 - tests/tcg/x86_64/meson.build | 2 -- tests/tcg/x86_64/system/meson.build | 1 - tests/tcg/xtensa/meson.build | 3 --- 30 files changed, 1 insertion(+), 49 deletions(-)
tests/tcg/aarch64/meson.build +0 -2
@@ -1,6 +1,5 @@ cc = 'aarch64-linux-gnu-gcc' cc_dockerfile = 'debian-all-test-cross' -cc_docker_host_arch = ['aarch64', 'x86_64'] cc_feat_cflags = { 'aes': '-march=armv8-a+aes',
@@ -198,7 +197,6 @@ if 'qemu-aarch64' in emulators 'aarch64-linux-user': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'cc_feat_cflags': cc_feat_cflags, 'folder': 'aarch64', 'gdb_arch': 'aarch64',
tests/tcg/aarch64/system/meson.build +0 -1
@@ -97,7 +97,6 @@ if 'qemu-system-aarch64' in emulators 'aarch64-softmmu': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'cc_feat_cflags': cc_feat_cflags, 'folder': 'aarch64/system', 'gdb_arch': 'aarch64',
tests/tcg/aarch64_be/meson.build +0 -1
@@ -11,7 +11,6 @@ if 'qemu-aarch64_be' in emulators 'aarch64_be-linux-user': { 'cc': 'aarch64-linux-gnu-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['aarch64', 'x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'aarch64_be', 'gdb_arch': 'aarch64_be',
tests/tcg/alpha/meson.build +0 -2
@@ -1,6 +1,5 @@ cc = 'alpha-linux-gnu-gcc' cc_dockerfile = 'debian-all-test-cross' -cc_docker_host_arch = ['aarch64', 'x86_64'] subdir('system')
@@ -45,7 +44,6 @@ if 'qemu-alpha' in emulators 'alpha-linux-user': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'alpha', 'gdb_arch': 'alpha', 'qemu': emulators['qemu-alpha'],
tests/tcg/alpha/system/meson.build +0 -1
@@ -37,7 +37,6 @@ if 'qemu-system-alpha' in emulators 'alpha-softmmu': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'alpha/system', 'gdb_arch': 'alpha', 'qemu': emulators['qemu-system-alpha'],
tests/tcg/arm/meson.build +0 -2
@@ -1,6 +1,5 @@ cc = 'arm-linux-gnueabihf-gcc' cc_dockerfile = 'debian-all-test-cross' -cc_docker_host_arch = ['aarch64', 'x86_64'] subdir('system')
@@ -71,7 +70,6 @@ if 'qemu-arm' in emulators 'arm-linux-user': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'arm', 'gdb_arch': 'arm', 'qemu': emulators['qemu-arm'],
tests/tcg/arm/system/meson.build +0 -1
@@ -65,7 +65,6 @@ if 'qemu-system-arm' in emulators 'arm-softmmu': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'arm/system', 'gdb_arch': 'arm', 'qemu': emulators['qemu-system-arm'],
tests/tcg/hexagon/meson.build +0 -1
@@ -115,7 +115,6 @@ if 'qemu-hexagon' in emulators 'hexagon-linux-user': { 'cc': 'hexagon-unknown-linux-musl-clang', 'cc_dockerfile': 'debian-hexagon-cross', - 'cc_docker_host_arch': ['x86_64'], 'folder': 'hexagon', 'gdb_arch': 'hexagon_is_not_supported_by_gdb', 'qemu': emulators['qemu-hexagon'],
tests/tcg/hppa/meson.build +0 -1
@@ -11,7 +11,6 @@ if 'qemu-hppa' in emulators 'hppa-linux-user': { 'cc': 'hppa-linux-gnu-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'hppa', 'gdb_arch': 'hppa',
tests/tcg/i386/meson.build +0 -2
@@ -1,6 +1,5 @@ cc = 'i686-linux-gnu-gcc' cc_dockerfile = 'debian-i686-cross' -cc_docker_host_arch = ['x86_64'] subdir('system')
@@ -48,7 +47,6 @@ if 'qemu-i386' in emulators 'i386-linux-user': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'i386', 'gdb_arch': 'i386', 'qemu': emulators['qemu-i386'],
tests/tcg/i386/system/meson.build +0 -1
@@ -43,7 +43,6 @@ if 'qemu-system-i386' in emulators 'i386-softmmu': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'i386/system', 'gdb_arch': 'i386', 'qemu': emulators['qemu-system-i386'],
tests/tcg/loongarch64/meson.build +0 -2
@@ -1,6 +1,5 @@ cc = 'loongarch64-unknown-linux-gnu-gcc' cc_dockerfile = 'debian-loongarch-cross' -cc_docker_host_arch = ['x86_64'] subdir('system')
@@ -22,7 +21,6 @@ if 'qemu-loongarch64' in emulators 'loongarch64-linux-user': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'loongarch64', 'gdb_arch': 'loongarch64', 'qemu': emulators['qemu-loongarch64'],
tests/tcg/loongarch64/system/meson.build +0 -1
@@ -38,7 +38,6 @@ if 'qemu-system-loongarch64' in emulators 'loongarch64-softmmu': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'loongarch64/system', 'gdb_arch': 'loongarch64', 'qemu': emulators['qemu-system-loongarch64'],
tests/tcg/m68k/meson.build +0 -1
@@ -12,7 +12,6 @@ if 'qemu-m68k' in emulators 'm68k-linux-user': { 'cc': 'm68k-linux-gnu-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'm68k', 'gdb_arch': 'm68k',
tests/tcg/meson.build +1 -10
@@ -22,7 +22,6 @@ tcg_tests = {} # 'name_of_target': { # 'cc': 'cross_compiler', # 'cc_dockerfile': 'name_of_dockerfile', -# 'cc_docker_host_arch': ['host_arch_supported (meson cpu)', ...], # 'cc_feat_cflags': { # 'name': ['feature cflags'], # ...
@@ -211,7 +210,7 @@ foreach target, plan: tcg_tests # return a clear error if user misspell a target entry foreach key, _ : plan - allowed = ['cc', 'cc_dockerfile', 'cc_docker_host_arch', 'cc_feat_cflags', + allowed = ['cc', 'cc_dockerfile', 'cc_feat_cflags', 'folder', 'gdb_arch', 'gdb_feat_version', 'qemu', 'tests'] if key not in allowed error('unknown tcg test plan entry \'' + key + '\' for target ' + target +
@@ -258,14 +257,6 @@ foreach target, plan: tcg_tests if 'cc_dockerfile' in plan cc_dockerfile = plan['cc_dockerfile'] - cc_docker_host_arch = plan['cc_docker_host_arch'] - allowed = ['aarch64', 'x86_64'] - foreach arch: cc_docker_host_arch - if arch not in allowed - error('incorrect docker arch ' + arch + ' for target ' + - target + ' (possible: [' + ', '.join(allowed) + '])') - endif - endforeach dockerfile = files('..'/'docker'/'dockerfiles'/cc_dockerfile + '.docker') image_name = 'image-' + cc_dockerfile if cc_dockerfile not in image_targets and docker_supported
tests/tcg/mips/meson.build +0 -1
@@ -14,7 +14,6 @@ if 'qemu-mips' in emulators 'mips-linux-user': { 'cc': 'mips-linux-gnu-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['aarch64', 'x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'mips', 'gdb_arch': 'mips',
tests/tcg/mips64/meson.build +0 -1
@@ -16,7 +16,6 @@ if 'qemu-mips64' in emulators 'mips64-linux-user': { 'cc': 'mips64-linux-gnuabi64-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['aarch64', 'x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'mips64', 'gdb_arch': 'mips64',
tests/tcg/mips64el/meson.build +0 -1
@@ -3,7 +3,6 @@ if 'qemu-mips64el' in emulators 'mips64el-linux-user': { 'cc': 'mips64el-linux-gnuabi64-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['aarch64', 'x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'mips64el', 'gdb_arch': 'mips64el',
tests/tcg/or1k/meson.build +0 -1
@@ -61,7 +61,6 @@ if 'qemu-or1k' in emulators 'or1k-linux-user': { 'cc': 'or1k-none-linux-musl-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'or1k', 'gdb_arch': 'or1k',
tests/tcg/ppc64/meson.build +0 -1
@@ -44,7 +44,6 @@ if 'qemu-ppc64' in emulators 'ppc64-linux-user': { 'cc': 'powerpc64-linux-gnu-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'ppc64', 'gdb_arch': 'ppc64',
tests/tcg/ppc64le/meson.build +0 -1
@@ -3,7 +3,6 @@ if 'qemu-ppc64le' in emulators 'ppc64le-linux-user': { 'cc': 'powerpc64le-linux-gnu-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'ppc64le', 'gdb_arch': 'ppc64le',
tests/tcg/riscv64/meson.build +0 -2
@@ -1,6 +1,5 @@ cc = 'riscv64-linux-gnu-gcc' cc_dockerfile = 'debian-all-test-cross' -cc_docker_host_arch = ['aarch64', 'x86_64'] subdir('system')
@@ -28,7 +27,6 @@ if 'qemu-riscv64' in emulators 'riscv64-linux-user': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'riscv64', 'gdb_arch': 'riscv64', 'qemu': emulators['qemu-riscv64'],
tests/tcg/riscv64/system/meson.build +0 -1
@@ -66,7 +66,6 @@ if 'qemu-system-riscv64' in emulators 'riscv64-softmmu': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'riscv64', 'gdb_arch': 'riscv64', 'qemu': emulators['qemu-system-riscv64'],
tests/tcg/s390x/meson.build +0 -2
@@ -1,6 +1,5 @@ cc = 's390x-linux-gnu-gcc' cc_dockerfile = 'debian-all-test-cross' -cc_docker_host_arch = ['aarch64', 'x86_64'] cc_feat_cflags = { 'z14': '-march=z14',
@@ -142,7 +141,6 @@ if 'qemu-s390x' in emulators 's390x-linux-user': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'cc_feat_cflags': cc_feat_cflags, 'folder': 's390x', 'gdb_arch': 's390x',
tests/tcg/s390x/system/meson.build +0 -1
@@ -83,7 +83,6 @@ if 'qemu-system-s390x' in emulators 's390x-softmmu': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'cc_feat_cflags': cc_feat_cflags, 'folder': 's390x', 'gdb_arch': 's390x',
tests/tcg/sh4/meson.build +0 -1
@@ -14,7 +14,6 @@ if 'qemu-sh4' in emulators 'sh4-linux-user': { 'cc': 'sh4-linux-gnu-gcc', 'cc_dockerfile': 'debian-all-test-cross', - 'cc_docker_host_arch': ['aarch64', 'x86_64'], 'cc_feat_cflags': cc_feat_cflags, 'folder': 'sh4', 'gdb_arch': 'sh4',
tests/tcg/tricore/meson.build +0 -1
@@ -47,7 +47,6 @@ if 'qemu-system-tricore' in emulators 'tricore-softmmu': { 'cc': 'tricore-gcc', 'cc_dockerfile': 'debian-tricore-cross', - 'cc_docker_host_arch': ['x86_64'], 'folder': 'tricore', 'gdb_arch': 'tricore', 'qemu': emulators['qemu-system-tricore'],
tests/tcg/x86_64/meson.build +0 -2
@@ -1,6 +1,5 @@ cc = 'x86_64-linux-gnu-gcc' cc_dockerfile = 'debian-amd64-cross' -cc_docker_host_arch = ['x86_64'] subdir('system')
@@ -74,7 +73,6 @@ if 'qemu-x86_64' in emulators 'x86_64-linux-user': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'x86_64', 'gdb_arch': 'x86_64', 'qemu': emulators['qemu-x86_64'],
tests/tcg/x86_64/system/meson.build +0 -1
@@ -53,7 +53,6 @@ if 'qemu-system-x86_64' in emulators 'x86_64-softmmu': { 'cc': cc, 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'x86_64/system', 'gdb_arch': 'x86_64', 'qemu': emulators['qemu-system-x86_64'],
tests/tcg/xtensa/meson.build +0 -3
@@ -79,14 +79,12 @@ foreach core: cores endforeach cc_dockerfile = 'debian-xtensa-cross' -cc_docker_host_arch = ['x86_64'] if 'qemu-system-xtensa' in emulators tcg_tests += { 'xtensa-softmmu': { 'cc': 'xtensa-dc232b-elf-gcc', 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'xtensa', 'gdb_arch': 'xtensa', 'qemu': emulators['qemu-system-xtensa'],
@@ -100,7 +98,6 @@ if 'qemu-system-xtensaeb' in emulators 'xtensaeb-softmmu': { 'cc': 'xtensa-test_kc705_be-elf-gcc', 'cc_dockerfile': cc_dockerfile, - 'cc_docker_host_arch': cc_docker_host_arch, 'folder': 'xtensa', 'gdb_arch': 'xtensaeb', 'qemu': emulators['qemu-system-xtensaeb'],
Signature · 1 line
2.47.3
[PULL 05/13] tests/lcitool/refresh: generate dockerfiles using --host-arch x86_64
In reply to Pierrick BouvierTo ensure refresh output is consistent on any host architecture, we need to specify which host arch it's supposed to target.
Indeed, by default, package list will depend on host architecture, which means that output will depend on which machine runs refresh command. For example, on aarch64 host, refresh removes libpmem-dev package since it's not available.
Also, update lcitool submodule: It now uses arch specific images by default. Thus we update all images at the same time.
https://gitlab.com/libvirt/libvirt-ci/-/commit/f34cd57eb892259c26600187bc35cc4152f932cf
--- tests/docker/dockerfiles/alpine.docker | 2 +- tests/docker/dockerfiles/centos9.docker | 2 +- tests/docker/dockerfiles/debian-all-test-cross.docker | 4 ++-- tests/docker/dockerfiles/debian-amd64-cross.docker | 4 ++-- tests/docker/dockerfiles/debian-arm64-cross.docker | 4 ++-- tests/docker/dockerfiles/debian-armhf-cross.docker | 4 ++-- tests/docker/dockerfiles/debian-i686-cross.docker | 4 ++-- tests/docker/dockerfiles/debian-ppc64el-cross.docker | 4 ++-- tests/docker/dockerfiles/debian-riscv64-cross.docker | 4 ++-- tests/docker/dockerfiles/debian-s390x-cross.docker | 4 ++-- tests/docker/dockerfiles/debian.docker | 4 ++-- tests/docker/dockerfiles/fedora-rust-nightly.docker | 2 +- tests/docker/dockerfiles/fedora-win64-cross.docker | 2 +- tests/docker/dockerfiles/fedora.docker | 2 +- tests/docker/dockerfiles/opensuse-leap.docker | 2 +- tests/docker/dockerfiles/ubuntu2404.docker | 2 +- tests/lcitool/libvirt-ci | 2 +- tests/lcitool/refresh | 2 +- 18 files changed, 27 insertions(+), 27 deletions(-)
tests/docker/dockerfiles/alpine.docker +1 -1
@@ -1,6 +1,6 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all alpine-323 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 alpine-323 qemu # # https://gitlab.com/libvirt/libvirt-ci
tests/docker/dockerfiles/centos9.docker +1 -1
@@ -1,6 +1,6 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all centos-stream-9 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 centos-stream-9 qemu # # https://gitlab.com/libvirt/libvirt-ci
tests/docker/dockerfiles/debian-all-test-cross.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all debian-13 qemu-minimal +# $ lcitool dockerfile --layers all --host-arch x86_64 debian-13 qemu-minimal # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/debian-amd64-cross.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross-arch x86_64 debian-13 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 --cross-arch x86_64 debian-13 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/debian-arm64-cross.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross-arch aarch64 debian-13 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 --cross-arch aarch64 debian-13 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/debian-armhf-cross.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross-arch armv7l debian-13 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 --cross-arch armv7l debian-13 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/debian-i686-cross.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross-arch i686 debian-13 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 --cross-arch i686 debian-13 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/debian-ppc64el-cross.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross-arch ppc64le debian-13 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 --cross-arch ppc64le debian-13 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/debian-riscv64-cross.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross-arch riscv64 debian-13 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 --cross-arch riscv64 debian-13 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/debian-s390x-cross.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross-arch s390x debian-13 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 --cross-arch s390x debian-13 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/debian.docker +2 -2
@@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all debian-13 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 debian-13 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/debian:13-slim +FROM docker.io/amd64/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \
tests/docker/dockerfiles/fedora-rust-nightly.docker +1 -1
@@ -1,6 +1,6 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all fedora-43 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 fedora-43 qemu # # https://gitlab.com/libvirt/libvirt-ci
tests/docker/dockerfiles/fedora-win64-cross.docker +1 -1
@@ -1,6 +1,6 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross-arch mingw64 fedora-43 qemu,qemu-win-installer +# $ lcitool dockerfile --layers all --host-arch x86_64 --cross-arch mingw64 fedora-43 qemu,qemu-win-installer # # https://gitlab.com/libvirt/libvirt-ci
tests/docker/dockerfiles/fedora.docker +1 -1
@@ -1,6 +1,6 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all fedora-43 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 fedora-43 qemu # # https://gitlab.com/libvirt/libvirt-ci
tests/docker/dockerfiles/opensuse-leap.docker +1 -1
@@ -1,6 +1,6 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all opensuse-leap-16 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 opensuse-leap-16 qemu # # https://gitlab.com/libvirt/libvirt-ci
tests/docker/dockerfiles/ubuntu2404.docker +1 -1
@@ -1,6 +1,6 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all ubuntu-2404 qemu +# $ lcitool dockerfile --layers all --host-arch x86_64 ubuntu-2404 qemu # # https://gitlab.com/libvirt/libvirt-ci
tests/lcitool/libvirt-ci +1 -1
@@ -1 +1 @@ -Subproject commit 76b5dd5b5c84511e2e799c2b3d6a2a9b9f6a081d +Subproject commit f34cd57eb892259c26600187bc35cc4152f932cf
tests/lcitool/refresh +1 -1
@@ -66,7 +66,7 @@ add_user_mapping = [ def generate_dockerfile(host, target, project="qemu", cross=None, trailer=None, enable_rust=True): filename = Path(src_dir, "tests", "docker", "dockerfiles", host + ".docker") - cmd = lcitool_cmd + ["dockerfile"] + cmd = lcitool_cmd + ["dockerfile", "--host-arch", "x86_64"] if cross is not None: cmd.extend(["--cross", cross]) cmd.extend([target, project])
Signature · 1 line
2.47.3
[PULL 06/13] tests/docker/dockerfiles/debian-all-test: remove arch specific bits
In reply to Pierrick BouvierNow that this image is amd64 only, we don't need those ifs anymore.
--- .../dockerfiles/debian-all-test-cross.docker | 35 +++++++++---------- tests/lcitool/refresh | 35 +++++++++---------- 2 files changed, 34 insertions(+), 36 deletions(-)
tests/docker/dockerfiles/debian-all-test-cross.docker +17 -18
@@ -66,15 +66,15 @@ RUN apt update && \ rsync # https://openrisc.io/2025/04/20/toolchainrootfsbins -RUN if dpkg-architecture -e amd64; then \ -cd /tmp && \ +RUN cd /tmp && \ wget -q https://github.com/stffrdhrn/or1k-toolchain-build/releases/download/or1k-16.1.0-20260614/or1k-none-linux-musl-16.1.0-20260614.tar.xz && \ tar --no-same-owner -xf *.tar.xz && \ rsync -a or1k-none-linux-musl/ /usr/ && \ - rm -rf /tmp/*; \ -fi + rm -rf /tmp/* -ENV AVAILABLE_COMPILERS="\ +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive eatmydata \ + apt install -y --no-install-recommends \ gcc-aarch64-linux-gnu \ libc6-dev-arm64-cross \ gcc-arm-linux-gnueabihf \
@@ -97,19 +97,18 @@ ENV AVAILABLE_COMPILERS="\ libc6-dev-s390x-cross\ gcc-sh4-linux-gnu \ libc6-dev-sh4-cross \ - " -RUN if dpkg-architecture -e amd64; then \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-hppa-linux-gnu libc6-dev-hppa-cross"; \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-m68k-linux-gnu libc6-dev-m68k-cross"; \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc-linux-gnu libc6-dev-powerpc-cross"; \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross"; \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-sparc64-linux-gnu libc6-dev-sparc64-cross"; \ -fi && \ -apt update && \ -DEBIAN_FRONTEND=noninteractive eatmydata \ -apt install -y --no-install-recommends \ -${AVAILABLE_COMPILERS} && \ -dpkg-query --showformat '${Package}_${Version}_${Architecture}' --show > /packages.txt + gcc-hppa-linux-gnu \ + libc6-dev-hppa-cross \ + gcc-m68k-linux-gnu \ + libc6-dev-m68k-cross \ + gcc-powerpc-linux-gnu \ + libc6-dev-powerpc-cross \ + gcc-powerpc64-linux-gnu \ + libc6-dev-ppc64-cross \ + gcc-sparc64-linux-gnu \ + libc6-dev-sparc64-cross \ + && \ + dpkg-query --showformat '${Package}_${Version}_${Architecture}' --show > /packages.txt ENV QEMU_CONFIGURE_OPTS=--disable-docs ENV DEF_TARGET_LIST=aarch64-linux-user,alpha-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sh4-linux-user,sparc64-linux-user # As a final step configure the user (if env is defined)
tests/lcitool/refresh +17 -18
@@ -177,15 +177,15 @@ RUN apt update && \ rsync # https://openrisc.io/2025/04/20/toolchainrootfsbins -RUN if dpkg-architecture -e amd64; then \ -cd /tmp && \ +RUN cd /tmp && \ wget -q https://github.com/stffrdhrn/or1k-toolchain-build/releases/download/or1k-16.1.0-20260614/or1k-none-linux-musl-16.1.0-20260614.tar.xz && \ tar --no-same-owner -xf *.tar.xz && \ rsync -a or1k-none-linux-musl/ /usr/ && \ - rm -rf /tmp/*; \ -fi + rm -rf /tmp/* -ENV AVAILABLE_COMPILERS="\ +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive eatmydata \ + apt install -y --no-install-recommends \ gcc-aarch64-linux-gnu \ libc6-dev-arm64-cross \ gcc-arm-linux-gnueabihf \
@@ -208,19 +208,18 @@ ENV AVAILABLE_COMPILERS="\ libc6-dev-s390x-cross\ gcc-sh4-linux-gnu \ libc6-dev-sh4-cross \ - " -RUN if dpkg-architecture -e amd64; then \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-hppa-linux-gnu libc6-dev-hppa-cross"; \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-m68k-linux-gnu libc6-dev-m68k-cross"; \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc-linux-gnu libc6-dev-powerpc-cross"; \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross"; \ - export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-sparc64-linux-gnu libc6-dev-sparc64-cross"; \ -fi && \ -apt update && \ -DEBIAN_FRONTEND=noninteractive eatmydata \ -apt install -y --no-install-recommends \ -${AVAILABLE_COMPILERS} && \ -dpkg-query --showformat '${Package}_${Version}_${Architecture}' --show > /packages.txt + gcc-hppa-linux-gnu \ + libc6-dev-hppa-cross \ + gcc-m68k-linux-gnu \ + libc6-dev-m68k-cross \ + gcc-powerpc-linux-gnu \ + libc6-dev-powerpc-cross \ + gcc-powerpc64-linux-gnu \ + libc6-dev-ppc64-cross \ + gcc-sparc64-linux-gnu \ + libc6-dev-sparc64-cross \ + && \ + dpkg-query --showformat '${Package}_${Version}_${Architecture}' --show > /packages.txt ENV QEMU_CONFIGURE_OPTS=--disable-docs ENV DEF_TARGET_LIST=aarch64-linux-user,alpha-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sh4-linux-user,sparc64-linux-user """
Signature · 1 line
2.47.3
[PULL 08/13] tests/tcg/loongarch64/system: deactivate loongarch64-softmmu-memory (hang on aarch64 host)
In reply to Pierrick BouvierCreated associated issue:
https://gitlab.com/qemu-project/qemu/-/work_items/4567
--- tests/tcg/loongarch64/system/meson.build | 5 +++++ 1 file changed, 5 insertions(+)
tests/tcg/loongarch64/system/meson.build +5 -0
@@ -24,6 +24,11 @@ foreach t: tcg_tests['multiarch-softmmu']['tests'] new_cflags = cflags if fs.stem(src) == 'memory' new_cflags += '-DCHECK_UNALIGNED=0' + # TODO: memory test hangs on aarch64 host + # https://gitlab.com/qemu-project/qemu/-/work_items/4567 + if host_machine.cpu_family() == 'aarch64' and 'gdb_test' in setup + continue + endif endif if src not in multi_src setup += {'cflags': [new_cflags]}
Signature · 1 line
2.47.3
[PULL 12/13] tests/tcg: add alternative cross-compilers for fedora
In reply to Pierrick BouvierThis allows to pick host compiler automatically on fedora, as those binaries are installed with 'gcc' package.
This covers all host arch supported to this day:
https://fedoraproject.org/wiki/Architectures
- x86_64
- aarch64
- ppc64le
- riscv64
- s390x
Note: QEMU and Fedora don't support 32-bit hosts anymore.
--- tests/tcg/aarch64/meson.build | 2 ++ tests/tcg/aarch64/system/meson.build | 1 + tests/tcg/aarch64_be/meson.build | 1 + tests/tcg/ppc64le/meson.build | 1 + tests/tcg/riscv64/meson.build | 2 ++ tests/tcg/riscv64/system/meson.build | 1 + tests/tcg/s390x/meson.build | 2 ++ tests/tcg/s390x/system/meson.build | 1 + tests/tcg/x86_64/meson.build | 2 ++ tests/tcg/x86_64/system/meson.build | 1 + 10 files changed, 14 insertions(+)
tests/tcg/aarch64/meson.build +2 -0
@@ -1,4 +1,5 @@ cc = 'aarch64-linux-gnu-gcc' +cc_alt = ['aarch64-redhat-linux-gcc'] cc_dockerfile = 'debian-all-test-cross' cc_feat_cflags = {
@@ -196,6 +197,7 @@ if 'qemu-aarch64' in emulators tcg_tests += { 'aarch64-linux-user': { 'cc': cc, + 'cc_alt': cc_alt, 'cc_dockerfile': cc_dockerfile, 'cc_feat_cflags': cc_feat_cflags, 'folder': 'aarch64',
tests/tcg/aarch64/system/meson.build +1 -0
@@ -96,6 +96,7 @@ if 'qemu-system-aarch64' in emulators tcg_tests += { 'aarch64-softmmu': { 'cc': cc, + 'cc_alt': cc_alt, 'cc_dockerfile': cc_dockerfile, 'cc_feat_cflags': cc_feat_cflags, 'folder': 'aarch64/system',
tests/tcg/aarch64_be/meson.build +1 -0
@@ -10,6 +10,7 @@ if 'qemu-aarch64_be' in emulators tcg_tests += { 'aarch64_be-linux-user': { 'cc': 'aarch64-linux-gnu-gcc', + 'cc_alt': ['aarch64-redhat-linux-gcc'], 'cc_dockerfile': 'debian-all-test-cross', 'cc_feat_cflags': cc_feat_cflags, 'folder': 'aarch64_be',
tests/tcg/ppc64le/meson.build +1 -0
@@ -2,6 +2,7 @@ if 'qemu-ppc64le' in emulators tcg_tests += { 'ppc64le-linux-user': { 'cc': 'powerpc64le-linux-gnu-gcc', + 'cc_alt': ['ppc64le-redhat-linux-gcc'], 'cc_dockerfile': 'debian-all-test-cross', 'cc_feat_cflags': cc_feat_cflags, 'folder': 'ppc64le',
tests/tcg/riscv64/meson.build +2 -0
@@ -1,4 +1,5 @@ cc = 'riscv64-linux-gnu-gcc' +cc_alt = ['riscv64-redhat-linux-gnu-gcc'] cc_dockerfile = 'debian-all-test-cross' subdir('system')
@@ -26,6 +27,7 @@ if 'qemu-riscv64' in emulators tcg_tests += { 'riscv64-linux-user': { 'cc': cc, + 'cc_alt': cc_alt, 'cc_dockerfile': cc_dockerfile, 'folder': 'riscv64', 'gdb_arch': 'riscv64',
tests/tcg/riscv64/system/meson.build +1 -0
@@ -65,6 +65,7 @@ if 'qemu-system-riscv64' in emulators tcg_tests += { 'riscv64-softmmu': { 'cc': cc, + 'cc_alt': cc_alt, 'cc_dockerfile': cc_dockerfile, 'folder': 'riscv64', 'gdb_arch': 'riscv64',
tests/tcg/s390x/meson.build +2 -0
@@ -1,4 +1,5 @@ cc = 's390x-linux-gnu-gcc' +cc_alt = ['s390x-redhat-linux-gcc'] cc_dockerfile = 'debian-all-test-cross' cc_feat_cflags = {
@@ -140,6 +141,7 @@ if 'qemu-s390x' in emulators tcg_tests += { 's390x-linux-user': { 'cc': cc, + 'cc_alt': cc_alt, 'cc_dockerfile': cc_dockerfile, 'cc_feat_cflags': cc_feat_cflags, 'folder': 's390x',
tests/tcg/s390x/system/meson.build +1 -0
@@ -82,6 +82,7 @@ if 'qemu-system-s390x' in emulators tcg_tests += { 's390x-softmmu': { 'cc': cc, + 'cc_alt': cc_alt, 'cc_dockerfile': cc_dockerfile, 'cc_feat_cflags': cc_feat_cflags, 'folder': 's390x',
tests/tcg/x86_64/meson.build +2 -0
@@ -1,4 +1,5 @@ cc = 'x86_64-linux-gnu-gcc' +cc_alt = ['x86_64-redhat-linux-gcc'] cc_dockerfile = 'debian-amd64-cross' subdir('system')
@@ -72,6 +73,7 @@ if 'qemu-x86_64' in emulators tcg_tests += { 'x86_64-linux-user': { 'cc': cc, + 'cc_alt': cc_alt, 'cc_dockerfile': cc_dockerfile, 'folder': 'x86_64', 'gdb_arch': 'x86_64',
tests/tcg/x86_64/system/meson.build +1 -0
@@ -52,6 +52,7 @@ if 'qemu-system-x86_64' in emulators tcg_tests += { 'x86_64-softmmu': { 'cc': cc, + 'cc_alt': cc_alt, 'cc_dockerfile': cc_dockerfile, 'folder': 'x86_64/system', 'gdb_arch': 'x86_64',
Signature · 1 line
2.47.3
[PULL 02/13] tests/docker/dockerfiles/debian-loongarch-cross: update toolchain
In reply to Pierrick BouvierThe previous toolchain was embedding full libc when doing static linking for tcg-tests. As a result, each binary was 4MB is size. With updated toolchain, only needed functions are linked, thus reducing binary size.
As a result, we save ~140MB of disk space for tcg-tests.
--- tests/docker/dockerfiles/debian-loongarch-cross.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/docker/dockerfiles/debian-loongarch-cross.docker +1 -1
@@ -37,7 +37,7 @@ RUN apt-get update && \ python3-wheel && \ dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt -RUN curl -#SL https://github.com/loongson/build-tools/releases/download/2023.08.08/CLFS-loongarch64-8.1-x86_64-cross-tools-gcc-glibc.tar.xz \ +RUN curl -#SL https://github.com/loongson/build-tools/releases/download/2025.08.08/x86_64-cross-tools-loongarch64-binutils_2.45-gcc_15.1.0-glibc_2.42.tar.xz \ | tar -xJC /opt ENV PATH=$PATH:/opt/cross-tools/bin
Signature · 1 line
2.47.3
[PULL 04/13] tests/tcg/meson.build: force use of linux/amd64 platform for containers
In reply to Pierrick BouvierOn hosts != x64_64, we detect if host can run amd64 containers (usually through qemu-user-binfmt). If not, we deactivate container support.
We could technically stop here and force container engine to use this platform. Since existing base image (docker.io/library/debian:13-slim) is multi platforms, container engine will enable this variant by default.
Now the problem is that if user reuses this image for their own Dockerfiles, they will run into unpleasant surprise that now, their container engine is using x86_64 variant by default, on any host.
So, in next commit, we'll change base image we use to x86_64 variant, which has a single platform: linux/amd64. This ensures we don't generate any unwanted side effect when building our images.
--- tests/tcg/meson.build | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
tests/tcg/meson.build +17 -5
@@ -81,6 +81,7 @@ tcg_tests_summary += {'gdb': gdb} docker_supported = false container_command = false +docker_platform = ['--platform', 'linux/amd64'] if get_option('containers') if get_option('container_command') != '' # make sure command is working
@@ -99,6 +100,18 @@ if get_option('containers') container_command] endif endif + + if docker_supported + # Check that x86_64 containers can be executed. It implies xthat 86_64 + # binaries can be executed. On host with a different architecture, + # this is usually achieved with qemu-user-binfmt. + docker_supported = run_command([docker_wrapper, 'run', '--', + docker_platform, + 'docker.io/amd64/debian:13-slim', + '/bin/true'], + check: false).returncode() == 0 + tcg_tests_summary += {'x86_64 container support': docker_supported} + endif endif tcg_tests_summary += {'container command': container_command} if get_option('container_registry') != ''
@@ -253,13 +266,11 @@ foreach target, plan: tcg_tests target + ' (possible: [' + ', '.join(allowed) + '])') endif endforeach - docker_host_arch_supported = host_machine.cpu_family() in cc_docker_host_arch dockerfile = files('..'/'docker'/'dockerfiles'/cc_dockerfile + '.docker') image_name = 'image-' + cc_dockerfile - has_docker = docker_host_arch_supported and docker_supported - if cc_dockerfile not in image_targets and has_docker + if cc_dockerfile not in image_targets and docker_supported cmd = [docker_wrapper, 'build', '-f', dockerfile, '-t', 'qemu/' + cc_dockerfile, - '--add-current-user'] + docker_platform, '--add-current-user'] if get_option('container_registry') != '' cmd += ['--registry', get_option('container_registry')] endif
@@ -270,7 +281,7 @@ foreach target, plan: tcg_tests image_targets += {cc_dockerfile: t} endif - if not has_cc and has_docker + if not has_cc and docker_supported build_test_depends += image_targets[cc_dockerfile] build_test_depend_files += dockerfile mount = meson.project_source_root()
@@ -279,6 +290,7 @@ foreach target, plan: tcg_tests cc = [docker_wrapper, 'run', '--run-as-current-user', '--', # SELinux blocks modification of host fs by default '--security-opt', 'label=disable', + docker_platform, '-w', here, '-v', here + ':' + here, '-v', mount, 'qemu/' + cc_dockerfile, plan['cc']] has_cc = true
Signature · 1 line
2.47.3
Richard Henderson
AppliedQuoted 21 lines · Pierrick Bouvier
The following changes since commit
80c1d80c10a0676728d65874a9641eb578626d7c:Merge tag 'pull-hex-20260924' ofhttps://github.com/qualcomm/qemu into staging (2026-09-24 19:35:55 -0700)are available in the Git repository at:
https://gitlab.com/p-b-o/qemu tags/pbouvier/pr/tcg-tests-20260925for you to fetch changes up to
2ed098a7f2549781fc06e5228bf1fddcaf402db1:tests/tcg: add alternative cross-compilers for macos (homebrew) (2026-09-25 17:04:17 +0000)----------------------------------------------------------------
Changes:
- [PATCH] tests/tcg/meson.build: reintroduce build-tcg target (Pierrick Bouvier<[email protected]>)[email protected]
- [PATCH] tests/docker/dockerfiles/debian-loongarch-cross: update (Pierrick Bouvier<[email protected]>)[email protected]
- [PATCH] tests/tcg/meson.build: compile test with -fno-stack-protector (Pierrick Bouvier<[email protected]>)
Quoted 8 lines
[email protected]
- [PATCH v2 0/6] tests/tcg: usex86_64cross containers on all host (Pierrick Bouvier<[email protected]>)[email protected]
- [PATCH 0/4] tests/tcg/meson.build: detect additional cross compilers (Pierrick Bouvier<[email protected]>)
Applied, thanks.
r~