darwin: replace custom syscall package with Go native syscall package

This required a few compiler and runtime tricks to work, but I ran a
bunch of tests and it seems fine. (CI will of course do more exhaustive
testing).

The main benefit here is that we don't need to maintain the darwin
version of the syscall package, and reduce extra risks for bugs (because
we reuse the well-tested syscall package). For example, Go 1.23 needed a
bunch of new constants in the syscall package. That would have been
avoided if we had used the native syscall package on MacOS.
This commit is contained in:
Ayke van Laethem
2024-08-18 19:33:04 +02:00
committed by Ron Evans
parent 753f4b38b4
commit 105fe9b25d
19 changed files with 229 additions and 531 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ func listGorootMergeLinks(goroot, tinygoroot string, overrides map[string]bool)
// with the TinyGo version. This is the case on some targets.
func needsSyscallPackage(buildTags []string) bool {
for _, tag := range buildTags {
if tag == "baremetal" || tag == "darwin" || tag == "nintendoswitch" || tag == "tinygo.wasm" {
if tag == "baremetal" || tag == "nintendoswitch" || tag == "tinygo.wasm" {
return true
}
}