File tree Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0
22
33zephyr_compile_options(
4- -fno-freestanding
54 -m32
65 -MMD
76 -MP
87 ${ARCH_FLAG}
98 -include ${ZEPHYR_BASE} /arch/posix/include /posix_cheats.h
109 )
1110
11+ # @Intent: Obtain compiler specific flags for no freestanding compilation
12+ toolchain_cc_no_freestanding_options()
13+
1214zephyr_include_directories(${BOARD_DIR} )
1315
1416zephyr_compile_options_ifdef(CONFIG_COVERAGE
Original file line number Diff line number Diff line change @@ -79,3 +79,8 @@ include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_baremetal.cmake)
7979macro (toolchain_cc_security_fortify)
8080 # No op, clang doesn't understand fortify at all
8181endmacro ()
82+
83+ macro (toolchain_cc_no_freestanding_options)
84+ # No op, this is used by the native_posix, clang has problems
85+ # compiling the native_posix with -fno-freestanding.
86+ endmacro ()
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ list(APPEND CMAKE_REQUIRED_FLAGS -nostartfiles -nostdlib ${isystem_include_flags
131131string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} " )
132132
133133# Load toolchain_cc-family macros
134+ include (${ZEPHYR_BASE} /cmake/compiler/${COMPILER} /target_freestanding.cmake)
134135include (${ZEPHYR_BASE} /cmake/compiler/${COMPILER} /target_security_fortify.cmake)
135136include (${ZEPHYR_BASE} /cmake/compiler/${COMPILER} /target_security_canaries.cmake)
136137include (${ZEPHYR_BASE} /cmake/compiler/${COMPILER} /target_optimizations.cmake)
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2019 Intel Corporation.
2+ # SPDX-License-Identifier: Apache-2.0
3+
4+ macro (toolchain_cc_no_freestanding_options)
5+
6+ zephyr_cc_option(-fno-freestanding)
7+
8+ endmacro ()
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ endforeach()
8181
8282# Load toolchain_cc-family macros
8383# Significant overlap with freestanding gcc compiler so reuse it
84+ include (${ZEPHYR_BASE} /cmake/compiler/gcc/target_freestanding.cmake)
8485include (${ZEPHYR_BASE} /cmake/compiler/gcc/target_security_fortify.cmake)
8586include (${ZEPHYR_BASE} /cmake/compiler/gcc/target_security_canaries.cmake)
8687include (${ZEPHYR_BASE} /cmake/compiler/gcc/target_optimizations.cmake)
You can’t perform that action at this time.
0 commit comments