I’m trying to get started with Rust on Android. The first step is just a simple hello world application that should be copied over and executed via adb as outlined here.
I’m closely following this Mozilla blog post, and have installed NDK 16b, created a standalone toolchain for arm in the project path and copied the target config to ~/.cargo/config.
However, when building the application with
cargo build --target armv7-linux-androideabi I get an error that says:
error: could not exec the linker `C:/Users/waved/Desktop/devel/projects/hello_android/NDK/arm/bin/arm-linux-androideabi-clang` | = note: %1 is not a valid Win32 application. (os error 193)
which is misleading because it IS a valid Win32 application, I can run it just fine from the command line.
Halfway through writing this I realized I could test to use gcc instead of clang to invoke the linker. It worked, but I can’t test the executable at the moment because my phone isn’t rooted.
Does anyone know why this error happens?