Skip to content

Commit 38b0291

Browse files
committed
riscv: Use -O2 by default for riscv
gcc 14.3 has bus compiling with -Os on riscv, use -O2 by default. Is there some way to prevent applications from selecting -Os? Signed-off-by: Keith Packard <[email protected]>
1 parent 3fffe46 commit 38b0291

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/zephyr/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ config PICOLIBC_DEFAULT
2323
help
2424
Zephyr SDK >=0.17.1 always uses Picolibc
2525

26+
# libstdc++ is built without exception support in -Os mode
27+
# gcc 14.3 has bugs compiling with -Os on riscv
2628
choice COMPILER_OPTIMIZATIONS
2729
default SPEED_OPTIMIZATIONS if ("$(TOOLCHAIN_VARIANT_COMPILER)" = "gnu") && CPP_EXCEPTIONS
30+
default SPEED_OPTIMIZATIONS if ("$(TOOLCHAIN_VARIANT_COMPILER)" = "gnu") && RISCV
2831
endchoice

0 commit comments

Comments
 (0)