-
Notifications
You must be signed in to change notification settings - Fork 77
Expose AR_...=llvm-ar
with Android NDK 23+ toolchains
#91
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
Comments
Hmm, interesting. So the It rather sounds like we need to accommodate these changes to NDK 23+ in rust-android-gradle/plugin/src/main/kotlin/com/nishtahir/RustAndroidPlugin.kt Lines 110 to 152 in 5bfc241
Patches wanted! |
I was able to solve this with specifying an absolute path to ndk's def ndkDir = android.ndkDirectory
exec { spec, toolchain ->
if (toolchain.target == "x86_64-linux-android") {
spec.environment("AR_x86_64-linux-android", "$ndkDir/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar")
}
if (toolchain.target == "armv7-linux-androideabi") {
spec.environment("AR_armv7-linux-androideabi", "$ndkDir/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar")
}
if (toolchain.target == "aarch64-linux-android") {
spec.environment("AR_aarch64-linux-android", "$ndkDir/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar")
}
} |
I'm going to keep this open -- if the modern NDKs have changed layout, we want to accommodate in the code. |
I'm facing the same problem.
@montekki, where did you add this? I added it to the cargo block in my build.gradle file, but the error is still there |
check out our gradle file here |
AR_...=llvm-ar
with Android NDK 23+ toolchains
…Fixes mozilla#91. I'd prefer to do this by interrogating the binaries on disk, using something like `which`, but the current expression makes that a little hard to achieve, so we'll feed the NDK version into the relevant helper function for now.
…Fixes mozilla#91. I'd prefer to do this by interrogating the binaries on disk, using something like `which`, but the current expression makes that a little hard to achieve, so we'll feed the NDK version into the relevant helper function for now.
…Fixes mozilla#91. I'd prefer to do this by interrogating the binaries on disk, using something like `which`, but the current expression makes that a little hard to achieve, so we'll feed the NDK version into the relevant helper function for now.
This should be fixed in the just published 0.9.3. Testing appreciated! |
It seems the llvm-ar error is resolved, but now I am getting an lgcc error:
The release notes mention lgcc, so perhaps it is related. |
Can I get more logs? Including some details on your build environment? The plugin takes care to use a linker invocation that rewrites |
I created a secret gist |
Well, this is a first: those logs strongly suggest that you're building with |
You're right. I see someone added cargoNdk as a dependency of another task. I'm not sure what the solution is, but we can stay on NDK 22. |
I am trying to build a project that has
ring
as a dependency that usescc-rs
which among other things requires invoking customCC
andAR
s among other things.Since r23 GNU binutils including stuff like
x86_64-linux-android-ar
have been removed so what I am trying to do is to point the build to thellvm-ar
like this:But apparently it has no effect and falls back with an error message
The text was updated successfully, but these errors were encountered: