Skip to content

Commit 634b68f

Browse files
committed
Merge bitcoin#28532: qt: enable -ltcg for windows under LTO
f0cebbd qt: enable -ltcg for windows HOST (fanquake) Pull request description: Patch around multiple definition issues in Qt, and enable `-ltcg` when using `LTO=1`. Split from bitcoin#25391. ACKs for top commit: hebasto: ACK f0cebbd Tree-SHA512: 2d6e34779f360bf6dfea4f70fc9004a16e95da79716fcb3046afbf2b01317b7e16965cb51b967b7b5fb64549306c5f48cf59082884289c52016bc1e86949e062
2 parents 54bdb6e + f0cebbd commit 634b68f

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

depends/packages/qt.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ $(package)_patches += fast_fixed_dtoa_no_optimize.patch
2222
$(package)_patches += guix_cross_lib_path.patch
2323
$(package)_patches += fix-macos-linker.patch
2424
$(package)_patches += memory_resource.patch
25+
$(package)_patches += windows_lto.patch
2526

2627
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
2728
$(package)_qttranslations_sha256_hash=38b942bc7e62794dd072945c8a92bb9dfffed24070aea300327a3bb42f855609
@@ -183,6 +184,9 @@ $(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'"
183184
$(package)_config_opts_mingw32 += "QMAKE_LIB = '$($(package)_ar) rc'"
184185
$(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-"
185186
$(package)_config_opts_mingw32 += -pch
187+
ifneq ($(LTO),)
188+
$(package)_config_opts_mingw32 += -ltcg
189+
endif
186190

187191
$(package)_config_opts_android = -xplatform android-clang
188192
$(package)_config_opts_android += -android-sdk $(ANDROID_SDK)
@@ -250,6 +254,7 @@ define $(package)_preprocess_cmds
250254
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
251255
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
252256
patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \
257+
patch -p1 -i $($(package)_patch_dir)/windows_lto.patch && \
253258
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
254259
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
255260
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \

depends/patches/qt/windows_lto.patch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Qt (for Windows) fails to build under LTO, due to multiple definition issues, i.e
2+
3+
multiple definition of `QAccessibleLineEdit::~QAccessibleLineEdit()';
4+
5+
Possibly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94156.
6+
7+
diff --git a/qtbase/src/widgets/accessible/simplewidgets.cpp b/qtbase/src/widgets/accessible/simplewidgets.cpp
8+
index 107fd729fe..0e61878f39 100644
9+
--- a/qtbase/src/widgets/accessible/simplewidgets.cpp
10+
+++ b/qtbase/src/widgets/accessible/simplewidgets.cpp
11+
@@ -109,6 +109,8 @@ QString qt_accHotKey(const QString &text);
12+
\ingroup accessibility
13+
*/
14+
15+
+QAccessibleLineEdit::~QAccessibleLineEdit(){};
16+
+
17+
/*!
18+
Creates a QAccessibleButton object for \a w.
19+
*/
20+
diff --git a/qtbase/src/widgets/accessible/simplewidgets_p.h b/qtbase/src/widgets/accessible/simplewidgets_p.h
21+
index 73572e3059..658da86143 100644
22+
--- a/qtbase/src/widgets/accessible/simplewidgets_p.h
23+
+++ b/qtbase/src/widgets/accessible/simplewidgets_p.h
24+
@@ -155,6 +155,7 @@ class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInte
25+
public:
26+
explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
27+
28+
+ ~QAccessibleLineEdit();
29+
QString text(QAccessible::Text t) const override;
30+
void setText(QAccessible::Text t, const QString &text) override;
31+
QAccessible::State state() const override;

0 commit comments

Comments
 (0)