Linkage fails on Android Cross Compile, using NDK `26.1.10909125`
I will try to provide a project to recreate this error but I'm hoping it just might ring a bell.
Our current Rust builds for android (using NDK `25.2.9519653` succeed), but moving to any `26` version brings our linkage errors like:
```
note: ld.lld: error: /tmp/rustc9ErbZO/libfreetype_sys-d92f0c941db0ed75.rlib(autofit.c.o) is incompatible with aarch64linux
ld.lld: error: /tmp/rustc9ErbZO/libfreetype_sys-d92f0c941db0ed75.rlib(ftbase.c.o) is incompatible with aarch64linux
...
```
I believe the target and build configuration is correct, or at least it was correct enough to build with NDK `25.2`.
Here's the reported configuration as the crate is being built:
```
[freetype-sys 0.13.1] CMAKE_TOOLCHAIN_FILE_aarch64-linux-android = None
[freetype-sys 0.13.1] CMAKE_TOOLCHAIN_FILE_aarch64_linux_android = None
[freetype-sys 0.13.1] TARGET_CMAKE_TOOLCHAIN_FILE = None
[freetype-sys 0.13.1] CMAKE_TOOLCHAIN_FILE = Some(".../Android/Sdk/ndk/26.1.10909125//build/cmake/android.toolchain.cmake")
[freetype-sys 0.13.1] CMAKE_GENERATOR_aarch64-linux-android = None
[freetype-sys 0.13.1] CMAKE_GENERATOR_aarch64_linux_android = None
[freetype-sys 0.13.1] TARGET_CMAKE_GENERATOR = None
[freetype-sys 0.13.1] CMAKE_GENERATOR = None
[freetype-sys 0.13.1] CMAKE_PREFIX_PATH_aarch64-linux-android = None
[freetype-sys 0.13.1] CMAKE_PREFIX_PATH_aarch64_linux_android = None
[freetype-sys 0.13.1] TARGET_CMAKE_PREFIX_PATH = None
[freetype-sys 0.13.1] CMAKE_PREFIX_PATH = None
[freetype-sys 0.13.1] CMAKE_aarch64-linux-android = None
[freetype-sys 0.13.1] CMAKE_aarch64_linux_android = None
[freetype-sys 0.13.1] TARGET_CMAKE = None
[freetype-sys 0.13.1] CMAKE = None
```
As shown, we're trying to use the `android.toolchain.cmake` provided by the NDK.
I'll add more detail if this seems strange. If you can vouch for the crate against NDK `26.x` our build configuration probably needs to be updated in some way required by the NDK.
0 条评论