-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
There are a lot of //go:linkname directives in macOS packages that don't do anything. We should remove them.
To elaborate, a directive like //go:linkname foo bar sets the Go variable or function named foo to use bar as its linker symbol (instead of mypkgpath.foo, like it would normally use). But if there's no Go variable or function named foo, it just silently doesn't do anything.
In CL 273986 (2d6ff99), I removed the occurrences within the standard library, but there are more in the vendored x/sys package that need to be fixed. There might be more instances in other repos too.
To test for problems, you can checkout the dev.regabi branch; revert CL 274732 (42e46f4); and then build packages like golang.org/x/sys/unix w/ various GOOS/GOARCH combinations.