Comments (7)
Any updates here? Facing the same issue.
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__extenddftf2" referenced by "/data/app/~~9i8SALkmFVE3inoqZObfVQ==/com.example.android-LszkPsK4KaEepki_EkBFdA==/base.apk!/lib/x86_64/libtest.so
from cargo-ndk.
I checked NDK to see if that builtin exists and it seems to be here:
/home/nib/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/17/lib/linux/libclang_rt.builtins-x86_64-android.a
.
Builds correctly for me on macOS with NDK v26.0.10792818, so I suspect the NDK is doing nonsensical things again, or you need to update your cargo-ndk.
from cargo-ndk.
@NiallBunting this is an issue with matrix-rust-sdk
. You need to set NDK_CLANG_VERSION
to the clang version relative to the NDK you're targetting. See their build.rs
file.
from cargo-ndk.
Not sure why you closed this, seems other people are having the same issue with different libraries.
from cargo-ndk.
This has nothing to do with cargo-ndk and everything to do with not linking to the correct libraries.
from cargo-ndk.
Ah I think it might actually be caused by this: rust-lang/rust#109717
from cargo-ndk.
Made some changes to matrix-rust-sdk
to get this working:
diff --git a/bindings/matrix-sdk-crypto-ffi/build.rs b/bindings/matrix-sdk-crypto-ffi/build.rs
index a3572f17f..39663cab2 100644
--- a/bindings/matrix-sdk-crypto-ffi/build.rs
+++ b/bindings/matrix-sdk-crypto-ffi/build.rs
@@ -18,13 +18,16 @@ fn setup_x86_64_android_workaround() {
"Unsupported OS. You must use either Linux, MacOS or Windows to build the crate."
),
};
- const DEFAULT_CLANG_VERSION: &str = "14.0.7";
+ const DEFAULT_CLANG_VERSION: &str = "17";
+ const DEFAULT_NDK_VERSION: &str = "26.3.11579264";
let clang_version =
env::var("NDK_CLANG_VERSION").unwrap_or_else(|_| DEFAULT_CLANG_VERSION.to_owned());
+ let ndk_version =
+ env::var("NDK_VERSION").unwrap_or_else(|_| DEFAULT_NDK_VERSION.to_owned());
let linux_x86_64_lib_dir = format!(
- "toolchains/llvm/prebuilt/{build_os}-x86_64/lib64/clang/{clang_version}/lib/linux/"
+ "toolchains/llvm/prebuilt/{build_os}-x86_64/lib/clang/{clang_version}/lib/linux/"
);
- println!("cargo:rustc-link-search={android_ndk_home}/{linux_x86_64_lib_dir}");
+ println!("cargo:rustc-link-search={android_ndk_home}/{ndk_version}/{linux_x86_64_lib_dir}");
println!("cargo:rustc-link-lib=static=clang_rt.builtins-x86_64-android");
}
}
diff --git a/bindings/matrix-sdk-ffi/build.rs b/bindings/matrix-sdk-ffi/build.rs
index e22f54451..217b28750 100644
--- a/bindings/matrix-sdk-ffi/build.rs
+++ b/bindings/matrix-sdk-ffi/build.rs
@@ -18,13 +18,16 @@ fn setup_x86_64_android_workaround() {
"Unsupported OS. You must use either Linux, MacOS or Windows to build the crate."
),
};
- const DEFAULT_CLANG_VERSION: &str = "14.0.7";
+ const DEFAULT_CLANG_VERSION: &str = "17";
+ const DEFAULT_NDK_VERSION: &str = "26.3.11579264";
let clang_version =
env::var("NDK_CLANG_VERSION").unwrap_or_else(|_| DEFAULT_CLANG_VERSION.to_owned());
+ let ndk_version =
+ env::var("NDK_VERSION").unwrap_or_else(|_| DEFAULT_NDK_VERSION.to_owned());
let linux_x86_64_lib_dir = format!(
- "toolchains/llvm/prebuilt/{build_os}-x86_64/lib64/clang/{clang_version}/lib/linux/"
+ "toolchains/llvm/prebuilt/{build_os}-x86_64/lib/clang/{clang_version}/lib/linux/"
);
- println!("cargo:rustc-link-search={android_ndk_home}/{linux_x86_64_lib_dir}");
+ println!("cargo:rustc-link-search={android_ndk_home}/{ndk_version}/{linux_x86_64_lib_dir}");
println!("cargo:rustc-link-lib=static=clang_rt.builtins-x86_64-android");
}
}
from cargo-ndk.
Related Issues (20)
- 3.2.0 version seems to be different from 3.1.2, failed to correctly find the compiler HOT 1
- C linker issue HOT 6
- CFLAGS getting ignored HOT 17
- error[E0308]: mismatched types HOT 1
- Changes for 3.3 release haven't been pushed to main HOT 1
- Using proc-macros - no .kt file HOT 1
- install error
- Not an issue. Just a question if there is any version support NDK 21? HOT 1
- A library produces .sos with undefined symbols HOT 3
- Build failure on for rocksdb dependency on `Ubuntu 22.04` (amd64) machine while cross-compiling for `aarch64-linux-android` HOT 4
- Error in build HOT 1
- Feature request: Printing environment variables set HOT 31
- Install cargo-ndk failed HOT 4
- m1 Mac: ARCH not found in this scope HOT 2
- Feature Request: Set Env for clang/cc-rs HOT 3
- What's the difference when handle libc++_shared.so HOT 1
- default ndk location for linux is wrong HOT 2
- (Question) The Android toolchain and libraries needs to run on Linux?
- Failed loading manifest HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-ndk.