Skip to content

Commit 92584d2

Browse files
committed
Merge bitcoin/bitcoin#22186: build, qt: Fix compiling qt package in depends with GCC 11
d1d1cc9 build, qt: Fix compiling qt package in depends with GCC 11 (Hennadii Stepanov) Pull request description: The `qt` package in depends fails to compile with GCC 11 due to the missed `<limits>` headers. See: https://bugreports.qt.io/browse/QTBUG-90395 Affected systems: - Ubuntu 21.04 + GCC 11.1.0 - Fedora 34 + GCC 11.1.1 Ubuntu 21.04 build log excerpt: ``` Configuring qt... Creating qmake... gmake[1]: Entering directory '/home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.12.11-1ff5c6c1f55/qtbase/qmake' In file included from /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.12.11-1ff5c6c1f55/qtbase/include/QtCore/qendian.h:1, from /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.12.11-1ff5c6c1f55/qtbase/src/corelib/codecs/qutfcodec.cpp:43: /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.12.11-1ff5c6c1f55/qtbase/include/QtCore/../../src/corelib/global/qendian.h: In static member function ‘static constexpr QSpecialInteger<S> QSpecialInteger<S>::max()’: /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.12.11-1ff5c6c1f55/qtbase/include/QtCore/../../src/corelib/global/qendian.h:331:35: error: ‘numeric_limits’ is not a member of ‘std’ 331 | { return QSpecialInteger(std::numeric_limits<T>::max()); } | ^~~~~~~~~~~~~~ /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.12.11-1ff5c6c1f55/qtbase/include/QtCore/../../src/corelib/global/qendian.h:331:54: error: ‘::max’ has not been declared; did you mean ‘std::max’? 331 | { return QSpecialInteger(std::numeric_limits<T>::max()); } | ^~~ | std::max ``` ACKs for top commit: fanquake: ACK d1d1cc9 Tree-SHA512: 2dd643efc0aefc492f9565c0900ba0f1657c016bc4a44792f85478b9fc6e0e4ecad78847114ef6ec702d2de4cdbc3f657e9b96634ea58f42b6cc98dfb5e09eab
2 parents 46424e9 + d1d1cc9 commit 92584d2

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

depends/packages/qt.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_no_printer.patch no
1010
$(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch
1111
$(package)_patches+= drop_lrelease_dependency.patch no_sdk_version_check.patch
1212
$(package)_patches+= fix_lib_paths.patch fix_android_pch.patch
13-
$(package)_patches+= qtbase-moc-ignore-gcc-macro.patch
13+
$(package)_patches+= qtbase-moc-ignore-gcc-macro.patch fix_limits_header.patch
1414

1515
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
1616
$(package)_qttranslations_sha256_hash=577b0668a777eb2b451c61e8d026d79285371597ce9df06b6dee6c814164b7c3
@@ -231,6 +231,7 @@ define $(package)_preprocess_cmds
231231
patch -p1 -i $($(package)_patch_dir)/no_sdk_version_check.patch && \
232232
patch -p1 -i $($(package)_patch_dir)/fix_lib_paths.patch && \
233233
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
234+
patch -p1 -i $($(package)_patch_dir)/fix_limits_header.patch && \
234235
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
235236
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
236237
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Fix compiling with GCC 11
2+
3+
See: https://bugreports.qt.io/browse/QTBUG-90395.
4+
5+
Upstream commits:
6+
- Qt 5.15 -- unavailable as open source
7+
- Qt 6.0: b2af6332ea37e45ab230a7a5d2d278f86d961b83
8+
- Qt 6.1: 9c56d4da2ff631a8c1c30475bd792f6c86bda53c
9+
10+
--- old/qtbase/src/corelib/global/qendian.h
11+
+++ new/qtbase/src/corelib/global/qendian.h
12+
@@ -44,6 +44,8 @@
13+
#include <QtCore/qfloat16.h>
14+
#include <QtCore/qglobal.h>
15+
16+
+#include <limits>
17+
+
18+
// include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems
19+
#include <stdlib.h>
20+
#include <string.h>
21+
22+
--- old/qtbase/src/corelib/tools/qbytearraymatcher.h
23+
+++ new/qtbase/src/corelib/tools/qbytearraymatcher.h
24+
@@ -42,6 +42,8 @@
25+
26+
#include <QtCore/qbytearray.h>
27+
28+
+#include <limits>
29+
+
30+
QT_BEGIN_NAMESPACE
31+
32+
33+
34+
--- old/qtbase/src/tools/moc/generator.cpp
35+
+++ new/qtbase/src/tools/moc/generator.cpp
36+
@@ -40,6 +40,8 @@
37+
#include <QtCore/qplugin.h>
38+
#include <QtCore/qstringview.h>
39+
40+
+#include <limits>
41+
+
42+
#include <math.h>
43+
#include <stdio.h>
44+

0 commit comments

Comments
 (0)