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: go1.4rc1 cgo issue for cross-compiler when host: darwin/amd64, target: android/arm #9114

Closed
rainliu opened this issue Nov 17, 2014 · 1 comment

Comments

@rainliu
Copy link

rainliu commented Nov 17, 2014

Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:

Run "go version" and compare against
http://golang.org/doc/devel/release.html  If a newer version of Go exists,
install it and retry what you did to reproduce the problem.

Thanks.

What does 'go version' print?
go1.4rc1 darwin/amd64

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. install go from source code to build cross-compiler for android by 
        cd $GOROOT/src && \
    ./all.bash && \
    CC_FOR_TARGET=$NDK_ROOT/bin/arm-linux-androideabi-gcc GOOS=android GOARCH=arm GOARM=7 ./make.bash

2. after install go from source code, there is no issue to build
golang.org/x/mobile/example/basic for target android by ./make.bash in that folder. The
android program can be successfully built.

3.  But it have issue to build host darwin/amd64 cgo enabled code by 
     go build local_cgo_enabled_folder or
     CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build local_cgo_enabled_folder

What happened?
    cc1: error: unrecognized command line option '-m64'

What should have happened instead?
   build successfully.

Please provide any additional information below.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Unfortunately this is a known issue.  Once you've built the Go tools as a
cross-compiler, the compiler is baked in.  To build for both Android and Darwin you'll
need to build different instances of the tools.

Status changed to Duplicate.

Merged into issue #8161.

@mikioh mikioh changed the title go1.4rc1 cgo issue for cross-compiler when host: darwin/amd64, target: android/arm cmd/go: go1.4rc1 cgo issue for cross-compiler when host: darwin/amd64, target: android/arm Aug 5, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
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

3 participants