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:
Ayke van Laethem
2022-02-15 14:29:44 +01:00
committed by Ron Evans
parent af6bbaf532
commit 7a5d4c9537
3 changed files with 27 additions and 0 deletions
+17
View File
@@ -1,7 +1,12 @@
#ifdef __MACH__
.global _tinygo_startTask
_tinygo_startTask:
#else
.section .text.tinygo_startTask
.global tinygo_startTask
.type tinygo_startTask, %function
tinygo_startTask:
#endif
.cfi_startproc
// Small assembly stub for starting a goroutine. This is already run on the
// new stack, with the callee-saved registers already loaded.
@@ -23,13 +28,25 @@ tinygo_startTask:
blr x19
// After return, exit this goroutine. This is a tail call.
#ifdef __MACH__
b _tinygo_pause
#else
b tinygo_pause
#endif
.cfi_endproc
#ifndef __MACH__
.size tinygo_startTask, .-tinygo_startTask
#endif
#ifdef __MACH__
.global _tinygo_swapTask
_tinygo_swapTask:
#else
.global tinygo_swapTask
.type tinygo_swapTask, %function
tinygo_swapTask:
#endif
// This function gets the following parameters:
// x0 = newStack uintptr
// x1 = oldStack *uintptr