-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/cgo: pass explicit -O0 to compiler #26487
Comments
Because of copyright reasons I don't particularly want to look at a patch that has not gone through the review process. If the original author wants to send in the patch, that would be great. Otherwise, I take the problem to be that on some Linux distros the compiler defaults to |
Yes, you've summarized the problem perfectly. Hopefully @jcvenegas will chime in. |
Do we know which distros this happens on? Is there a rule to check by? |
@oryanmoshe We don't need to check, we can just always pass |
Do we want to wait for the original author to submit a CL or can I do it? @ianlancetaylor |
@oryanmoshe We haven't seen any response from @jcvenegas, so, sure, go for it (for 1.12). Thanks. |
I'm on it |
Change https://golang.org/cl/127755 mentions this issue: |
@oryanmoshe @ianlancetaylor , sorry I miss this issue with a bunch of github notifications. Thanks for add the patch will make easy to work with some distros. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.3 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOOS="linux"
What did you do?
On Solus Linux
What did you expect to see?
All tests passing
What did you see instead?
The reason can be found in this patch
Quoting from that
Since Solus and Clear Linux patch Go in their distribution, normal go users don't run into this problem, but anyone on those distros who tries to compile go from source runs into this problem.
I don't see any disadvantage to upstreaming this patch. Although go shouldn't be expected to play nicely with any old arbitrarily patched gcc, being explicit about the
-O0
requirement instead of implicitly assuming gcc's default seems better all around. Making it easier for Solus and Clear Linux users to build (and contribute to) go makes this a win/win IMO.Tagging the original author of this patch @jcvenegas in case he wants to submit this and himself and get due credit.
The text was updated successfully, but these errors were encountered: