rust: Add in link-time optimization by default

This turns on "fat" LTO for builds even in dev mode so that we can keep our
binaries size down. It's not a total solution, but eliminates the "kitchen sink"
effect that building Rust static libs has, allowing us to keep our dependencies
down a bit.

Change-Id: I5fb071d7cdb7b9964b2af25d8137944593bd065c
GitOrigin-RevId: fe7f105307e042c211be5d031870d6161d71e27c
This commit is contained in:
June Tate-Gans 2021-06-25 11:20:21 -05:00 committed by Sam Leffler
parent e35c69ae4c
commit 83d2875eb2
3 changed files with 42 additions and 0 deletions

View File

@ -7,3 +7,17 @@ members = [
"kata-shell", "kata-shell",
"kata-uart-client", "kata-uart-client",
] ]
[profile.dev]
lto = "fat"
codegen-units = 1
[profile.release]
opt-level = "z"
lto = "fat"
codegen-units = 1
split-debuginfo = "unpacked"
[profile.release.build-override]
opt-level = "z"
codegen-units = 1

View File

@ -4,3 +4,17 @@ members = [
"ml-common", "ml-common",
"ml-coordinator", "ml-coordinator",
] ]
[profile.dev]
lto = "fat"
codegen-units = 1
[profile.release]
opt-level = "z"
lto = "fat"
codegen-units = 1
split-debuginfo = "unpacked"
[profile.release.build-override]
opt-level = "z"
codegen-units = 1

View File

@ -4,3 +4,17 @@ members = [
"kata-proc-common", "kata-proc-common",
"kata-proc-manager", "kata-proc-manager",
] ]
[profile.dev]
lto = "fat"
codegen-units = 1
[profile.release]
opt-level = "z"
lto = "fat"
codegen-units = 1
split-debuginfo = "unpacked"
[profile.release.build-override]
opt-level = "z"
codegen-units = 1