Skip to content

Commit f7e216d

Browse files
authored
Add strip=true to the repo examples (#36)
Enables strip in the example `Cargo.toml` files in this repository, per the recommendation now in README after #34. The reminder to `strip` has been removed from the README, since the examples will now do that automatically.
1 parent 7521052 commit f7e216d

File tree

5 files changed

+6
-2
lines changed

5 files changed

+6
-2
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ opt-level = "z" # Optimize for size.
1111
lto = true # Enable Link Time Optimization
1212
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
1313
panic = "abort" # Abort on panic
14+
strip = true # Automatically strip symbols from the binary.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ host: x86_64-apple-darwin
185185
$ cargo +nightly build -Z build-std=std,panic_abort --target x86_64-apple-darwin --release
186186
```
187187

188-
Remember to `strip` the resulting executable. On macOS, the final binary size is reduced to 51KB.
188+
On macOS, the final stripped binary size is reduced to 51KB.
189189

190190
# Remove `panic` String Formatting with `panic_immediate_abort`
191191

@@ -205,7 +205,7 @@ $ cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features=panic_
205205
--target x86_64-apple-darwin --release
206206
```
207207

208-
Remember to `strip` the resulting executable. On macOS, the final binary size is reduced to 30KB.
208+
On macOS, the final stripped binary size is reduced to 30KB.
209209

210210
# Remove `core::fmt` with `#![no_main]` and Careful Usage of `libstd`
211211

build_std/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ opt-level = "z" # Optimize for size.
1717
lto = true # Enable Link Time Optimization
1818
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
1919
panic = "abort" # Abort on panic
20+
strip = true # Automatically strip symbols from the binary.

no_main/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ opt-level = "z"
1818
lto = true
1919
codegen-units = 1
2020
panic = "abort"
21+
strip = true

no_std/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ opt-level = "z" # Optimize for size.
1616
lto = true # Enable Link Time Optimization
1717
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
1818
panic = "abort" # Abort on panic
19+
strip = true # Automatically strip symbols from the binary.

0 commit comments

Comments
 (0)