Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mdempsky opened this issue Dec 2, 2020 · 2 comments
Open

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

mdempsky opened this issue Dec 2, 2020 · 2 comments

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Dec 2, 2020

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.

@mdempsky mdempsky added the NeedsFix label Dec 2, 2020
@mdempsky mdempsky added this to the Go1.17 milestone Dec 2, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 2, 2020

Change https://golang.org/cl/274732 mentions this issue: [dev.regabi] cmd/compile: comment out //go:linkname warning

gopherbot pushed a commit that referenced this issue Dec 2, 2020
It's noisy and not doing any harm, and we still have an entire release
cycle to revisit and address the issue properly.

Updates #42938

Change-Id: I1de5cfb495a8148c9c08b215deba38f2617fb467
Reviewed-on: https://go-review.googlesource.com/c/go/+/274732
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 2, 2020

Change https://golang.org/cl/274573 mentions this issue: unix: remove ineffectual //go:linkname directives

gopherbot pushed a commit to golang/sys that referenced this issue Dec 2, 2020
For golang/go#42938

Change-Id: I9d68a2436f3ce7402b3c6517a630d0272cf39071
Reviewed-on: https://go-review.googlesource.com/c/sys/+/274573
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.