gcc/picolibc: Disable -fprintf-return-value when printf is not complete
GCC will compute expected sprintf (et al) return values internally and use them in place of the actual return value. When the printf implementation has reduced functionality, gcc may compute a different value. For picolibc, this means disabling the optimization unless floating point output is enabled. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
cb5c440525
commit
b3073f0099
3 changed files with 9 additions and 0 deletions
|
@ -275,6 +275,11 @@ if(NOT CONFIG_PICOLIBC)
|
|||
zephyr_compile_options($<$<COMPILE_LANGUAGE:ASM>:$<TARGET_PROPERTY:compiler,freestanding>>)
|
||||
endif()
|
||||
|
||||
if (CONFIG_PICOLIBC AND NOT CONFIG_PICOLIBC_IO_FLOAT)
|
||||
# @Intent: Set compiler specific flag to disable printf-related optimizations
|
||||
zephyr_compile_options($<$<COMPILE_LANGUAGE:C>:$<TARGET_PROPERTY:compiler,no_printf_return_value>>)
|
||||
endif()
|
||||
|
||||
# @Intent: Set compiler specific flag for tentative definitions, no-common
|
||||
zephyr_compile_options($<TARGET_PROPERTY:compiler,no_common>)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue