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: investigate more robust builtin.go mechanism #14482

Closed
mdempsky opened this issue Feb 23, 2016 · 3 comments
Closed

cmd/compile: investigate more robust builtin.go mechanism #14482

mdempsky opened this issue Feb 23, 2016 · 3 comments

Comments

@mdempsky
Copy link
Member

The package runtime export data embedded into the compiler via builtin.go intentionally differs from package runtime's actual export data. This works because builtin.go's and runtime.a's export data do not overlap, so cmd/compile never notices that builtin.go does not actually match package runtime.

Commit f28bbb7 was reverted (9877900) because it increased the amount of differing export data provided by builtin.go. In isolation, this isn't problematic. But @aclements discovered that adding a sel *hselect field to runtime.sudog caused runtime.a to start exporting a type definition for runtime.scase, which the compiler then did complain about not matching the scase type definition from builtin.go.

Making builtin.go match runtime.a 100% is one possible option, but it's non-trivial because it involves pulling in a lot more types. It would also require builtin.go's package runtime to start using package unsafe (for unsafe.Pointer), which leads to its own problems because it's supposed to be a "safe" package.

This CL is about investigating ways to make cmd/compile more robust against conflicts between builtin.go and runtime.a.

@bradfitz bradfitz added this to the Unplanned milestone Feb 23, 2016
@mdempsky mdempsky self-assigned this Feb 23, 2016
@gopherbot
Copy link

CL https://golang.org/cl/19858 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/37538 mentions this issue.

@mdempsky
Copy link
Member Author

mdempsky commented Mar 1, 2017

Another more recent instance of this problem: #19185

@golang golang locked and limited conversation to collaborators Mar 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants