Skip to content

all: cleanup ineffectual //go:linkname directives #42938

@mdempsky

Description

@mdempsky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.SuggestedIssues that may be good for new contributors looking for work to do.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions