Navigation Menu

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

cmd/compile: some x/sys versions no longer build due to "go:linkname must refer to declared function or variable" [1.18 backport] #56556

Closed
gopherbot opened this issue Nov 3, 2022 · 2 comments
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@mdempsky requested issue #55889 to be considered for backport to the next 1.18 minor release.

@gopherbot Please backport to Go 1.18 and 1.19. This was is regression in the Go compiler, which broke building x/sys for GOOS=darwin prior to https://go.dev/cl/274573 (golang/sys@69691e4).

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Nov 3, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 3, 2022
@gopherbot gopherbot added this to the Go1.18.9 milestone Nov 3, 2022
@gopherbot
Copy link
Author

Change https://go.dev/cl/447815 mentions this issue: [release-branch.go1.18] cmd/compile: allow ineffectual //go:linkname in -lang=go1.17 and older

@mknyszek mknyszek added the CherryPickApproved Used during the release process for point releases label Nov 9, 2022
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Nov 9, 2022
@gopherbot
Copy link
Author

Closed by merging d2a7a18 to release-branch.go1.18.

gopherbot pushed a commit that referenced this issue Nov 9, 2022
…in -lang=go1.17 and older

Prior to Go 1.18, ineffectual //go:linkname directives (i.e.,
directives referring to an undeclared name, or to a declared type or
constant) were treated as noops. In Go 1.18, we changed this into a
compiler error to mitigate accidental misuse.

However, the x/sys repo contained ineffectual //go:linkname directives
up until go.dev/cl/274573, which has caused a lot of user confusion.

It seems a bit late to worry about now, but to at least prevent
further user pain, this CL changes the error message to only apply to
modules using "go 1.18" or newer. (The x/sys repo declared "go 1.12"
at the time go.dev/cl/274573 was submitted.)

For #55889.
Fixes #56556.

Change-Id: Id762fff96fd13ba0f1e696929a9e276dfcba2620
Reviewed-on: https://go-review.googlesource.com/c/go/+/447755
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/447815
@golang golang locked and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

2 participants