From 2f7cc6fc38a51aa143c9cadd0bae8fadbc611775 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 6 Aug 2020 10:32:03 +0800 Subject: [PATCH] tune compiler optimizations --- src/Cargo.toml | 9 ++------- src/szl/build.rs | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Cargo.toml b/src/Cargo.toml index 9a53d0b7..7fa94ebe 100644 --- a/src/Cargo.toml +++ b/src/Cargo.toml @@ -9,17 +9,12 @@ members = [ "szl" ] -[profile.dev] -panic = "abort" -lto = false - [profile.release] panic = "abort" debug = true -# Link-Time Optimization: -# turn off if you get unusable debug symbols. +codegen-units = 1 +opt-level = 'z' lto = true -opt-level = 'z' # Optimize for size. [patch.crates-io] core_io = { path = "./libcoreio" } diff --git a/src/szl/build.rs b/src/szl/build.rs index a02dfd01..2fe03fc3 100644 --- a/src/szl/build.rs +++ b/src/szl/build.rs @@ -32,7 +32,7 @@ pub fn compile_unlzma() { cfg.flag("-fPIC"); cfg.flag("-fno-stack-protector"); cfg.flag("--target=armv7-none-eabihf"); - cfg.flag("-O2"); + cfg.flag("-Os"); let sources = vec![ "unlzma.c",