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
x/mobile/cmd/gomobile: init doesn't install darwin_arm and darwin_arm64 tools #11339
Comments
Are different tools still required? The only GOOS/GOARCH-specific entry I can find in cmd/dist is zdefaultcc.go in cgo. As CC_FOR_TARGET / CXX_FOR_TARGET are passed through, we may be able simply stop using the -toolexec trick. |
After a fresh gomobile init with no darwin tools installed, this is what I observe.
Fails with the same with the right clang.
|
The problem is about the missing darwin tools under GOROOT. With the tools installed, I can reproduce the problem above. I have limited knowledge about cross compilers. Could someone take another look if buildDarwinARMCC is missing anything critical. https://github.com/golang/mobile/blob/master/cmd/gomobile/init.go#L232 |
You can go ahead and install the tools in GOMOBILE/tools/GOOS_GOARCH for now, I'll look into removing the use of toolexec in 1.6. |
CL https://golang.org/cl/11345 mentions this issue. |
Bad news. Moving tools to GOMOBILE/tools/GOOS_GOARCH and using toolexec didn't fix the problem. Darwin/arm tools are ARM-only and don't execute on my host machine even though Android tools such as Good news. I inspected how Go toolchain is invoked if I bootstrap a darwin/arm cross compiler manually. It uses darwin_amd64 tools and clangwrapper.sh with some arguments missing from where we invoke the gomobile builds for iOS.
If I use clangwrapper as CC_FOR_TARGET and CXX_FOR_TARGET with these arguments, iOS builds will be probably achievable. |
Added the missing CC_FOR_TARGET, CXX_FOR_TARGET and the required arguments to the go build. See https://go-review.googlesource.com/#/c/11345/. |
golang/mobile@597df59 doesn't fix it. I was testing it against a bad environment probably. The CL sets a
I would prefer this issue is handled by someone who is knowledgable about the toolchain. |
CL https://golang.org/cl/11453 mentions this issue. |
This reverts commit 597df59. Reverting the change since, runtime/cgo is still not buildable and CCFLAGS is not a valid env variable. See golang/go#11339 for more information. Change-Id: I2f168508d1ca72f5c75ff641938fd3b304939617 Reviewed-on: https://go-review.googlesource.com/11453 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
As a temporary workaround, I will copy the go binary into In theory, any Go binary with CC_FOR_TARGET=clangwrap.sh and CXX_FOR_TARGET=clangwrap.sh must be behaving similarly but clangwrap.sh isn't used even though these environment variables are set. There might be a bug with the cross compilation toolchain invocation. cc/ @rsc |
CL https://golang.org/cl/11614 mentions this issue. |
Closed via golang/mobile@beece5b. |
This CL will be followed by another change to remove the misc/ios/clangwrapper.sh dependency. Updates golang/go#11043. Fixes golang/go#11339. Change-Id: I82466f8d845945935ab82d3d0b75f5af9e1ef3ec Reviewed-on: https://go-review.googlesource.com/11345 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This CL will be followed by another change to remove the misc/ios/clangwrapper.sh dependency. Updates golang/go#11043. Fixes golang/go#11339. Change-Id: I82466f8d845945935ab82d3d0b75f5af9e1ef3ec Reviewed-on: https://go-review.googlesource.com/11345 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gomobile init moves the pre-complied standard library under $GOROOT/pkg, but it should also move the tools (compile, asm, cgo, link, etc) under $GOROOT/pkg/tools/darwin_arm and $GOROOT/pkg/tools/darwin_arm64.
The text was updated successfully, but these errors were encountered: