From e0121157db5d83cf72dec11da193fe63a07d88ce Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 21 Dec 2020 19:29:30 +0100 Subject: [PATCH] CMake: Add --enable-new-dtags flag support Remove enable-new-dtags from feature mapping, handle it as regular feature. Regenerate configure.cmake with 'enable-new-dtags' enabled. Check for enable_new_dtags feature, add -Wl,--enable-new-dtags if enabled. Fixes: QTBUG-89013 Change-Id: Ice57c02dc85f7f9ecf14e3bc65f31a57b589ce24 Reviewed-by: Joerg Bornemann Reviewed-by: Craig Scott (cherry picked from commit bbebfa0be2e51b638459d6d812e4db25a65a0d6d) Reviewed-by: Qt Cherry-pick Bot --- .prev_configure.cmake | 5 +++++ cmake/QtInternalTargets.cmake | 4 ++++ configure.cmake | 5 +++++ util/cmake/configurejson2cmake.py | 1 - 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.prev_configure.cmake b/.prev_configure.cmake index 63a9404708d..75081a87c94 100644 --- a/.prev_configure.cmake +++ b/.prev_configure.cmake @@ -635,6 +635,11 @@ qt_feature("ltcg" CONDITION __qt_ltcg_detected ) qt_feature_config("ltcg" QMAKE_PRIVATE_CONFIG) +qt_feature("enable_new_dtags" + LABEL "Using new DTAGS" + CONDITION LINUX AND TEST_enable_new_dtags +) +qt_feature_config("enable_new_dtags" QMAKE_PRIVATE_CONFIG) qt_feature("enable_gdb_index" LABEL "Generating GDB index" AUTODETECT QT_FEATURE_developer_build diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 2fd99c7be32..6a9d72450b4 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -237,6 +237,10 @@ if(QT_FEATURE_enable_gdb_index) target_link_options(PlatformCommonInternal INTERFACE "-Wl,--gdb-index") endif() +if(QT_FEATURE_enable_new_dtags) + target_link_options(PlatformCommonInternal INTERFACE "-Wl,--enable-new-dtags") +endif() + function(qt_get_implicit_sse2_genex_condition out_var) set(is_shared_lib "$,SHARED_LIBRARY>") set(is_static_lib "$,STATIC_LIBRARY>") diff --git a/configure.cmake b/configure.cmake index d65341aa1a8..d0767902c8c 100644 --- a/configure.cmake +++ b/configure.cmake @@ -648,6 +648,11 @@ qt_feature("ltcg" CONDITION __qt_ltcg_detected ) qt_feature_config("ltcg" QMAKE_PRIVATE_CONFIG) +qt_feature("enable_new_dtags" + LABEL "Using new DTAGS" + CONDITION LINUX AND TEST_enable_new_dtags +) +qt_feature_config("enable_new_dtags" QMAKE_PRIVATE_CONFIG) qt_feature("enable_gdb_index" LABEL "Generating GDB index" AUTODETECT QT_FEATURE_developer_build diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 15dc067f266..c730aa332cf 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -900,7 +900,6 @@ def get_feature_mapping(): "condition": "CMAKE_BUILD_TYPE STREQUAL Debug OR Debug IN_LIST CMAKE_CONFIGURATION_TYPES", }, "dlopen": {"condition": "UNIX"}, - "enable_new_dtags": None, "force_debug_info": { "autoDetect": "CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo OR RelWithDebInfo IN_LIST CMAKE_CONFIGURATION_TYPES" },