internal/fakecgo: generalize and update trampoline generation#397
internal/fakecgo: generalize and update trampoline generation#397gdams wants to merge 3 commits intoebitengine:mainfrom
Conversation
|
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 |
|
Ehh I'm not confident that templating callbacks.go is really necessary. I rather wait until it gets uncomfortably large and then consider it |
Shall I revert the callback changes then and just leave the trampolines? |
Yes, I'm still trying to figure out how I feel about the trampoline generation. If we can't generate the entire file I'm leaning to not doing it at all because then it becomes confusing if changes should be made to the static trampoline file or the generated one |
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
Updates
gen.goto generate trampolines forarm,arm64,loong64, andriscv64,386alongsideamd64.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