-
Notifications
You must be signed in to change notification settings - Fork 18k
doc: clarify usage of CGO_ENABLED #9530
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
Comments
If you used Whether cgo is enabled or not is being embedded into the Yes, this might be confusing. |
Hello, I was the one that made that change last year. There is some background in On Thu, Jan 8, 2015 at 10:39 AM, Matthew Dempsky notifications@github.com
|
I'm having the problem at the moment with this error, even when I define CGO_ENABLED when cross compiling a go program, as well as when I try to compile the Go compiler with CGO_ENABLED. What's the correct way to do this? I'm going amd64 -> arm by the way. |
@paralin Please ask questions on the mailing list golang-nuts@googlegroups.com, rather than dropping a question into an issue. Thanks. I'm not sure what error you mean here. In your e-mail to golang-nuts, please say exactly what you did, exactly what happened, and what you expected to happen instead. |
CL https://golang.org/cl/12603 mentions this issue. |
I was trying to repro issue #9510. I'm on a linux/amd64 system, and I used "GOARCH=386 ./make.bash --no-clean" to setup a cross-compiler toolchain. However, subsequently running "GOARCH=386 go build issue" per iant@'s instructions yielded an unhelpful "no buildable Go source files in .../issue/a" error.
Poking into the package go/build source code, I discovered mention of "CGO_ENABLED" so I tried "GOARCH=386 CGO_ENABLED=1 go build issue". This worked to reproduce the issue.
However, trying to learn more about this setting, I found this in cmd/cgo/doc.go:
So I inferred I was misusing it and decided to startover with "GOARCH=386 CGO_ENABLED=1 ./make.bash --no-clean" instead, but then running just "GOARCH=386 go build issue" again produced the same "no buildable Go source files" error.
Confusingly, src/make.bash also seems to mention CGO_ENABLED having some significance, but at the moment (even having poked through run.bash and grep'd the source code), I'm still not sure I entirely understand the significance.
The text was updated successfully, but these errors were encountered: