You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot call the syscall.Syscall() method on MacOS.
System Version: MacOS 15.3.1 (24D70)
Go Version: 1.24.1
Tinygo Version: 0.36.0
Minimal reproducible code:
package main
import (
"syscall"
)
funcmain() {
// Only building is required, not executing them, so this line of code can be used for issue reproduction.syscall.Syscall(0, 0, 0, 0)
}
Compilation passes with the command go build; compilation also passes with GOOS=linux tinygo build.
However, compilation fails when directly using tinygo build on MacOS:
❯ tinygo build
main.go:8: linker could not find symbol _syscall.Syscall
Additional information: This also leads to the following issues:
Package golang.org/x/sys reports an error:
golang.org/x/sys@v0.31.0/unix/zsyscall_darwin_arm64.go:734: linker could not find symbol _golang.org/x/sys/unix.syscall_syscall
Package modernc.org/memory reports an error:
modernc.org/memory@v1.8.2/mmap_unix.go:25: linker could not find symbol _syscall.Syscall
The text was updated successfully, but these errors were encountered:
Raw syscalls are not supported on MacOS, and are not documented as far as I know. Go used to use these raw syscalls, but switched to using the system libc instead that are supported. TinyGo also uses the system libc (and not raw syscalls) for the same reason.
If you look at modernc.org/memory for example, you'll see this:
This uses the unsupported raw syscalls. They might still work in standard Go, but can break at any time Apple decides to change these syscalls.
I think the best solution here would be for the modernc.org/memory package to use syscall.Mmap instead.
As for golang.org/x/sys, that's probably a genuine bug in TinyGo. I'll need to look into it.
Cannot call the
syscall.Syscall()
method on MacOS.Minimal reproducible code:
Compilation passes with the command
go build
; compilation also passes withGOOS=linux tinygo build
.However, compilation fails when directly using
tinygo build
on MacOS:Additional information: This also leads to the following issues:
Package
golang.org/x/sys
reports an error:Package
modernc.org/memory
reports an error:The text was updated successfully, but these errors were encountered: