-
Notifications
You must be signed in to change notification settings - Fork 13k
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
When cross compiling Rust to Android on Windows, Rust 1.69.0+ can't find the version script path. #113711
Comments
you are using an MSVC host toolchain and the compiler is passing unix-style flags. do you see this same problem on windows-gnu or only on MSVC? |
I encountered this issue on both windows-gnu and MSVC. They work correctly in rust 1.68.2 version, but the problem appears in versions after that. |
@moe-deer Does it also happen with a new Rust project? Any chance you can provide a small bare Rust project template to reproduce the issue? Just to be sure I understand: is the correct Windows path to your Android NDK |
In other words, the invocation only works as long as first the linker argument doesn't have comma in it. |
This seems similar enough, just a different separator: android/ndk#1856. |
I am getting this exact error, and this workaround works android/ndk#1856 (comment) |
Has the problem been solved now? |
This is not a Rust error. It is a problem with the CMD wrapper in Android SDK. I believe cargo-ndk is not calling the wrapper script anymore. |
This solved my problem,thanks very much! |
On Windows, when cross compiling Rust code to generate an Android .so library, using Rust versions 1.69.0 or newer can result in compile errors about the version script.
The error happens because the Rust compiler tries to pass a path to a version script to the linker, but that specified path does not actually exist on Windows.
I tried this code:
I expected to see this happen:
Instead, this happened:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: