diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-06-24 11:52:06 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-25 10:39:56 +0000 |
commit | ff2e4c96211c8f8547025116fa9dd275a9aafd50 (patch) | |
tree | 279a3ae4eecf6e42f43b63d2c078bd3fe2446582 | |
parent | c4d07c4d42163a8844424568d050acd308fc4bba (diff) |
CMake: Restore Qt-custom sanitizer additions to ECMEnableSanitizers
Restores addition of 'float-divide-by-zero' to undefined sanitizer
flags as well as the custom fuzzer-no-link option.
Task-number: QTBUG-87989
Change-Id: Icde1e5d31083ce1b6128ab45b0e9df5ae69736a3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8c1a35a991bf655c836060b73f875f565920911a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake b/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake index 84f1819c13..dcdb8621d3 100644 --- a/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake +++ b/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake @@ -44,6 +44,7 @@ The options are: - thread - leak - undefined +- fuzzer-no-link - fuzzer The sanitizers "address", "memory" and "thread" are mutually exclusive. You @@ -130,7 +131,11 @@ macro (enable_sanitizer_flags sanitize_option) set(XSAN_LINKER_FLAGS "lsan") elseif (${sanitize_option} MATCHES "undefined") check_compiler_version("4.9" "3.1" "99.99") - set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls") + set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-omit-frame-pointer -fno-optimize-sibling-calls") + elseif (${sanitize_option} MATCHES "fuzzer-no-link") + check_compiler_version("99.99" "6.0" "99.99") + set(XSAN_COMPILE_FLAGS "-fsanitize=fuzzer-no-link") + set(XSAN_LINKER_FLAGS "-fsanitize=fuzzer-no-link") elseif (${sanitize_option} MATCHES "fuzzer") check_compiler_version("99.99" "6.0" "99.99") set(XSAN_COMPILE_FLAGS "-fsanitize=fuzzer") |