diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-19 12:19:32 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-19 12:19:32 +0000 |
commit | fbd2c0e1e3da12793dbf2681feac1244e9ae5485 (patch) | |
tree | a73f46b33768d634b307db576cf6a79226b30f36 /cmake | |
parent | 6f8ef41cd56335173b24e5e141a3cd85ee8a15b5 (diff) | |
download | rspamd-fbd2c0e1e3da12793dbf2681feac1244e9ae5485.tar.gz rspamd-fbd2c0e1e3da12793dbf2681feac1244e9ae5485.zip |
[Minor] Try to fix gcc sanitizers
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Sanitizer.cmake | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/Sanitizer.cmake b/cmake/Sanitizer.cmake index 34ef288a7..73d72da8d 100644 --- a/cmake/Sanitizer.cmake +++ b/cmake/Sanitizer.cmake @@ -16,6 +16,8 @@ if (SANITIZE) 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") 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 () @@ -27,6 +29,8 @@ if (SANITIZE) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} ${MSAN_FLAGS}") 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 () @@ -34,10 +38,10 @@ if (SANITIZE) 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") - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + 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") - endif() - if (CMAKE_C_COMPILER_ID STREQUAL "GNU") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libubsan") endif () |