From 6e21e023b46318ee22d47025771420f0429e45c4 Mon Sep 17 00:00:00 2001 From: chengzihan2 Date: Mon, 25 May 2020 09:46:35 +0800 Subject: [PATCH] add patch to make the package compatible with gcc 9.x compiler --- 0001-Redo-the-Q_FOREACH-loop-control.patch | 45 ++++++++++++++++++++++ qt.spec | 7 +++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 0001-Redo-the-Q_FOREACH-loop-control.patch diff --git a/0001-Redo-the-Q_FOREACH-loop-control.patch b/0001-Redo-the-Q_FOREACH-loop-control.patch new file mode 100644 index 0000000..786ddb6 --- /dev/null +++ b/0001-Redo-the-Q_FOREACH-loop-control.patch @@ -0,0 +1,45 @@ +From 98db56078bcd18993ca693d060ccd6a95fd04c5c Mon Sep 17 00:00:00 2001 +From: chengzihan2 +Date: Fri, 22 May 2020 17:53:01 +0800 +Subject: [PATCH] Redo the Q_FOREACH loop control + +--- + src/corelib/global/qglobal.h | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h +index 3c3bc32a..6b540983 100644 +--- a/src/corelib/global/qglobal.h ++++ b/src/corelib/global/qglobal.h +@@ -2482,22 +2482,22 @@ typedef uint Flags; + + #endif /* Q_NO_TYPESAFE_FLAGS */ + +-#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT) ++#if (defined(Q_CC_GNU) && !defined(Q_CC_RVCT)) + /* make use of typeof-extension */ + template + class QForeachContainer { + public: +- inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { } ++ inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { } + const T c; +- int brk; + typename T::const_iterator i, e; ++ int control; + }; + + #define Q_FOREACH(variable, container) \ + for (QForeachContainer<__typeof__(container)> _container_(container); \ +- !_container_.brk && _container_.i != _container_.e; \ +- __extension__ ({ ++_container_.brk; ++_container_.i; })) \ +- for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;})) ++ _container_.control && _container_.i != _container_.e; \ ++ ++_container_.i, _container_.control ^= 1) \ ++ for (variable = *_container_.i; _container_.control;_container_.control = 0) + + #else + +-- +2.23.0 + diff --git a/qt.spec b/qt.spec index 5b7cc5f..88ac40b 100644 --- a/qt.spec +++ b/qt.spec @@ -13,7 +13,7 @@ Name: qt Epoch: 1 Version: 4.8.7 -Release: 47 +Release: 48 Summary: A software toolkit for developing applications License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT URL: http://qt-project.org/ @@ -77,6 +77,7 @@ Patch6001: CVE-2018-19872.patch Patch6002: CVE-2018-19871.patch Patch6003: CVE-2018-19870.patch Patch6004: CVE-2018-19873.patch +Patch6005: 0001-Redo-the-Q_FOREACH-loop-control.patch BuildRequires: cups-devel desktop-file-utils gcc-c++ libjpeg-devel findutils libmng-devel libtiff-devel pkgconfig pkgconfig(alsa) BuildRequires: pkgconfig(dbus-1) pkgconfig(fontconfig) pkgconfig(glib-2.0) pkgconfig(icu-i18n) openssl-devel pkgconfig(libpng) @@ -443,6 +444,10 @@ fi %{_qt4_prefix}/examples/ %changelog +* Mon May 25 2020 chengzihan - 1:4.8.7-48 +- add patch 0001-Redo-the-Q_FOREACH-loop-control.patch +- redo the Q_FOREACH loop control to make the package compatible with gcc 9.x compiler + * Thu Mar 19 2020 yanglijin - 1:4.8.7-47 - add stack protector -- Gitee