Skip to content

(master) ci: native build lanes for foreign CPU architectures via QEMU user-mode - #3491

Merged
metux merged 1 commit into
masterfrom
pr/master-ci-native-build-lanes-for-foreign-cpu-architectures-via-qemu-user-mode_2026-08-06_13-50-15
Aug 8, 2026
Merged

(master) ci: native build lanes for foreign CPU architectures via QEMU user-mode#3491
metux merged 1 commit into
masterfrom
pr/master-ci-native-build-lanes-for-foreign-cpu-architectures-via-qemu-user-mode_2026-08-06_13-50-15

Conversation

@metux

@metux metux commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The compiler.h arch-specific inline-asm branches (alpha, sparc,
arm32, mips, powerpc) were never compiled by the x86_64-host
lanes, which is why the missing-" trailing ;" bugs in PR #3484/#3485 went
unnoticed. Add a matrix lane (ppc64el/armhf/mipsel/sparc64/alpha) that runs
the real target-arch gcc under QEMU user-mode emulation.

Approach (no cross toolchain):

  • debootstrap a foreign-arch Debian rootfs (--foreign + --second-stage)
  • run qemu--static as the ELF interpreter via binfmt_misc
  • build natively inside the chroot; arch-specific asm is genuinely assembled
  • apt installs the target-arch X11 -dev deps (no hand-built cross prereqs)

Official Debian ports (ppc64el/armhf/mipsel) use bookworm + deb.debian.org;
sparc64/alpha live in debian-ports (unstable). qemu-user-static,
binfmt-support, debootstrap and the ports keyring come from apt.

Files:

  • .github/scripts/qemu/run-qemu-build.sh (generic driver, host + chroot side)
  • .github/workflows/build-xserver.yml (xserver-build-qemu-user matrix job)

@metux metux self-assigned this Aug 6, 2026
@metux
metux requested a review from a team August 6, 2026 11:52
metux added a commit that referenced this pull request Aug 6, 2026
…EMU user-mode

The compiler.h arch-specific inline-asm branches (__alpha__, __sparc__,
__arm32__, __mips__, __powerpc__) were never compiled by the x86_64-host
lanes, which is why the missing-" trailing ;" bugs in PR #3484/#3485 went
unnoticed. Add a matrix lane (ppc64el/armhf/mipsel/sparc64/alpha) that runs
the *real* target-arch gcc under QEMU user-mode emulation.

Approach (no cross toolchain):
- debootstrap a foreign-arch Debian rootfs (--foreign + --second-stage)
- run qemu-<arch>-static as the ELF interpreter via binfmt_misc
- build natively inside the chroot; arch-specific asm is genuinely assembled
- apt installs the target-arch X11 -dev deps (no hand-built cross prereqs)

Official Debian ports (ppc64el/armhf/mipsel) use bookworm + deb.debian.org;
sparc64/alpha live in debian-ports (unstable). qemu-user-static,
binfmt-support, debootstrap and the ports keyring come from apt.

Files:
- .github/scripts/qemu/run-qemu-build.sh (generic driver, host + chroot side)
- .github/workflows/build-xserver.yml (xserver-build-qemu-user matrix job)

PR: #3491
@metux
metux force-pushed the pr/master-ci-native-build-lanes-for-foreign-cpu-architectures-via-qemu-user-mode_2026-08-06_13-50-15 branch from 1d9b93f to f0dcd99 Compare August 6, 2026 11:54
@stefan11111

Copy link
Copy Markdown
Contributor

@metux I guess it's better that nothing, but we can't assume that what happens in qemu also happens on bare metal.

@metux
metux force-pushed the pr/master-ci-native-build-lanes-for-foreign-cpu-architectures-via-qemu-user-mode_2026-08-06_13-50-15 branch from f0dcd99 to 2ebe1e4 Compare August 6, 2026 12:23
metux added a commit that referenced this pull request Aug 6, 2026
…EMU user-mode

The compiler.h arch-specific inline-asm branches (__alpha__, __sparc__,
__arm32__, __mips__, __powerpc__) were never compiled by the x86_64-host
lanes, which is why the missing-" trailing ;" bugs in PR #3484/#3485 went
unnoticed. Add a matrix lane (ppc64el/armhf/mipsel/sparc64/alpha) that runs
the *real* target-arch gcc under QEMU user-mode emulation.

Approach (no cross toolchain):
- debootstrap a foreign-arch Debian rootfs (--foreign + --second-stage)
- run qemu-<arch>-static as the ELF interpreter via binfmt_misc
- build natively inside the chroot; arch-specific asm is genuinely assembled
- apt installs the target-arch X11 -dev deps (no hand-built cross prereqs)

Official Debian ports (ppc64el/armhf/mipsel) use bookworm + deb.debian.org;
sparc64/alpha live in debian-ports (unstable). qemu-user-static,
binfmt-support, debootstrap and the ports keyring come from apt.

Files:
- .github/scripts/qemu/run-qemu-build.sh (generic driver, host + chroot side)
- .github/workflows/build-xserver.yml (xserver-build-qemu-user matrix job)

PR: #3491
@metux
metux force-pushed the pr/master-ci-native-build-lanes-for-foreign-cpu-architectures-via-qemu-user-mode_2026-08-06_13-50-15 branch 2 times, most recently from 27d8a2e to 2f0ee12 Compare August 7, 2026 12:10
@metux

metux commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@metux I guess it's better that nothing, but we can't assume that what happens in qemu also happens on bare metal.

sure, but at least can do build tests. runtime-tests would probably limited to simple framebuffer / vga.

@metux
metux force-pushed the pr/master-ci-native-build-lanes-for-foreign-cpu-architectures-via-qemu-user-mode_2026-08-06_13-50-15 branch 6 times, most recently from 9f6a078 to 4b06d1e Compare August 8, 2026 12:06
Add CI build lanes for ppc64el, armhf, mipsel (Debian bookworm) and
sparc64, alpha (Debian-ports unstable) using QEMU user-mode emulation
with debootstrap rootfs.

The lanes run the real target-architecture gcc under qemu-user-static,
so arch-specific inline asm (include/compiler.h, include/xlibre_membarrier.h)
is genuinely compiled and tested — the x86_64-host lanes never exercise
these code paths (the __asm__ "missing trailing ;" bugs in PR #3484/#3485
were invisible to every existing lane).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
@metux
metux force-pushed the pr/master-ci-native-build-lanes-for-foreign-cpu-architectures-via-qemu-user-mode_2026-08-06_13-50-15 branch from 4b06d1e to ccce890 Compare August 8, 2026 12:09
@metux
metux merged commit 5102fcb into master Aug 8, 2026
@metux
metux deleted the pr/master-ci-native-build-lanes-for-foreign-cpu-architectures-via-qemu-user-mode_2026-08-06_13-50-15 branch August 8, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants