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

Comment From: dmitshur

CC @golang/android.

Comment From: gabyhelp

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Comment From: mknyszek

@tomas-mraz Do you happen to know what we're supposed to pass instead? It's probably not as simple as removing the option, but given that it's unsupported, there must be some way to specify the same thing. If it's supported by older versions, we can just consider switching to that.