diff options
author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2020-12-06 17:52:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-06 17:52:13 +0100 |
commit | a4e93d779c9638bc0a61cb4405ef28cb935d1065 (patch) | |
tree | 5ef8f6c87f056f6263fb5793b582af0f0e6f5e48 /cmake/compiler/clang | |
parent | 0800055005d708520a9665b53a17264471e7401e (diff) |
Improve multithreading of mmaps_generator (#25625)
* Build/Misc: Add a few *San CMake flags
Add the following flags for the related tools:
- MSAN for Memory Sanitizer
- UBSAN for Undefined Behavior Sanitizer
- TSAN for Thread Sanitizer
* Remove unused parameter
* Fix UBSan reported issue
* Disable G3D buffer pools when using Thread Sanitizer as it has its custom locking mechanisms
* Code cleanup
* Move threads from maps to tiles
* Move tile building logic to TileBuilder class
* Fix memory leak in TileBuilder
* Fix build
* Store TileBuilder as raw pointer for now, it will be changed later on to use modern C++ constructs
* Fix crash on shutdown
* Revert pvs-studio change
* Fix generating 1 single tile not closing the program
Diffstat (limited to 'cmake/compiler/clang')
-rw-r--r-- | cmake/compiler/clang/settings.cmake | 48 |
1 files changed, 47 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 |