Skip to content

Commit

Permalink
Fix compilation under gcc 13 (#1039)
Browse files Browse the repository at this point in the history
* Update qt.mk

add a patch to fix compilation on gcc 13

* add includes for std::runtime_error and uint8
  • Loading branch information
philmb3487 authored Aug 7, 2024
1 parent 35a1473 commit 1a32c2b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $(package)_dependencies=openssl zlib
$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext
$(package)_build_subdir=qtbase
$(package)_qt_libs=corelib network widgets gui plugins testlib concurrent
$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch xkb-default.patch
$(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

# Update OSX_QT_TRANSLATIONS when this is updated
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
Expand Down Expand Up @@ -139,6 +139,7 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch &&\
patch -p1 -i $($(package)_patch_dir)/fix_rcc_determinism.patch &&\
patch -p1 -i $($(package)_patch_dir)/xkb-default.patch &&\
patch -p1 -i $($(package)_patch_dir)/fix_limits_header.patch &&\
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
Expand Down
33 changes: 33 additions & 0 deletions depends/patches/qt/fix_limits_header.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Fix compiling with GCC 11

See: https://bugreports.qt.io/browse/QTBUG-90395.

Upstream commits:
- Qt 5.15 -- unavailable as open source
- Qt 6.0: b2af6332ea37e45ab230a7a5d2d278f86d961b83
- Qt 6.1: 9c56d4da2ff631a8c1c30475bd792f6c86bda53c

--- old/qtbase/src/corelib/global/qendian.h
+++ new/qtbase/src/corelib/global/qendian.h
@@ -44,6 +44,8 @@
#include <QtCore/qfloat16.h>
#include <QtCore/qglobal.h>

+#include <limits>
+
// include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems
#include <stdlib.h>
#include <string.h>

--- old/qtbase/src/corelib/tools/qbytearraymatcher.h
+++ new/qtbase/src/corelib/tools/qbytearraymatcher.h
@@ -42,6 +42,8 @@

#include <QtCore/qbytearray.h>

+#include <limits>
+
QT_BEGIN_NAMESPACE



1 change: 1 addition & 0 deletions src/support/lockedpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#endif

#include <algorithm>
#include <stdexcept>

LockedPoolManager* LockedPoolManager::_instance = nullptr;
std::once_flag LockedPoolManager::init_flag;
Expand Down
1 change: 1 addition & 0 deletions src/veil/mnemonic/mnemonic.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define MNEMONIC_H

#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>
#include <array>
Expand Down

0 comments on commit 1a32c2b

Please sign in to comment.