purego: add support for s390x#413
Merged
hajimehoshi merged 5 commits intoebitengine:mainfrom Feb 16, 2026
Merged
Conversation
hajimehoshi
reviewed
Feb 9, 2026
Contributor
There was a problem hiding this comment.
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.
hajimehoshi
reviewed
Feb 9, 2026
hajimehoshi
approved these changes
Feb 9, 2026
Member
hajimehoshi
left a comment
There was a problem hiding this comment.
LGTM
@TotallyGamerJet PTAL
hajimehoshi
reviewed
Feb 15, 2026
hajimehoshi
reviewed
Feb 15, 2026
hajimehoshi
reviewed
Feb 16, 2026
hajimehoshi
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.