Skip to content

[PPC64LE] Add PPC64LE platform support (interpreter-only)#3591

Merged
ksco merged 1 commit intoptitSeb:mainfrom
runlevel5:ppc64le-pr1-platform
Feb 28, 2026
Merged

[PPC64LE] Add PPC64LE platform support (interpreter-only)#3591
ksco merged 1 commit intoptitSeb:mainfrom
runlevel5:ppc64le-pr1-platform

Conversation

@runlevel5
Copy link
Contributor

Summary

Add PPC64LE (POWER8+ little-endian) platform support for box64 in interpreter-only mode. This is the first of a series of incremental PRs to bring PPC64LE support to box64, split from the original #3563 based on review feedback.

This PR contains only platform support infrastructure — no dynarec code.

Changes (19 files, ~148 lines)

Build System & CI

  • CMakeLists.txt: Add PPC64LE detection, -fno-stack-protector for static builds (glibc TLS canary uses r13)
  • .github/workflows/release.yml: Add PPC64LE to CI matrix

Host Detection

  • src/build_info.h: Add PPC64LE build info string
  • src/tools/env.c: Add PPC64LE environment detection
  • src/include/hostext.h, src/os/hostext_linux.c, src/os/hostext_common.c: Host extension detection stubs

Signal Handling

  • src/include/sigtools.h, src/libtools/signals.c, src/libtools/signal32.c, src/libtools/sigtools.c: PPC64LE signal context handling (ucontext_t, register access)

Core Infrastructure

  • src/emu/x64emu_private.h: Add xSPSave/old_savedsp fields (PPC64LE has no spare callee-saved register for xSavedSP)
  • src/emu/x64runf0.c, src/include/box64context.h: CMPXCHG16B mutex path (PPC64LE pre-POWER10 lacks 128-bit LL/SC)

Wrapped Libraries

  • src/wrapped/wrappedldlinux.c, src/wrapped/wrappedldlinux_private.h: PPC64LE ld-linux path
  • src/wrapped/wrappedlibc.c, src/wrapped32/wrappedlibc.c: O_LARGEFILE = 0200000 for PPC64LE
  • src/wrapped/generated/functions_list.txt: Updated function list

Testing

This PR enables box64 to build and run on PPC64LE in interpreter-only mode. The dynarec infrastructure will follow in a separate PR.

Related

Add PPC64LE (POWER9+, little-endian) as a recognized platform for
interpreter-only builds. No dynarec code is included yet.

Platform support:
- Build system: CMakeLists.txt cross-compiler setup, CPACK, CONFIG_64BIT
- CI: GitHub Actions matrix with qemu-ppc64le-static testing
- Host CPU feature detection (CRYPTO, DARN, ISA 3.1, MMA)
- Signal handling for PPC64LE (xSPSave/old_savedsp, context registers)
- O_LARGEFILE conversion (PPC64LE uses 0200000)
- Static build: -fno-stack-protector (glibc uses TLS-based canary via r13)
- __stack_chk_guard guard for PPC64LE static builds
- Wrapper generator PPC64LE support
@ptitSeb ptitSeb requested a review from ksco February 28, 2026 13:43
@ptitSeb
Copy link
Owner

ptitSeb commented Feb 28, 2026

LGTM

Copy link
Collaborator

@ksco ksco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too, thank you!

@ksco ksco merged commit 1c5d1f5 into ptitSeb:main Feb 28, 2026
30 checks passed
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.

3 participants