From ff2e4c96211c8f8547025116fa9dd275a9aafd50 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 24 Jun 2021 11:52:06 +0200 Subject: [PATCH] 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 Reviewed-by: Joerg Bornemann (cherry picked from commit 8c1a35a991bf655c836060b73f875f565920911a) Reviewed-by: Qt Cherry-pick Bot --- .../extra-cmake-modules/modules/ECMEnableSanitizers.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake b/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake index 84f1819c136..dcdb8621d35 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")