Compiling android targeted binary is a pain on aarch64 linux and android, because ndk is not distributed on them, this repo show you how you can do that with ndk and llvm toolchain.
checkout tests/test_toolchain.sh
Prerequisites:
- llvm toolchain
- zig
- (or other llvm toolchain)
- ndk
Take zig as an example
Then run:
## Unzip android ndk
unzip <android_ndk_package>
## Get resouce from ndk
./mini-ndk setup <ndk_root>
## Add zig to path
export PATH="${PATH}:<path_to_zig_dir>"
## Test
./bin/aarch64-linux-android24-clang tests/src/hello.c