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/go: "internal/abi" needs to be compiled with "-+" #45144

Closed
mdempsky opened this issue Mar 20, 2021 · 1 comment
Closed

cmd/go: "internal/abi" needs to be compiled with "-+" #45144

mdempsky opened this issue Mar 20, 2021 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@mdempsky
Copy link
Member

Packages that package runtime depends on are supposed to be compiled with -+ so the compiler knows to do some runtime-specific behavior. cmd/go has a hard-coded list of known packages that runtime depends on, but this wasn't updated when "internal/abi" was added:

compilingRuntime := p.Standard && (p.ImportPath == "runtime" || strings.HasPrefix(p.ImportPath, "runtime/internal"))
// The runtime package imports a couple of general internal packages.
if p.Standard && (p.ImportPath == "internal/cpu" || p.ImportPath == "internal/bytealg") {
compilingRuntime = true
}
if compilingRuntime {
// runtime compiles with a special gc flag to check for
// memory allocations that are invalid in the runtime package,
// and to implement some special compiler pragmas.
gcargs = append(gcargs, "-+")
}

We should update the list, and add a test to make sure they don't fall out of sync again in the future.

Alternatively, cmd/go can just use its knowledge of which packages runtime depends on.

/cc @bcmills @mknyszek

@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 20, 2021
@mdempsky mdempsky added this to the Go1.17 milestone Mar 20, 2021
@gopherbot
Copy link

Change https://golang.org/cl/306289 mentions this issue: go/src/cmd/go/internal/work: compile "internal/abi" with "-+"

@golang golang locked and limited conversation to collaborators Apr 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants