Skip to content

purego: add support for s390x#413

Merged
hajimehoshi merged 5 commits intoebitengine:mainfrom
gdams:s390x
Feb 16, 2026
Merged

purego: add support for s390x#413
hajimehoshi merged 5 commits intoebitengine:mainfrom
gdams:s390x

Conversation

@gdams
Copy link
Contributor

@gdams gdams commented Feb 9, 2026

What type of issue is this addressing?

feature

What this PR does | solves

Implements the necessary changes to support linux/s390x (with CGO_ENABLED=1).

For now we can't support without cgo until golang/go#77449 has been addressed although I have a CL to implement the required changes.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds initial Linux/s390x support to the purego syscall + callback machinery (with CGO-enabled execution in CI), extending the existing multi-arch SysV implementation with s390x-specific assembly, struct handling, and a new CI job to exercise it under QEMU.

Changes:

  • Add s390x syscall/callback assembly implementations and struct (aggregate) argument/return support.
  • Extend build tags / runtime arch handling to include s390x (callback trampoline sizing, register counts, float32 handling).
  • Add a GitHub Actions job to cross-compile and run tests for linux/s390x under QEMU.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
zcallback_s390x.s Adds generated callback trampoline table for s390x.
wincallback.go Extends generator to emit the s390x trampoline table.
syscall_sysv_stackArgs.go Enables stackArgs-based callback argument handling for s390x.
syscall_sysv.go Enables SysV path for linux/s390x and defines callback entry sizing.
syscall_cgo_linux.go Updates unsupported-arch guard list and panic message to include s390x.
sys_unix_s390x.s Implements s390x callbackasm1 ABI bridge into Go.
sys_s390x.s Implements s390x syscall15X ABI bridge for RegisterFunc calls.
struct_s390x.go Adds s390x small-aggregate (<=16B) struct argument/return handling.
internal/fakecgo/asm_s390x.s Adds fakecgo crosscall2 for s390x.
func_test.go Updates arch gating/skips to include s390x.
func.go Adds s390x register counts and float32 packing/return handling.
callback_test.go Enables callback tests on s390x with one test skipped for arg-count limits.
README.md Documents linux/s390x as a Tier 2 platform.
.github/workflows/test.yml Adds a linux/s390x test job using cross-compiler + QEMU.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gdams gdams requested a review from hajimehoshi February 9, 2026 13:20
Copy link
Member

@hajimehoshi hajimehoshi left a comment

Choose a reason for hiding this comment

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

LGTM

@TotallyGamerJet PTAL

Copy link
Collaborator

@TotallyGamerJet TotallyGamerJet left a comment

Choose a reason for hiding this comment

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

LGTM

@hajimehoshi hajimehoshi merged commit 585a4c5 into ebitengine:main Feb 16, 2026
46 checks passed
@gdams gdams deleted the s390x branch February 16, 2026 09:25
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

Comments