From b2ae647a81fa71578330adca0ea9e52a3f78d05a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 28 May 2020 22:08:45 +0100 Subject: [Minor] Fix clang plugin with asan --- cmake/Sanitizer.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmake') diff --git a/cmake/Sanitizer.cmake b/cmake/Sanitizer.cmake index f955024e6..4b4df9fae 100644 --- a/cmake/Sanitizer.cmake +++ b/cmake/Sanitizer.cmake @@ -16,10 +16,10 @@ if (SANITIZE) if (SANITIZE STREQUAL "address") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope") if (COMPILER_GCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libasan") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libasan") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan") endif () @@ -28,21 +28,22 @@ if (SANITIZE) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} ${MSAN_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} ${MSAN_FLAGS}") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory") if (COMPILER_GCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libmsan") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libmsan") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libmsan") endif () elseif (SANITIZE STREQUAL "undefined") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined") + if (COMPILER_GCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libubsan") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libubsan") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libubsan") endif () -- cgit v1.2.3