diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-27 18:03:03 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-27 18:03:03 +0200 |
commit | e538cb095f6290c40e8928e3813db6ac679740a2 (patch) | |
tree | 51f12fad5a2928fc1d398e7f45fc40c1c09e2512 /CMakeLists.txt | |
parent | 356c149603285086d964c8a51107be97b981c15c (diff) | |
parent | 80459bcbd4ca2cfd149f58c41428882fcfc49e03 (diff) | |
download | mariadb-git-e538cb095f6290c40e8928e3813db6ac679740a2.tar.gz |
Merge 10.5 into 10.6
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a0b540f12d2..579c8a21783 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,21 +203,17 @@ OPTION(WITH_ASAN "Enable address sanitizer" OFF) IF (WITH_ASAN AND NOT MSVC) # this flag might be set by default on some OS MY_CHECK_AND_SET_COMPILER_FLAG("-U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO) - # gcc 4.8.1 and new versions of clang MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fPIC" DEBUG RELWITHDEBINFO) SET(HAVE_C_FSANITIZE ${have_C__fsanitize_address__fPIC}) SET(HAVE_CXX_FSANITIZE ${have_CXX__fsanitize_address__fPIC}) IF(HAVE_C_FSANITIZE AND HAVE_CXX_FSANITIZE) + OPTION(WITH_ASAN_SCOPE "Enable -fsanitize-address-use-after-scope" OFF) SET(WITH_ASAN_OK 1) - ELSE() - # older versions of clang - MY_CHECK_AND_SET_COMPILER_FLAG("-faddress-sanitizer -fPIC" - DEBUG RELWITHDEBINFO) - SET(HAVE_C_FADDRESS ${have_C__faddress_sanitizer__fPIC}) - SET(HAVE_CXX_FADDRESS ${have_CXX__faddress_sanitizer__fPIC}) - IF(HAVE_C_FADDRESS AND HAVE_CXX_FADDRESS) - SET(WITH_ASAN_OK 1) + IF(WITH_ASAN_SCOPE) + MY_CHECK_AND_SET_COMPILER_FLAG( + "-fsanitize=address -fsanitize-address-use-after-scope" + DEBUG RELWITHDEBINFO) ENDIF() ENDIF() |