Skip to content

Commit d866f5c

Browse files
authored
Merge pull request #925 from antheas/thin-profile
feat: add thin build profile for embedded applications
2 parents b9360a9 + cad773d commit d866f5c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ panic = "abort"
1212
# We assume we're being delivered via e.g. RPM which supports split debuginfo
1313
debug = true
1414

15+
[profile.thin]
16+
# drop bootc size when split debuginfo is not available and go a step
17+
# further in size optimization (when tested from 140mb, to 12mb without
18+
# symbols/debuginfo, to 5.8mb with extra optimizations)
19+
# https://github.com/johnthagen/min-sized-rust
20+
# cargo build --profile=thin
21+
inherits = "release"
22+
debug = false # Re-strip debug symbols
23+
strip = true # Strip symbols from binary
24+
lto = true # Use full lto to remove dead code
25+
opt-level = 's' # Optimize for size with vector vectorization
26+
codegen-units = 1 # Reduce number of codegen units to increase optimizations
27+
1528
[profile.releaselto]
1629
codegen-units = 1
1730
inherits = "release"

0 commit comments

Comments
 (0)