diff --git a/scripts/build-tauri-android.sh b/scripts/build-tauri-android.sh index 7956466..73a1bec 100755 --- a/scripts/build-tauri-android.sh +++ b/scripts/build-tauri-android.sh @@ -166,6 +166,30 @@ docker run --rm \ wzp-android-builder \ bash -c ' set -euo pipefail + +# ─── Linker wrappers ─────────────────────────────────────────────────────── +# Tauri-cli hard-codes aarch64-linux-android24-clang as the Rust linker for +# the aarch64 target, which resolves pthread_create / dlsym / __init_tcb +# against the NDK API-24 *stub* libc.a/libdl.a. Those stubs are designed to +# crash if called — they only exist so the API-24 sysroot compiles, not so +# symbols actually work. API-26 has the real dynamic bindings to libc.so. +# +# Rather than fight tauri-cli to change which clang it invokes, we put a +# wrapper on $PATH that IS named android24-clang but exec()s the android26 +# version. Same trick works for every ABI. +mkdir -p /tmp/wrappers +for abi in aarch64-linux-android armv7a-linux-androideabi i686-linux-android x86_64-linux-android; do + for suffix in clang clang++; do + cat > /tmp/wrappers/${abi}24-${suffix} <>> installed android24→android26 linker wrappers in /tmp/wrappers" + cd /build/source/desktop echo ">>> npm install"