diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index c4d8f5289..0a7c09c25 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -2300,6 +2300,16 @@ jobs: # build rustdesk python3 ./res/inline-sciter.py export CARGO_INCREMENTAL=0 + # armv7 is the only 32-bit target in this job that links the whole binary, and the + # release profile uses fat LTO with codegen-units=1. LLVM then merges every module + # into a single unit and runs past the ~3GB address space a 32-bit process gets, + # aborting rustc with "Rust cannot catch foreign exceptions" (a C++ bad_alloc from + # LLVM unwinding into rustc's Rust frames). Thin LTO keeps peak memory bounded and + # still allows cross-crate inlining; 64-bit targets keep fat LTO untouched. + if [ "${{ matrix.job.arch }}" = "armv7" ]; then + export CARGO_PROFILE_RELEASE_LTO=thin + export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16 + fi cargo build --locked --features inline${{ matrix.job.extra_features }} --release --bins --jobs 1 # make debian package mkdir -p ./Release