diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/compiler/clang/settings.cmake | 48 | ||||
-rw-r--r-- | cmake/showoptions.cmake | 21 |
2 files changed, 68 insertions, 1 deletions
diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake index 2bd16a57579..896dd0ef157 100644 --- a/cmake/compiler/clang/settings.cmake +++ b/cmake/compiler/clang/settings.cmake @@ -74,7 +74,53 @@ if(ASAN) -fsanitize-recover=address -fsanitize-address-use-after-scope) - message(STATUS "Clang: Enabled Address Sanitizer") + message(STATUS "Clang: Enabled Address Sanitizer ASan") +endif() + +if(MSAN) + target_compile_options(trinity-compile-option-interface + INTERFACE + -fno-omit-frame-pointer + -fsanitize=memory + -fsanitize-memory-track-origins + -mllvm + -msan-keep-going=1) + + target_link_options(trinity-compile-option-interface + INTERFACE + -fno-omit-frame-pointer + -fsanitize=memory + -fsanitize-memory-track-origins) + + message(STATUS "Clang: Enabled Memory Sanitizer MSan") +endif() + +if(UBSAN) + target_compile_options(trinity-compile-option-interface + INTERFACE + -fno-omit-frame-pointer + -fsanitize=undefined) + + target_link_options(trinity-compile-option-interface + INTERFACE + -fno-omit-frame-pointer + -fsanitize=undefined) + + message(STATUS "Clang: Enabled Undefined Behavior Sanitizer UBSan") +endif() + +if(TSAN) + target_compile_options(trinity-compile-option-interface + INTERFACE + -fno-omit-frame-pointer + -fsanitize=thread) + + target_link_options(trinity-compile-option-interface + INTERFACE + -fno-omit-frame-pointer + -fsanitize=thread) + + message(STATUS "Clang: Enabled Thread Sanitizer TSan") endif() # -Wno-narrowing needed to suppress a warning in g3d diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index f9bfa1f33fa..004e28e308e 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -122,6 +122,27 @@ if(ASAN) add_definitions(-DASAN) endif() +if(MSAN) + message("") + message(" *** MSAN - WARNING!") + message(" *** Please note that this is for DEBUGGING WITH MEMORY SANITIZER only!") + add_definitions(-DMSAN) +endif() + +if(UBSAN) + message("") + message(" *** UBSAN - WARNING!") + message(" *** Please note that this is for DEBUGGING WITH UNDEFINED BEHAVIOR SANITIZER only!") + add_definitions(-DUBSAN) +endif() + +if(TSAN) + message("") + message(" *** TSAN - WARNING!") + message(" *** Please note that this is for DEBUGGING WITH THREAD SANITIZER only!") + add_definitions(-DTSAN -DNO_BUFFERPOOL) +endif() + if(PERFORMANCE_PROFILING) message("") message(" *** PERFORMANCE_PROFILING - WARNING!") |