Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linkage fails on Android Cross Compile, using NDK 26.1.10909125 #122

Open
johnoneil opened this issue Jan 12, 2024 · 0 comments
Open

Linkage fails on Android Cross Compile, using NDK 26.1.10909125 #122

johnoneil opened this issue Jan 12, 2024 · 0 comments

Comments

@johnoneil
Copy link

johnoneil commented Jan 12, 2024

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 out 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant