Skip to content

Darwin: linker could not find symbol _syscall.Syscall #4794

Open
@Tryanks

Description

@Tryanks

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"
)

func main() {
	// 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  

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmacOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions