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 <jpenix@quicinc.com>
This commit is contained in:
Jonathon Penix 2024-03-20 10:45:29 -07:00 committed by Anas Nashif
parent d6041d62b3
commit eaa903d852
1 changed files with 1 additions and 0 deletions

View File

@ -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