Skip to content

Commit 99d1054

Browse files
committed
build: add product profile; update README for packager instructions to use that profile if using cargo
1 parent 019d6ed commit 99d1054

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ version = "0.10"
3131
[[bin]]
3232
name = "bingrep"
3333

34+
[profile.product]
35+
inherits = "release"
36+
opt-level = 3
37+
lto = true
38+
codegen-units = 1
39+
3440
[badges.travis-ci]
3541
branch = "master"
3642
repository = "m4b/bingrep"

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Greps through binaries from various OSs and architectures, and colors them. Curr
1818
* Unix and BSD archive printer
1919
* PE (debug only)
2020

21-
**NOTE**: Building requires rustc version 1.20 or greater. If you're using a distro's rust compiler, consider using https://rustup.rs to install your rustc compiler and associated binaries.
21+
**NOTE**: Building requires rustc version 1.74 or greater. If you're using a distro's rust compiler, consider using https://rustup.rs to install your rustc compiler and associated binaries.
2222

2323
![elf_table2](etc/elf_table2.png)
2424

@@ -40,6 +40,17 @@ Tested with stable rustc 1.74.0.
4040

4141
Now copy the resulting binary in `<path_to_bingrep>/target/release/bingrep` wherever you like.
4242

43+
## Build for Packagers
44+
45+
If using `cargo`, I suggest to use the "product" profile, which uses LTO with 1 codegen unit; this should be the most performant, but also ends up slimming the binary down somewhat.
46+
47+
```
48+
cargo build --profile product
49+
strip target/product/bingrep
50+
```
51+
52+
The resulting binary in `target/product/bingrep` is ready to go.
53+
4354
## Run
4455

4556
Example:

0 commit comments

Comments
 (0)