Open
Description
Go version
go 1.24 linux amd64
Output of go env
in your module/workspace:
CGO_ENABLED=1
CC="/home/tomas/Android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
CXX="/home/tomas/Android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++"
GOOS=android
GOARCH=arm64
What did you do?
Cross-compile an Android native application on Ubuntu 24 to Android ARM64.
go build -buildmode=c-shared -o android/app/src/main/jniLibs/arm64-v8a/libvulkandraw.so
What did you see happen?
With clang 18 and 19 from android-ndk-r27c-linux.zip or newer r28b ...
a compilation ends up with this error:
clang: error: unsupported option '-arch' for target 'aarch64-linux-android24'
With clang 17 from android-ndk-r26d-linux.zip works fine, but this version is now unsupported.
Links:
https://developer.android.com/ndk/downloads
https://github.com/android/ndk/wiki/Unsupported-Downloads
https://github.com/tomas-mraz/vulkan-go_demos/tree/master/vulkandraw
What did you expect to see?
Compiled binary using clang versions 18 or 19, like with 17.
Thanks and have a nice day