Git Product home page Git Product logo

Comments (7)

igor-brishkoski avatar igor-brishkoski commented on September 21, 2024 1

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.

bbqsrc avatar bbqsrc commented on September 21, 2024

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.

bbqsrc avatar bbqsrc commented on September 21, 2024

@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.

igor-brishkoski avatar igor-brishkoski commented on September 21, 2024

Not sure why you closed this, seems other people are having the same issue with different libraries.

tauri-apps/tauri#6047

from cargo-ndk.

bbqsrc avatar bbqsrc commented on September 21, 2024

This has nothing to do with cargo-ndk and everything to do with not linking to the correct libraries.

from cargo-ndk.

NiallBunting avatar NiallBunting commented on September 21, 2024

Ah I think it might actually be caused by this: rust-lang/rust#109717

from cargo-ndk.

9p4 avatar 9p4 commented on September 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.