From c8c8299a636c25fc44d07c5444849fe8ac9021e1 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Tue, 7 Nov 2023 16:16:24 +0100 Subject: [PATCH] Re-enable LTO for gcc versions >= 10 Assume the related GCC version is fixed. Fixes: QTBUG-118851 Change-Id: I0160440c5e8a0341ec5bc2ab9ea6fed9a2325bba Reviewed-by: Thiago Macieira --- src/corelib/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index e7d93e63ac..79846a0858 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -464,11 +464,15 @@ qt_internal_extend_target(Core SOURCES ${core_version_tagging_files} ) -# Disable LTO, as the symbols disappear somehow under GCC -# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200) + if(GCC) - set_source_files_properties(${core_version_tagging_files} - PROPERTIES COMPILE_OPTIONS "-fno-lto") + # Disable LTO, as the symbols disappear somehow under GCC + # (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200) + # The issue should be fixed in GCC >= 10 + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) + set_source_files_properties(${core_version_tagging_files} + PROPERTIES COMPILE_OPTIONS "-fno-lto") + endif() endif() qt_internal_extend_target(Core