File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -30,26 +30,27 @@ $ cargo build --release
3030# ` strip ` Symbols from Binary
3131
3232![ OS: * nix] ( https://img.shields.io/badge/OS-*nix-brightgreen.svg )
33+ ![ Minimum Rust: 1.59] ( https://img.shields.io/badge/Minimum%20Rust%20Version-1.59-brightgreen.svg )
3334
3435By default on Linux and macOS, symbol information is included in the compiled ` .elf ` file. This
3536information is not needed to properly execute the binary.
36- To remove this, run [ ` strip ` ] ( https://linux.die.net/man/1/strip ) on the ` .elf ` file:
37-
38- ``` bash
39- $ strip target/release/min-sized-rust
40- ```
41-
42- [ Cargo has ` strip ` functionality built in] ( https://doc.rust-lang.org/cargo/reference/profiles.html#strip ) :
43-
44- ![ Minimum Rust: 1.59] ( https://img.shields.io/badge/Minimum%20Rust%20Version-1.59-brightgreen.svg )
4537
38+ Cargo can be configured to
39+ [ automatically ` strip ` binaries] ( https://doc.rust-lang.org/cargo/reference/profiles.html#strip ) .
4640Modify ` Cargo.toml ` in this way:
4741
4842``` toml
4943[profile .release ]
5044strip = true # Automatically strip symbols from the binary.
5145```
5246
47+ On Rust versions older than 1.59, run [ ` strip ` ] ( https://linux.die.net/man/1/strip ) directly on
48+ the ` .elf ` file instead:
49+
50+ ``` bash
51+ $ strip target/release/min-sized-rust
52+ ```
53+
5354# Optimize For Size
5455
5556![ Minimum Rust: 1.28] ( https://img.shields.io/badge/Minimum%20Rust%20Version-1.28-brightgreen.svg )
You can’t perform that action at this time.
0 commit comments