From a3999243a107e50ff06cb84cacf852d55a20a6e7 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakivskyy Date: Fri, 8 Mar 2019 13:39:32 +0200 Subject: [PATCH] cmake: clang: Don't unconditionally use gcc's fortify clang doesn't understand fortify at all, provide no op macro, in order to handle the request to fortify in a generic way. Signed-off-by: Oleg Zhurakivskyy --- cmake/compiler/clang/target.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/compiler/clang/target.cmake b/cmake/compiler/clang/target.cmake index 38e28978fad..660b36c4969 100644 --- a/cmake/compiler/clang/target.cmake +++ b/cmake/compiler/clang/target.cmake @@ -63,9 +63,12 @@ string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") # Load toolchain_cc-family macros # Clang and GCC are almost feature+flag compatible, so reuse freestanding gcc -include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_security_fortify.cmake) include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_security_canaries.cmake) include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_optimizations.cmake) include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_cpp.cmake) include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_asm.cmake) include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_baremetal.cmake) + +macro(toolchain_cc_security_fortify) + # No op, clang doesn't understand fortify at all +endmacro()