commit fbd2c0e: [Minor] Try to fix gcc sanitizers
Vsevolod Stakhov
vsevolod at highsecure.ru
Tue Nov 19 12:21:13 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-11-19 12:19:32 +0000
URL: https://github.com/rspamd/rspamd/commit/fbd2c0e1e3da12793dbf2681feac1244e9ae5485 (HEAD -> master)
[Minor] Try to fix gcc sanitizers
---
cmake/Sanitizer.cmake | 10 +++++++---
1 file 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 ()
More information about the Commits
mailing list