From eaa903d8526f680bbe3eed4eee636b8280582cbd Mon Sep 17 00:00:00 2001 From: Jonathon Penix Date: Wed, 20 Mar 2024 10:45:29 -0700 Subject: [PATCH] kconfig: llvm: Set default opt level to -Oz when building with LLVM Experimentally, -Oz seems to give size results closer to GCC's -Os (though GCC does now support -Oz as well). Set -Oz as the default for LLVM to give the better codesize. Signed-off-by: Jonathon Penix --- Kconfig.zephyr | 1 + 1 file changed, 1 insertion(+) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 5e6694b1c21..3cab0519b45 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -478,6 +478,7 @@ choice COMPILER_OPTIMIZATIONS prompt "Optimization level" default NO_OPTIMIZATIONS if COVERAGE default DEBUG_OPTIMIZATIONS if DEBUG + default SIZE_OPTIMIZATIONS_AGGRESSIVE if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm" default SIZE_OPTIMIZATIONS help Note that these flags shall only control the compiler