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

doc: cross-compilation requires disabling CGO #5104

Closed
griesemer opened this issue Mar 22, 2013 · 6 comments
Closed

doc: cross-compilation requires disabling CGO #5104

griesemer opened this issue Mar 22, 2013 · 6 comments

Comments

@griesemer
Copy link
Contributor

The documentation needs to explain that CGO must be disabled for cross compilation.

For instance, with correct (and documented) environment variables set to:

export GOROOT=<whatever your goroot>
export GOARCH=arm
export GOOS=linux

but building on an OS X platform (amd64, darwin), the build fails with:

...
runtime/cgo
go build runtime/cgo: cannot use cgo when compiling for a different operating system
...

Document that CGO must be disabled via:

export CGO_ENABLED=0
@minux
Copy link
Member

minux commented Mar 22, 2013

Comment 2:

see also issue #4714.
as issue #4714 is not labeled Go 1.1, we need to fix this before Go 1.1
(i suggest we treat cgo as disabled by default when doing cross OS
cross-compilation, then we don't need to document; that is, cmd/go
should do the right thing by default).

@robpike
Copy link
Contributor

robpike commented Mar 27, 2013

Comment 3:

Deferring the doc topic. It's a big topic and we have nothing on it now. When we have a
cross-compilation doc, we'll make the topic clear.
Opening a new bug to address minux's point.

Labels changed: added priority-later, removed priority-triage, go1.1.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 4:

Labels changed: added go1.2.

@rsc
Copy link
Contributor

rsc commented Sep 24, 2013

Comment 5:

Owner changed to @rsc.

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Oct 1, 2013

Comment 6:

Nothing to do here; this works automatically now.

@rsc
Copy link
Contributor

rsc commented Oct 1, 2013

Comment 7:

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
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

5 participants