From f6562c412fd43542d872024b2726dc593839d560 Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 10 Mar 2023 01:29:12 +0000 Subject: [PATCH 1/2] Update to Rust 1.68.2 --- flake.nix | 2 +- scripts/rust-toolchain | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 629e681455..5224c334ff 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ ''; buildInputs = [ android-sdk - (pkgs.buildPackages.rust-bin.stable."1.64.0".minimal.override { + (pkgs.buildPackages.rust-bin.stable."1.68.2".minimal.override { targets = [ "armv7-linux-androideabi" "aarch64-linux-android" diff --git a/scripts/rust-toolchain b/scripts/rust-toolchain index 9405730420..5deab586f9 100644 --- a/scripts/rust-toolchain +++ b/scripts/rust-toolchain @@ -1 +1 @@ -1.64.0 +1.68.2 From fa7812ab0d63390292dc789092deb02735b930de Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 10 Mar 2023 19:42:57 +0000 Subject: [PATCH 2/2] Remove workaround for Rust built against r22b NDK Rust 1.68.0 targets NDK r25, so the workaround is no longer needed. --- scripts/ndk-make.sh | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/scripts/ndk-make.sh b/scripts/ndk-make.sh index 074be8cd58..4a2044e5b7 100755 --- a/scripts/ndk-make.sh +++ b/scripts/ndk-make.sh @@ -110,21 +110,12 @@ cd deltachat-core-rust # fix build on MacOS Catalina unset CPATH -# Work around the bug in the build of Rust standard library. -# It is built against r22b NDK toolchains and still requires -lgcc instead of -lunwind used in newer r23 NDK. -# See discussion at -TMPLIB="$(mktemp -d)" -if test -z "$(find "$ANDROID_NDK_ROOT" -name libgcc.a -print -quit)"; then - # NDK is does not contain libgcc.a, add a linker script to fake it. - echo 'INPUT(-lunwind)' >"$TMPLIB/libgcc.a" -fi - if test -z $1 || test $1 = armeabi-v7a; then echo "-- cross compiling to armv7-linux-androideabi (arm) --" TARGET_CC="$TOOLCHAIN/bin/armv7a-linux-androideabi16-clang" \ TARGET_AR="$TOOLCHAIN/bin/llvm-ar" \ TARGET_RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \ - cargo rustc $RELEASEFLAG --target armv7-linux-androideabi -p deltachat_ffi -- -L "$TMPLIB" + cargo build $RELEASEFLAG --target armv7-linux-androideabi -p deltachat_ffi cp target/armv7-linux-androideabi/$RELEASE/libdeltachat.a $jnidir/armeabi-v7a fi @@ -133,7 +124,7 @@ if test -z $1 || test $1 = arm64-v8a; then TARGET_CC="$TOOLCHAIN/bin/aarch64-linux-android21-clang" \ TARGET_AR="$TOOLCHAIN/bin/llvm-ar" \ TARGET_RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \ - cargo rustc $RELEASEFLAG --target aarch64-linux-android -p deltachat_ffi -- -L "$TMPLIB" + cargo build $RELEASEFLAG --target aarch64-linux-android -p deltachat_ffi cp target/aarch64-linux-android/$RELEASE/libdeltachat.a $jnidir/arm64-v8a fi @@ -142,7 +133,7 @@ if test -z $1 || test $1 = x86; then TARGET_CC="$TOOLCHAIN/bin/i686-linux-android16-clang" \ TARGET_AR="$TOOLCHAIN/bin/llvm-ar" \ TARGET_RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \ - cargo rustc $RELEASEFLAG --target i686-linux-android -p deltachat_ffi -- -L "$TMPLIB" + cargo build $RELEASEFLAG --target i686-linux-android -p deltachat_ffi cp target/i686-linux-android/$RELEASE/libdeltachat.a $jnidir/x86 fi @@ -151,7 +142,7 @@ if test -z $1 || test $1 = x86_64; then TARGET_CC="$TOOLCHAIN/bin/x86_64-linux-android21-clang" \ TARGET_AR="$TOOLCHAIN/bin/llvm-ar" \ TARGET_RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \ - cargo rustc $RELEASEFLAG --target x86_64-linux-android -p deltachat_ffi -- -L "$TMPLIB" + cargo build $RELEASEFLAG --target x86_64-linux-android -p deltachat_ffi cp target/x86_64-linux-android/$RELEASE/libdeltachat.a $jnidir/x86_64 fi