mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
darwin: add support for arm64 GOARCH (aka Apple Silicon)
This patch adds support for generating GOOS=darwin GOARCH=arm64 binaries. This means that it will become possible to run `go test` on recent Macs, for example.
This commit is contained in:
committed by
Ron Evans
parent
af6bbaf532
commit
7a5d4c9537
@@ -1,7 +1,12 @@
|
||||
#ifdef __MACH__
|
||||
.global _tinygo_scanCurrentStack
|
||||
_tinygo_scanCurrentStack:
|
||||
#else
|
||||
.section .text.tinygo_scanCurrentStack
|
||||
.global tinygo_scanCurrentStack
|
||||
.type tinygo_scanCurrentStack, %function
|
||||
tinygo_scanCurrentStack:
|
||||
#endif
|
||||
// Sources:
|
||||
// * https://developer.arm.com/architectures/learn-the-architecture/armv8-a-instruction-set-architecture/procedure-call-standard
|
||||
// * https://godbolt.org/z/qrvrEh
|
||||
@@ -16,7 +21,11 @@ tinygo_scanCurrentStack:
|
||||
|
||||
// Scan the stack.
|
||||
mov x0, sp
|
||||
#ifdef __MACH__
|
||||
bl _tinygo_scanstack
|
||||
#else
|
||||
bl tinygo_scanstack
|
||||
#endif
|
||||
|
||||
// Restore stack state and return.
|
||||
ldp x29, x30, [sp], #96
|
||||
|
||||
Reference in New Issue
Block a user