From 9fcd65d4e40b78cced668374ff2b9a3d38e2be3a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 9 Aug 2021 11:11:16 +0200 Subject: [PATCH] Remove dysfunctional -coverage configure argument The -coverage argument merely added compiler flags for the Qt build. It was never properly ported to the CMake build, and it doesn't seem feasible to have configure arguments for every possible compiler option. The same can be achieved by passing the needed compiler option to CMake, for example: CMAKE_CXX_FLAGS=-fsanitize-coverage=trace-pc-guard Fixes: QTBUG-86227 Change-Id: Ieef9acaedc0a839f9fb35b4403395eea28643864 Reviewed-by: Alexandru Croitor (cherry picked from commit 0e92ec972840e78b6f38d0f554ec1554edf752d1) Reviewed-by: Qt Cherry-pick Bot --- cmake/configure-cmake-mapping.md | 1 - config_help.txt | 5 ----- configure.cmake | 26 -------------------------- qt_cmdline.cmake | 1 - tests/libfuzzer/README | 2 +- 5 files changed, 1 insertion(+), 34 deletions(-) diff --git a/cmake/configure-cmake-mapping.md b/cmake/configure-cmake-mapping.md index e26380ff569..118371518db 100644 --- a/cmake/configure-cmake-mapping.md +++ b/cmake/configure-cmake-mapping.md @@ -51,7 +51,6 @@ The following table describes the mapping of configure options to CMake argument | | or -DFEATURE_ | | | -sanitize address -sanitize undefined | -DFEATURE_sanitize_address=ON | Directly setting -DECM_ENABLE_SANITIZERS=foo is not supported | | | -DFEATURE_sanitize_undefined=ON | | -| -coverage | | | | -c++std c++20 | -DFEATURE_cxx20=ON | | | -sse2/-sse3/-ssse3/-sse4.1 | -DFEATURE_sse4=ON | | | -mips_dsp/-mips_dspr2 | -DFEATURE_mips_dsp=ON | | diff --git a/config_help.txt b/config_help.txt index 09c43a580bf..bee38edda3e 100644 --- a/config_help.txt +++ b/config_help.txt @@ -106,11 +106,6 @@ Build options: for example, -sanitize address cannot be combined with -sanitize thread. - -coverage {trace-pc-guard|source-based} - Specify the 'trace-pc-guard' coverage instrumentation for - sanitizers or generate instrumented code to collect execution - counts and enable code coverage analysis, respectively. (Clang only) - -c++std .... Select C++ standard [c++20/c++17/c++14/c++11] -sse2 ................ Use SSE2 instructions [auto] diff --git a/configure.cmake b/configure.cmake index 6878b8bd55c..a7f2cd5e5c3 100644 --- a/configure.cmake +++ b/configure.cmake @@ -536,21 +536,6 @@ qt_feature("sanitizer" CONDITION QT_FEATURE_sanitize_address OR QT_FEATURE_sanitize_thread OR QT_FEATURE_sanitize_memory OR QT_FEATURE_sanitize_fuzzer_no_link OR QT_FEATURE_sanitize_undefined ) qt_feature_config("sanitizer" QMAKE_PUBLIC_CONFIG) -qt_feature("coverage_trace_pc_guard" - LABEL "trace-pc-guard" - AUTODETECT OFF -) -qt_feature_config("coverage_trace_pc_guard" QMAKE_PUBLIC_CONFIG) -qt_feature("coverage_source_based" - LABEL "source-based" - AUTODETECT OFF -) -qt_feature_config("coverage_source_based" QMAKE_PUBLIC_CONFIG) -qt_feature("coverage" - LABEL "Code Coverage Instrumentation" - CONDITION QT_FEATURE_coverage_trace_pc_guard OR QT_FEATURE_coverage_source_based -) -qt_feature_config("coverage" QMAKE_PUBLIC_CONFIG) qt_feature("plugin-manifests" LABEL "Embed manifests in plugins" AUTODETECT OFF @@ -1059,12 +1044,6 @@ qt_configure_add_summary_entry(ARGS "sanitize_memory") qt_configure_add_summary_entry(ARGS "sanitize_fuzzer_no_link") qt_configure_add_summary_entry(ARGS "sanitize_undefined") qt_configure_end_summary_section() # end of "Sanitizers" section -qt_configure_add_summary_entry( - TYPE "firstAvailableFeature" - ARGS "coverage_trace_pc_guard coverage_source_based" - MESSAGE "Code Coverage Instrumentation" - CONDITION QT_FEATURE_coverage -) qt_configure_add_summary_build_parts("Build parts") qt_configure_add_summary_entry( ARGS "appstore-compliant" @@ -1116,11 +1095,6 @@ qt_configure_add_report_entry( MESSAGE "Static builds don't support RPATH" CONDITION ( QT_FEATURE_rpath OR QT_EXTRA_RPATHS ) AND NOT QT_FEATURE_shared ) -qt_configure_add_report_entry( - TYPE ERROR - MESSAGE "Command line option -coverage is only supported with clang compilers." - CONDITION QT_FEATURE_coverage AND NOT CLANG -) qt_configure_add_report_entry( TYPE ERROR MESSAGE "Command line option -sanitize fuzzer-no-link is only supported with clang compilers." diff --git a/qt_cmdline.cmake b/qt_cmdline.cmake index 8c1bfad0b4f..24cfec31b1c 100644 --- a/qt_cmdline.cmake +++ b/qt_cmdline.cmake @@ -42,7 +42,6 @@ qt_commandline_option(c++std TYPE cxxstd) qt_commandline_option(ccache TYPE boolean NAME ccache) qt_commandline_option(commercial TYPE void) qt_commandline_option(confirm-license TYPE void) -qt_commandline_option(coverage TYPE coverage) qt_commandline_option(dbus TYPE optionalString VALUES no yes linked runtime) qt_commandline_option(dbus-linked TYPE void NAME dbus VALUE linked) qt_commandline_option(dbus-runtime TYPE void NAME dbus VALUE runtime) diff --git a/tests/libfuzzer/README b/tests/libfuzzer/README index d0ab4fdda8a..821aa262e70 100644 --- a/tests/libfuzzer/README +++ b/tests/libfuzzer/README @@ -19,7 +19,7 @@ To run a test with libFuzzer: 3. Configure Qt with -platform linux-clang -sanitize fuzzer-no-link or, if you are using clang 5 - -platform linux-clang -coverage trace-pc-guard + -platform linux-clang -- -DCMAKE_CXX_FLAGS=-fsanitize-coverage=trace-pc-guard to add the needed code coverage instrumentation. Since speed of execution is crucial for fuzz testing, it's recommendable to also use the switches -release -static