commit 19161c5: [Minor] Respect full debug request in sanitizers config

Vsevolod Stakhov vsevolod at rspamd.com
Mon Sep 19 12:49:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-09-19 11:49:17 +0100
URL: https://github.com/rspamd/rspamd/commit/19161c5a95bdcb3130df10410ab0b36e29c8d589

[Minor] Respect full debug request in sanitizers config

---
 cmake/Sanitizer.cmake | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/cmake/Sanitizer.cmake b/cmake/Sanitizer.cmake
index 58a240f6f..b13e418e3 100644
--- a/cmake/Sanitizer.cmake
+++ b/cmake/Sanitizer.cmake
@@ -4,9 +4,17 @@ option (SANITIZE "Enable sanitizer: address, memory, undefined, leak (comma sepa
 set (SAN_FLAGS "${SAN_FLAGS} -g -fno-omit-frame-pointer -DSANITIZER")
 # O1 is normally set by clang, and -Og by gcc
 if (COMPILER_GCC)
-    set (SAN_FLAGS "${SAN_FLAGS} -Og")
+    if (ENABLE_FULL_DEBUG MATCHES "ON")
+        set (SAN_FLAGS "${SAN_FLAGS} -O0")
+    else()
+        set (SAN_FLAGS "${SAN_FLAGS} -Og")
+    endif()
 else ()
-    set (SAN_FLAGS "${SAN_FLAGS} -O1")
+    if (ENABLE_FULL_DEBUG MATCHES "ON")
+        set (SAN_FLAGS "${SAN_FLAGS} -O0")
+    else()
+        set (SAN_FLAGS "${SAN_FLAGS} -O1")
+    endif()
 endif ()
 if (SANITIZE)
     if (ENABLE_JEMALLOC MATCHES "ON")


More information about the Commits mailing list