Target older android NDK with armv7-linux-androideabi

⚓ Rust    📅 2025-10-19    👤 surdeus    👁️ 3      

surdeus

Hey, I'm playing around with building android apps for old Blackberry devices running BB10. Unfortunately to build anything to run on these devices you need to target android API level 18 and if you want native code target an older NDK that still supports API level 18.

I'm not really familiar with the rust runtime and its dependencies, but to try and get something built I built a static library in rust with armv7-linux-androideabi as the target. I then setup a simple Android.mk file to build an Android compatible .so library. Unfortunately I got the following errors when trying to link against the static library, which I think come from the rust runtime building against a newer version of the ndk.

lfryzek@hazepad:~/Documents/projects/bb10/libmatrix/clib$ ~/Android/Sdk/ndk/android-ndk-r14b/ndk-build APP_PLATFORM=android-18 APP_ABI=armeabi-v7a NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk
Android NDK: WARNING:Android.mk:matrix: non-system libraries in linker flags: ../target/armv7-linux-androideabi/debug/liblibmatrix.a    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
[armeabi-v7a] SharedLibrary  : liblibmatrix.so
library/std/src/../../backtrace/src/symbolize/gimli/libs_dl_iterate_phdr.rs:27: error: undefined reference to 'dl_iterate_phdr'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi-v7a/liblibmatrix.so] Error 1

Without rebuilding the whole toolchain can I rebuild the runtime? If not are there instructions for building the androideabi runtimes to point them at a different ndk & api version?

1 post - 1 participant

Read full topic

🏷️ Rust_feed