diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-27 16:11:26 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-27 16:11:26 +0200 |
commit | 3157fa182accab86a4dea45edbcbca4eb5157723 (patch) | |
tree | 9ba82e0c489eb91efbf1e5863c5a98a29b5ea8c3 /CMakeLists.txt | |
parent | 480a06718d137c9ee7784012ccb609b9e79ff08c (diff) | |
parent | 48141f3c1787de941d969ad1e6675611b2b650c2 (diff) | |
download | mariadb-git-3157fa182accab86a4dea45edbcbca4eb5157723.tar.gz |
Merge 10.2 into 10.3
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 6cf94a01e95..14a770632ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,21 +190,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() |