Skip to content

Commit

Permalink
build: Use lto and strip the binary
Browse files Browse the repository at this point in the history
- Makes the binary smaller
- Prevents size regression when updating to new toolchain
- Avoids bugs like: rust-lang/rust#62785

Signed-off-by: Joe Richey <[email protected]>
  • Loading branch information
josephlr authored and rbradford committed Nov 6, 2019
1 parent d258701 commit 3307922
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.target]
rustflags = ["-C", "link-arg=-s"]
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ edition = "2018"
# the profile used for `cargo build`
[profile.dev]
panic = "abort" # disable stack unwinding on panic
lto = true

# the profile used for `cargo build --release`
[profile.release]
panic = "abort" # disable stack unwinding on panic
lto = true

[dependencies]
cpuio = "*"
Expand Down

0 comments on commit 3307922

Please sign in to comment.