From ce71e703b156c0dccc5b49d3590490d6be5e05f4 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Thu, 21 Oct 2021 23:30:56 +0800 Subject: [PATCH] Try link plugin lto --- .cargo/config.toml | 51 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index fcf0e179..776e84ea 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,21 +1,62 @@ [target.x86_64-pc-windows-msvc] rustflags = ["-C", "link-args=/NODEFAULTLIB:libcmt.lib"] +[target.x86_64-apple-darwin] +rustflags = [ + "-C", + "linker-plugin-lto", + "-C", + "linker=clang", +] + +[target.x86_64-unknown-linux-gnu] +rustflags = [ + "-C", + "linker-plugin-lto", + "-C", + "linker=clang", +] + [target.aarch64-apple-darwin] -rustflags = ["-C", "target-cpu=apple-a14"] +rustflags = [ + "-C", + "target-cpu=apple-a14", + "-C", + "linker-plugin-lto", + "-C", + "linker=clang", +] [target.aarch64-unknown-linux-gnu] linker = "aarch64-linux-gnu-gcc" -rustflags = ["-C", "target-cpu=cortex-a57"] +rustflags = [ + "-C", + "target-cpu=cortex-a57", + "-C", + "linker-plugin-lto", + "-C", + "linker=clang", +] [target.armv7-unknown-linux-gnueabihf] linker = "arm-linux-gnueabihf-gcc" -rustflags = ["-C", "target-cpu=cortex-a7"] +rustflags = [ + "-C", + "target-cpu=cortex-a7", + "-C", + "linker-plugin-lto", + "-C", + "linker=clang", +] [target.x86_64-unknown-linux-musl] rustflags = [ "-C", "target-feature=-crt-static", + "-C", + "linker-plugin-lto", + "-C", + "linker=clang", ] [target.aarch64-unknown-linux-musl] @@ -25,4 +66,8 @@ rustflags = [ "target-feature=-crt-static", "-C", "target-cpu=cortex-a57", + "-C", + "linker-plugin-lto", + "-C", + "linker=clang", ]