mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 03:47:17 +02:00
MDEV-17703 Add WITH_UBSAN switch to CMake similar to WITH_ASAN
This can be useful: UBSAN_OPTIONS=log_path=/some/path clang users may want to increase stack size in include/my_pthread.h or enable some optimizations
This commit is contained in:
parent
0415021840
commit
2a2ab121b0
3 changed files with 11 additions and 2 deletions
|
|
@ -214,6 +214,15 @@ IF (WITH_ASAN)
|
|||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
OPTION(WITH_UBSAN "Enable undefined behavior sanitizer" OFF)
|
||||
IF (WITH_UBSAN)
|
||||
IF(SECURITY_HARDENED)
|
||||
MESSAGE(FATAL_ERROR "WITH_UBSAN and SECURITY_HARDENED are mutually exclusive")
|
||||
ENDIF()
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=undefined" DEBUG RELWITHDEBINFO)
|
||||
ENDIF()
|
||||
|
||||
|
||||
# enable security hardening features, like most distributions do
|
||||
# in our benchmarks that costs about ~1% of performance, depending on the load
|
||||
IF(CMAKE_C_COMPILER_VERSION VERSION_LESS "4.6")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue