From ec246b9702f0fca176814f90e9f0a1796b7f5eef Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 17 Jun 2020 18:15:52 +0100 Subject: [PATCH] build: Enable LTO for release build This results in ~20% reduction of stripped binary size: Default release build: 8.7M -> stripped: 5.3M LTO release build: 5.9M -> stripped: 4.3M Signed-off-by: Rob Bradford --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index af1f90398..0c480fc59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,9 @@ edition = "2018" default-run = "cloud-hypervisor" build = "build.rs" +[profile.release] +lto = true + [dependencies] arc-swap = ">=0.4.4" clap = { version = "2.33.1", features=["wrap_help"] }