Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build dependencies (boost, qt) with gcc-11 #990

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion depends/packages/boost.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(package)_version=1_70_0
$(package)_download_path=https://dl.bintray.com/boostorg/release/1.70.0/source/
$(package)_file_name=boost_$($(package)_version).tar.bz2
$(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778
$(package)_patches=unused_var_in_process.patch
$(package)_patches=unused_var_in_process.patch ignore_wnonnull_gcc_11.patch commit-74fb0a2.patch commit-f9d0e59.patch

define $(package)_set_vars
$(package)_config_opts_release=variant=release
Expand Down Expand Up @@ -34,6 +34,9 @@ endef

define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/unused_var_in_process.patch && \
patch -p2 -i $($(package)_patch_dir)/ignore_wnonnull_gcc_11.patch && \
patch -p2 -i $($(package)_patch_dir)/commit-74fb0a2.patch && \
patch -p2 -i $($(package)_patch_dir)/commit-f9d0e59.patch && \
echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
endef

Expand Down
3 changes: 3 additions & 0 deletions depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch
$(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch
$(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch
$(package)_patches+= freetype_back_compat.patch drop_lrelease_dependency.patch fix_powerpc_libpng.patch
$(package)_patches+= fix_limits_header.patch


# Update OSX_QT_TRANSLATIONS when this is updated
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
Expand Down Expand Up @@ -217,6 +219,7 @@ define $(package)_preprocess_cmds
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
patch -p1 -i $($(package)_patch_dir)/fix_riscv64_arch.patch &&\
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch &&\
patch -p1 -i $($(package)_patch_dir)/fix_limits_header.patch && \
echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.conf &&\
echo "QMAKE_LINK_OBJECT_SCRIPT = object_script" >> qtbase/mkspecs/win32-g++/qmake.conf &&\
sed -i.old "s|QMAKE_CFLAGS += |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
Expand Down
19 changes: 19 additions & 0 deletions depends/patches/boost/commit-74fb0a2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From 74fb0a26099bc51d717f5f154b37231ce7df3e98 Mon Sep 17 00:00:00 2001
From: Rob Boehne <robb@datalogics.com>
Date: Wed, 20 Nov 2019 11:25:20 -0600
Subject: Revert change to elide a warning that caused Solaris builds to fail.


diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp
index aefbeb43..bc9b1367 100644
--- a/include/boost/thread/pthread/thread_data.hpp
+++ b/include/boost/thread/pthread/thread_data.hpp
@@ -57,7 +57,7 @@ namespace boost
#else
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
#endif
-#if PTHREAD_STACK_MIN > 0
+#ifdef PTHREAD_STACK_MIN
if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
#endif
size = ((size+page_size-1)/page_size)*page_size;
26 changes: 26 additions & 0 deletions depends/patches/boost/commit-f9d0e59.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From f9d0e594d43afcb4ab0043117249feb266ba4515 Mon Sep 17 00:00:00 2001
From: Romain Geissler <romain.geissler@amadeus.com>
Date: Tue, 10 Aug 2021 14:22:28 +0000
Subject: Fix -Wsign-compare warning with glibc 2.34 on Linux platforms.

In file included from /data/mwrep/res/osp/Boost/21-0-0-0/include/boost/thread/thread_only.hpp:17,
from /data/mwrep/res/osp/Boost/21-0-0-0/include/boost/thread/thread.hpp:12,
from src/GetTest.cpp:12:
/data/mwrep/res/osp/Boost/21-0-0-0/include/boost/thread/pthread/thread_data.hpp: In member function 'void boost::thread_attributes::set_stack_size(std::size_t)':
/data/mwrep/res/osp/Boost/21-0-0-0/include/boost/thread/pthread/thread_data.hpp:61:19: error: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'long int' [-Werror=sign-compare]
61 | if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
| ^

diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp
index bc9b1367..c43b276d 100644
--- a/include/boost/thread/pthread/thread_data.hpp
+++ b/include/boost/thread/pthread/thread_data.hpp
@@ -58,7 +58,7 @@ namespace boost
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
#endif
#ifdef PTHREAD_STACK_MIN
- if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
+ if (size<static_cast<std::size_t>(PTHREAD_STACK_MIN)) size=PTHREAD_STACK_MIN;
#endif
size = ((size+page_size-1)/page_size)*page_size;
int res = pthread_attr_setstacksize(&val_, size);
68 changes: 68 additions & 0 deletions depends/patches/boost/ignore_wnonnull_gcc_11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
diff --git a/include/boost/concept/detail/general.hpp b/include/boost/concept/detail/general.hpp
index eeb08750..8d7d6f69 100644
--- a/include/boost/concept/detail/general.hpp
+++ b/include/boost/concept/detail/general.hpp
@@ -28,7 +28,14 @@ namespace detail
template <class Model>
struct requirement
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};

struct failed {};
@@ -36,7 +43,14 @@ struct failed {};
template <class Model>
struct requirement<failed ************ Model::************>
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};

# ifdef BOOST_OLD_CONCEPT_SUPPORT
@@ -44,7 +58,14 @@ struct requirement<failed ************ Model::************>
template <class Model>
struct constraint
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->constraints(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};

template <class Model>
diff --git a/include/boost/concept/usage.hpp b/include/boost/concept/usage.hpp
index 373de63a..fe88b5f5 100644
--- a/include/boost/concept/usage.hpp
+++ b/include/boost/concept/usage.hpp
@@ -13,7 +13,14 @@ namespace boost { namespace concepts {
template <class Model>
struct usage_requirements
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
~usage_requirements() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};

# if BOOST_WORKAROUND(__GNUC__, <= 3)
43 changes: 43 additions & 0 deletions depends/patches/qt/fix_limits_header.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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



--- old/qtbase/src/tools/moc/generator.cpp
+++ new/qtbase/src/tools/moc/generator.cpp
@@ -36,6 +36,7 @@
#include <QtCore/qjsonvalue.h>
#include <QtCore/qjsonarray.h>
#include <QtCore/qplugin.h>
+#include <limits>
#include <stdio.h>

#include <private/qmetaobject_p.h> //for the flags.