toolchain: Add COMPILER_FREESTANDING to control use of -ffreestanding
Add an explicit compiler configuration, COMPILER_FREESTANDING, which controls whether the compiler should operate in freestanding or hosted mode (according to the C and C++ language specifications. This depends on having a C library which conforms with the language specification, and the minimal C library does not. Have the minimal C library select COMPILER_FREESTANDING to continue using freestanding mode with that library. For other C libraries, leave this disabled by default while allowing users to enable it if they want to go back to the previous configuration. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
e9ee6388f6
commit
6c5d806bcb
3 changed files with 11 additions and 1 deletions
|
@ -282,7 +282,7 @@ endif()
|
|||
# @Intent: Set compiler specific macro inclusion of AUTOCONF_H
|
||||
zephyr_compile_options("SHELL: $<TARGET_PROPERTY:compiler,imacros> ${AUTOCONF_H}")
|
||||
|
||||
if(NOT CONFIG_PICOLIBC)
|
||||
if(CONFIG_COMPILER_FREESTANDING)
|
||||
# @Intent: Set compiler specific flag for bare metal freestanding option
|
||||
zephyr_compile_options($<$<COMPILE_LANGUAGE:C>:$<TARGET_PROPERTY:compiler,freestanding>>)
|
||||
zephyr_compile_options($<$<COMPILE_LANGUAGE:ASM>:$<TARGET_PROPERTY:compiler,freestanding>>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue