zephyr/cmake/compiler/gcc/target_sanitizers.cmake
Jan Van Winkel 23a866b828 cmake: toolchain abstraction for undefined behaviour sanitizer
Added toolchain abstraction for undefined behaviour sanitizer

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-10-07 15:00:20 +02:00

17 lines
313 B
CMake

# SPDX-License-Identifier: Apache-2.0
macro(toolchain_cc_asan)
zephyr_compile_options(-fsanitize=address)
zephyr_link_libraries(-lasan)
zephyr_ld_options(-fsanitize=address)
endmacro()
macro(toolchain_cc_ubsan)
zephyr_compile_options(-fsanitize=undefined)
zephyr_ld_options(-fsanitize=undefined)
endmacro()