Go version
$go version go version go1.24.2 linux/amd64
Output of go env
in your module/workspace:
AR='ar'
CC='/home/praveen/Android/Sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/praveen/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/praveen/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1865275575=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/home/praveen/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='android'
GOPATH='/home/praveen/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/snap/go/10888'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/praveen/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/snap/go/10888/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24.2'
GOWORK=''
PKG_CONFIG='pkg-config'
What did you do?
go build -buildmode=c-archive -o libtest.a test.go
Build an archive file targeting Android/arm64
What did you see happen?
-buildmode=c-archive not supported on android/arm64
The Go compiler does not support the -buildmode=c-archive option for the android/arm64 target architecture.
What did you expect to see?
Build an archive file targeting Android/arm64
Comment From: gabyhelp
Related Issues
- cmd/go: support -buildmode=c-archive on android/arm64 #33806
- -buildmode c-archive not supported on linux/mipsle #67198 (closed)
- x/mobile/cmd/gomobile: build fails: clang80: error: argument unused during compilation: '-stdlib=libc++' [-Werror,-Wunused-command-line-argument] #29706 (closed)
- GOOS=android GOARCH=arm doesn't compile on amd64 #17736 (closed)
- cmd/compile: buildmode c-archive not supported on linux/mips64le #59561
- -buildmode=c-achived not supported on linux/mipsle #67199 (closed)
- cmd/go: GOOS=android requires explicitly setting CGO_ENABLED=1 #30216 (closed)
- x/mobile: gomobile bind can't use target specific LDFLAGS / CPPFLAGS #48203
- cmd/go: building with -buildmode=pie on windows/arm64 fails #56872 (closed)
- cmd/cgo: AR environment variable not used with buildmode=c-archive #68362 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)