Skip to content

Commit 1a32c2b

Browse files
authored
Fix compilation under gcc 13 (#1039)
* Update qt.mk add a patch to fix compilation on gcc 13 * add includes for std::runtime_error and uint8
1 parent 35a1473 commit 1a32c2b

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

depends/packages/qt.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $(package)_dependencies=openssl zlib
88
$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext
99
$(package)_build_subdir=qtbase
1010
$(package)_qt_libs=corelib network widgets gui plugins testlib concurrent
11-
$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch xkb-default.patch
11+
$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch xkb-default.patch fix_limits_header.patch
1212

1313
# Update OSX_QT_TRANSLATIONS when this is updated
1414
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
@@ -139,6 +139,7 @@ define $(package)_preprocess_cmds
139139
patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch &&\
140140
patch -p1 -i $($(package)_patch_dir)/fix_rcc_determinism.patch &&\
141141
patch -p1 -i $($(package)_patch_dir)/xkb-default.patch &&\
142+
patch -p1 -i $($(package)_patch_dir)/fix_limits_header.patch &&\
142143
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
143144
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
144145
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+

src/support/lockedpool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#endif
2323

2424
#include <algorithm>
25+
#include <stdexcept>
2526

2627
LockedPoolManager* LockedPoolManager::_instance = nullptr;
2728
std::once_flag LockedPoolManager::init_flag;

src/veil/mnemonic/mnemonic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define MNEMONIC_H
2222

2323
#include <cstddef>
24+
#include <cstdint>
2425
#include <string>
2526
#include <vector>
2627
#include <array>

0 commit comments

Comments
 (0)