-
Notifications
You must be signed in to change notification settings - Fork 458
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
Library creation fails with Android NDK r23b #636
Comments
Same issue here. Would love to see a fix to allow me to use the current version of the NDK |
Same problem here. outdated profile for cc::build: |
Does version 22/21 have the files. Was hesitant after downloading via Android studio and manually downloading the NDK archive from the website. [Edit] |
Would you mind testing a variant of #657? "A variant" means that I would have to prepare a variant that would extend the suggested approach to android targets. |
In the context I also wonder how do you specify the compiler? The background for the question is following. My understanding is that you're supposed to specify |
To fix copy and rename Do this for all your target arch. |
@irediaes Thanks for the information! Armed with this tip, I guessed that I can also set an Taking the command from my item 6 above (in the first comment) and adding
to it seems to make the build succeed.
I don't understand why rust's tools' expectations don't align with how the Android NDK ships, but it seems that at least I can configure it to work without modifying the Android NDK itself. I'll leave this issue open in the hopes that either the rust toolchain will adapt to the NDK such that no workarounds at all are required, or at least that how to do this becomes documented somewhere. Thanks again for the key information. |
Isn't answer to all these questions
It has nothing to do with Android. If you want to cross-compile for any platform, it is your responsibility to specify appropriate cross-linker. You can do it yourself or use helpers like |
Should this be closed? Everything in the description is so outdated that it is hard to see if it has any relevance today. |
Thanks, I've closed this. If anyone still encounters this issue, feel free to open a new issue. |
Problem
Using fresh installations of Rust installed on x86_64-unknown-linux-gnu (Debian 10) via the rustup method, compiling packages for Android with NDK r23b (the current LTS release) does not work.
Steps
curl -sf -L https://static.rust-lang.org/rustup.sh | sh
(fresh install for the local user)rustup target add aarch64-linux-android
Create an empty library crate that depends on
ring
:aarch64-linux-android
the simple, documented way and it fails, but that's because of all the reasons in Build and link issues on Linux hosts with newer Android NDKs #459:The newest versions of the Android NDK simply do not ship GNU binutils and thus there is no
aarch64-linux-android-ar
to use. No amount of changing paths or environment variables is likely to make this work. I suspect that the rust toolchain will need to usellvm-ar
and the other LLVM tools instead if it is to work with the current LTS versions of the Android NDK.The text was updated successfully, but these errors were encountered: