-
Notifications
You must be signed in to change notification settings - Fork 101
internal/fakecgo: generalize and update trampoline generation #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Updates `gen.go` to generate trampolines for `arm64`, `loong64`, and `riscv64` alongside `amd64`. Changes include: - Added architecture definitions for additional platforms. - Simplified instruction generation: removed custom `CallFormat` in favor of a standard `CALL` instruction which works across the supported architectures (including simplified syntax for loong64 and riscv64). - Updated build constraints in generated files to `!cgo` only, relying on file naming conventions (`ztrampolines_$GOARCH.s`) for architecture selection. - Regenerated `ztrampolines_*.s` files to reflect these changes. internal/fakecgo: generalize and update trampoline generation
|
Interesting, but does this change mean our |
The approach hasn't changed, it's just that the linknames and the variable declarations have been moved into another file. It's true that some comments are lost in the process, although those comments are copied verbatim from upstream, so one can look there to understand what's happening. The only comment that should be kept (in my opinion) is the one that is specific to purego, the one that start with |
|
Note that this not only simplifies adding and maintaining architectures, but will also be used as part of the #343 fix. |
|
My concern was this would make it harder to synchronize callbacks.go and other files with the original ones. Even in the current situation, |
Happy to revert the |
Updates
gen.goto generate trampolines forarm64,loong64, andriscv64alongsideamd64.What issue is this addressing?
What type of issue is this addressing?
feature
What this PR does | solves
CALLinstruction which works across the supported architectures (including simplified syntax for loong64 and riscv64).!cgoonly, relying on file naming conventions (ztrampolines_$GOARCH.s) for architecture selection.ztrampolines_*.sfiles to reflect these changes. internal/fakecgo: generalize and update trampoline generation