-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
NDK 23 beta: Build fails with unable to find library -lgcc
#22
Comments
Does it work if you use ndk 22.x or lower? |
Yes, it seems that way the .so file is created |
unable to find library -lgcc
unable to find library -lgcc
So, NDK 23 removes libgcc entirely. Rust relies on this for providing missing builtins on Android. rust-lang/rust#85806 should fix it. |
This seems to still only work with nightly. To use aarch64 builds as an example, this will work:
The problem seems to be the Rust CI builds for Android still use an older NDK or something similar that causes it to require libgcc. If you build your own std, no problem. |
This comment has been minimized.
This comment has been minimized.
@tux3 this is a separate issue, please create one and report this there 😄 |
Do you think that porting this workaround will be suitable for cargo ndk? |
If somebody wishes to do so. |
I'd like to mention that the workaround named above (building with std) does not work in my situation. I am using NDK R24 if that requires mentioning
If anyone would like to test this very specific scenario, the project is over here and shouldn't require extensive setup configurations. Note:
Am I missing something? Feel free to call me out on it Update: |
rust-lang/rust#85806 (comment) create 4 text files named libgcc.a in the same folders with this contents |
libgcc was removed from NDK v23 which breaks Rust builds against pre-built standard libraries that were linked against libgcc instead of libunwind. As a workaround this ensures that there is a libgcc.a in the library search paths which is a linker script that will redirect to link with libunwind instead. The libgcc.a linker script is created under: target/cargo-ndk/libgcc_workaround/libgcc.a Fixes: bbqsrc#22
libgcc was removed from NDK v23 which breaks Rust builds against pre-built standard libraries that were linked against libgcc instead of libunwind. As a workaround this ensures that there is a libgcc.a in the library search paths which is a linker script that will redirect to link with libunwind instead. The libgcc.a linker script is created under: target/cargo-ndk/libgcc-workaround/libgcc.a Fixes: bbqsrc#22
For reference the PR #67 I recently opened effectively supports this same workaround. |
libgcc was removed from NDK v23 which breaks Rust builds against pre-built standard libraries that were linked against libgcc instead of libunwind. As a workaround this ensures that there is a libgcc.a in the library search paths which is a linker script that will redirect to link with libunwind instead. The libgcc.a linker script is created under: target/cargo-ndk/libgcc-workaround/libgcc.a Fixes: #22
I'm trying to build a new project, however when running the command
cargo ndk -t aarch64-linux-android -o ./jniLibs build --release
, but I end up with an error;The text was updated successfully, but these errors were encountered: