Open
Conversation
58ff8c4 to
5c0b584
Compare
hajimehoshi
reviewed
Feb 4, 2026
Contributor
Author
|
@hajimehoshi updated PTAL |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive support for the PPC64LE (64-bit PowerPC Little-Endian) architecture to the purego library, enabling it to work on Linux PPC64LE systems with both CGO enabled and disabled.
Changes:
- Added PPC64LE-specific assembly implementations for syscalls and callbacks following the ELFv2 ABI
- Implemented PPC64LE struct marshaling with homogeneous float aggregate support
- Added fakecgo trampolines and ABI transition macros for PPC64LE
- Updated all build tags, tests, documentation, and CI/CD to include PPC64LE support
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| zcallback_ppc64le.s | Generated callback trampoline table (2000 entries) |
| wincallback.go | Added generator function for PPC64LE callback trampolines |
| syscall_sysv_ppc64le.go | PPC64LE-specific callbackArgs with separate stack pointer |
| syscall_sysv_others.go | Refactored common callbackArgs for other architectures |
| syscall_sysv.go | Added PPC64LE stack args handling and updated build tags |
| syscall_cgo_linux.go | Updated CGO fallback build tag to include PPC64LE |
| sys_unix_ppc64le.s | Callback assembly following ELFv2 ABI with 200-byte frame |
| sys_ppc64le.s | Syscall15X implementation with proper register/stack marshaling |
| struct_ppc64le.go | Struct handling with HFA detection and 16-byte threshold |
| internal/fakecgo/trampolines_ppc64le.s | CGO-to-Go trampolines for runtime integration |
| internal/fakecgo/asm_ppc64le.s | crosscall2 implementation saving GPR/FPR registers |
| internal/fakecgo/abi_ppc64x.h | ABI transition macros for register save/restore |
| abi_ppc64x.h | Duplicate of fakecgo header for main package |
| internal/cgo/syscall_cgo_unix.go | Updated build tag exclusion list |
| func_test.go | Added PPC64LE to test skips for float32 stack args |
| callback_test.go | Updated build tag to include PPC64LE |
| func.go | Added PPC64LE float32 return handling and register counts |
| README.md | Added PPC64LE to Tier 2 platform list |
| .github/workflows/test.yml | Added PPC64LE cross-compilation and QEMU testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hajimehoshi
approved these changes
Feb 5, 2026
Member
hajimehoshi
left a comment
There was a problem hiding this comment.
LGTM
@TotallyGamerJet PTAL
TotallyGamerJet
approved these changes
Feb 7, 2026
| // Below are out-args from callbackWrap | ||
| result uintptr | ||
| } | ||
| // callbackArgs is implemented in syscall_sysv_others.go and syscall_sysv_ppc64le.go |
Collaborator
There was a problem hiding this comment.
Remove this comment since its clear from where the type definition is
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 issue is this addressing?
closes #407
What type of issue is this addressing?
feature
What this PR does | solves
This PR adds the neccessary code logic to support PPC64LE with both CGO enabled/disabled