From 5b9ed1ad35b2e51c4b7129adf56ffc4747666a69 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Tue, 17 Oct 2023 18:11:15 -0400 Subject: [PATCH] Use LTO --- .cargo/config.toml | 4 ++++ Cargo.toml | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index fe26b9b0edcd..6d227bd9f56e 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -7,3 +7,7 @@ ar = "x86_64-w64-mingw32-gcc-ar" # enabled for the target, so let's turn that on here. [target.x86_64-pc-windows-msvc] rustflags = "-C target-feature=+crt-static" + +[aarch64-unknown-linux-gnu] +rustflags = ["-C", "linker-plugin-lto", "-C", "link-arg=-fuse-ld=lld"] + diff --git a/Cargo.toml b/Cargo.toml index ccc935819db5..597bcca7cb90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,16 +11,16 @@ members = [ "wezterm-gui", "wezterm-mux-server", "wezterm-open-url", - "wezterm-ssh" + "wezterm-ssh", ] resolver = "2" -exclude = [ - "termwiz/codegen" -] +exclude = ["termwiz/codegen"] [profile.release] opt-level = 3 # debug = 2 +lto = "fat" +codegen-units = 1 [profile.dev] # https://jakedeichert.com/blog/reducing-rust-incremental-compilation-times-on-macos-by-70-percent/ @@ -28,6 +28,8 @@ opt-level = 3 #split-debuginfo = "unpacked" [patch.crates-io] +xcb = { git = "https://github.com/rust-x-bindings/rust-xcb", rev = "dbdaa01c178c6fbe68bd51b7ad44c08172181083" } # waiting on a release with https://github.com/rust-x-bindings/rust-xcb/pull/230 + # We use our own vendored cairo, which has minimal deps and should just # build via cargo. -cairo-sys-rs = {path="deps/cairo", version="0.18.0"} +cairo-sys-rs = { path = "deps/cairo", version = "0.18.0" }