From 895c0c11da8e42a4e2177e69cd318c9db26c166c Mon Sep 17 00:00:00 2001 From: jD91mZM2 Date: Sat, 1 Aug 2020 13:19:12 +0200 Subject: [PATCH] Use cargo for lto over manually entering rustflags --- .cargo/config | 5 ++++- Cargo.toml | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.cargo/config b/.cargo/config index 7e83464..fc260d9 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,2 +1,5 @@ [build] -rustflags = ["-Cembed-bitcode=yes"] +rustflags = [ + # Kernel should preserve floating-point registers + "-Csoft-float", +] diff --git a/Cargo.toml b/Cargo.toml index b6bccec..8630f68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,3 +44,13 @@ qemu_debug = [] serial_debug = [] system76_ec_debug = [] slab = ["slab_allocator"] + +[profile.dev] +# Kernel doesn't yet work great with debug mode :( +opt-level = 3 + +# LTO fixes some duplicate symbols of memcpy/memmove/etc +lto = true + +[profile.release] +lto = true