From 1ee35dad710ec2dd05d2137070c01774a9b34169 Mon Sep 17 00:00:00 2001 From: oopsbagel Date: Sat, 28 Jun 2025 05:19:52 -0700 Subject: [PATCH] cargo/config: build release binaries with fat lto Reduce installer binary size with link-time optimisation. --- .cargo/config.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index c63a35f..e0ac604 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -25,9 +25,10 @@ rustflags = ["-C", "target-feature=+crt-static"] linker = "rust-lld" rustflags = ["-C", "target-feature=+crt-static"] -# keep line numbers in stack traces for non-firmware binaries [profile.release] +# keep line numbers in stack traces for non-firmware binaries debug = "limited" +lto = "fat" strip = "debuginfo" # optimizations to reduce the binary size of firmware binaries @@ -35,7 +36,7 @@ strip = "debuginfo" inherits = "release" strip = true opt-level = "z" -lto = true +lto = "fat" codegen-units = 1 panic = "abort" debug = false