You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build fails with a cgo-related error. The build also fails if cgo is enabled:
$ GOOS="android" GOARCH="arm" go build main.go
# command-line-arguments
loadinternal: cannot find runtime/cgo
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: unknown option: -z
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ CGO_ENABLED=1 GOOS="android" GOARCH="arm" go build main.go
# runtime/cgo
clang: error: argument unused during compilation: '-marm' [-Werror,-Wunused-command-line-argument]
Building the same program for Android ARM64 works fine:
$ GOOS="android" GOARCH="arm64" go build main.go && file main
main: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, Go BuildID=alvXLw57shg5zRLjPYoO/GyVC8TDUJ07MNhoXCsu-/nzi6B7uKoZ53M53L4eR-/0JYttdF-za9eeF0oEvPR, not stripped
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried to build the following program for Android ARM:
This is a reduced test case from a real program: https://github.com/evanw/esbuild. I am able to cross-compile this program for all platforms except for Android ARM. More context is here: evanw/esbuild#1578.
What did you expect to see?
I expected the build to succeed.
What did you see instead?
The build fails with a cgo-related error. The build also fails if cgo is enabled:
Building the same program for Android ARM64 works fine:
The text was updated successfully, but these errors were encountered: