From 8e8f31e2e6fdd84c50ba62e90d776d072fd7e320 Mon Sep 17 00:00:00 2001 From: Soapydev Date: Mon, 19 Aug 2024 10:24:25 -0400 Subject: [PATCH 1/2] Reduce the weight of the produced binary Optimise for weight at the expense of compile time, speed and we strip debuging elements Signed-off-by: Soapydev --- Cargo.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index cacbdcb35..5ed07764f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,3 +18,14 @@ tempdir = "0.3.7" [[bin]] name = "linutil" path = "src/main.rs" + + + +[profile.release] +opt-level = "z" +debug = false +lto = true +codegen-units = 1 +panic = "abort" +strip = true +incremental = false \ No newline at end of file From ad91d291e9c370dde3a00655581fd638fb14aa01 Mon Sep 17 00:00:00 2001 From: Soapydev Date: Mon, 19 Aug 2024 16:49:55 -0400 Subject: [PATCH 2/2] Set the optimisation for performance rather than size Signed-off-by: Soapydev --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5ed07764f..4f12ae8ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ path = "src/main.rs" [profile.release] -opt-level = "z" +opt-level = 3 debug = false lto = true codegen-units = 1