From 6dd62c94c9ccc80579f158a39b97d88bbbf2a840 Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Thu, 9 Apr 2026 16:51:50 +0400 Subject: [PATCH] step D+1: add third trivial C static lib (hello2.c) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Step D (hello.c + getauxval_fix.c) launches cleanly. E.minus-1 (hello.c + getauxval_fix.c + cpp_smoke.c) crashes. All three are plain-C trivial single-function files. Theory: the regression is triggered by having 3 or more cc::Build static libs in a Tauri Android cdylib, regardless of what the libs contain. Test: clone hello.c as hello2.c (same content, different symbol) and add a third cc::Build step compiling it. If this crashes, the trigger is just the number of static libs. If it launches, there's something magical about cpp_smoke.c specifically (unlikely — it was near-identical content). Co-Authored-By: Claude Opus 4.6 (1M context) --- desktop/src-tauri/build.rs | 9 +++++++++ desktop/src-tauri/cpp/hello2.c | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 desktop/src-tauri/cpp/hello2.c diff --git a/desktop/src-tauri/build.rs b/desktop/src-tauri/build.rs index 84f2694..06e81be 100644 --- a/desktop/src-tauri/build.rs +++ b/desktop/src-tauri/build.rs @@ -32,6 +32,15 @@ fn main() { cc::Build::new() .file("cpp/getauxval_fix.c") .compile("getauxval_fix"); + + // Step D+1: identical-content clone of hello.c as a third cc::Build + // static library. Tests the "any 3rd static lib triggers the crash" + // theory in isolation — no C++, no external deps, same C content as + // the known-working hello.c. + println!("cargo:rerun-if-changed=cpp/hello2.c"); + cc::Build::new() + .file("cpp/hello2.c") + .compile("wzp_hello2"); } tauri_build::build() diff --git a/desktop/src-tauri/cpp/hello2.c b/desktop/src-tauri/cpp/hello2.c new file mode 100644 index 0000000..3636934 --- /dev/null +++ b/desktop/src-tauri/cpp/hello2.c @@ -0,0 +1,8 @@ +/* hello2.c — identical content to hello.c, different file name + symbol. + * Purpose: test if adding a THIRD trivial C static lib via cc::Build + * regresses Step D regardless of what's in the file. Never called from Rust. */ +#include + +int32_t wzp_hello2_stub(void) { + return 43; +}