public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2017-11-28 11:00 Michael Palimaka
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Palimaka @ 2017-11-28 11:00 UTC (permalink / raw
  To: gentoo-commits

commit:     3e0bbe689cf555a4b68cea32a5ba5d5f5b898641
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 28 10:58:58 2017 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Tue Nov 28 10:59:53 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e0bbe68

dev-qt/qtcore: backport patch from upstream fixing build when AVX2 is enabled but __F16C__ isn't defined

Closes: https://bugs.gentoo.org/635388
Package-Manager: Portage-2.3.14, Repoman-2.3.6

 dev-qt/qtcore/files/qtcore-5.9.3-avx.patch | 69 ++++++++++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.9.3.ebuild          |  2 +
 2 files changed, 71 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.9.3-avx.patch b/dev-qt/qtcore/files/qtcore-5.9.3-avx.patch
new file mode 100644
index 00000000000..be18433be20
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.9.3-avx.patch
@@ -0,0 +1,69 @@
+From d813c66bfcfac1837814ec4d174d0389172f0d4c Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Tue, 25 Apr 2017 12:02:09 -0300
+Subject: Fix the build when AVX2 is enabled but __F16C__ isn't defined
+
+If -mavx2 is used, __AVX2__ is defined, which enables the F16C code
+after commit 280e321e52fd4e86545f3f0d4bd4e047786a897e, but that was
+wrong since we aren't allowed to use the F16C intrinsics with either
+Clang or GCC (we can only do that with GCC 4.9 and Clang 4.8, and only
+with an __attribute__ decoration).
+
+With ICC and MSVC, we are allowed to use the intrinsics, but the
+#include was missing.
+
+[ChangeLog][QtCore] Fixed a compilation issue with qfloat16 if AVX2
+support is enabled in the compiler. Since all processors that support
+AVX2 also support F16C, for GCC and Clang it is recommended to either
+add -mf16c to your build or to use the corresponding -march= switch.
+
+Task-number: QTBUG-64529
+Change-Id: I84e363d735b443cb9beefffd14b8ac1fd4baa978
+Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
+---
+ src/corelib/global/qfloat16.h | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
+index 89a62a93db..a0aa9496b4 100644
+--- a/src/corelib/global/qfloat16.h
++++ b/src/corelib/global/qfloat16.h
+@@ -44,7 +44,16 @@
+ #include <QtCore/qmetatype.h>
+ #include <string.h>
+ 
+-#if defined __F16C__
++#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__)
++// All processors that support AVX2 do support F16C too. That doesn't mean
++// we're allowed to use the intrinsics directly, so we'll do it only for
++// the Intel and Microsoft's compilers.
++#  if defined(Q_CC_INTEL) || defined(Q_CC_MSVC)
++#    define __F16C__        1
++# endif
++#endif
++
++#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)
+ #include <immintrin.h>
+ #endif
+ 
+@@ -116,7 +125,7 @@ QT_WARNING_DISABLE_CLANG("-Wc99-extensions")
+ QT_WARNING_DISABLE_GCC("-Wold-style-cast")
+ inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW
+ {
+-#if defined(QT_COMPILER_SUPPORTS_F16C) && (defined(__F16C__) || defined(__AVX2__))
++#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)
+     __m128 packsingle = _mm_set_ss(f);
+     __m128i packhalf = _mm_cvtps_ph(packsingle, 0);
+     b16 = _mm_extract_epi16(packhalf, 0);
+@@ -134,7 +143,7 @@ QT_WARNING_POP
+ 
+ inline qfloat16::operator float() const Q_DECL_NOTHROW
+ {
+-#if defined(QT_COMPILER_SUPPORTS_F16C) && (defined(__F16C__) || defined(__AVX2__))
++#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)
+     __m128i packhalf = _mm_cvtsi32_si128(b16);
+     __m128 packsingle = _mm_cvtph_ps(packhalf);
+     return _mm_cvtss_f32(packsingle);
+-- 
+cgit v1.1-6-g87c4
+

diff --git a/dev-qt/qtcore/qtcore-5.9.3.ebuild b/dev-qt/qtcore/qtcore-5.9.3.ebuild
index 779bc30c7b9..5442d7c47bf 100644
--- a/dev-qt/qtcore/qtcore-5.9.3.ebuild
+++ b/dev-qt/qtcore/qtcore-5.9.3.ebuild
@@ -24,6 +24,8 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}/${P}-avx.patch" )
+
 QT5_TARGET_SUBDIRS=(
 	src/tools/bootstrap
 	src/tools/moc


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2023-02-19 13:24 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2023-02-19 13:24 UTC (permalink / raw
  To: gentoo-commits

commit:     ba6d4805d1bede357a464619528aabe7debd6a98
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 19 13:23:02 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Feb 19 13:23:02 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba6d4805

dev-qt/qtcore: drop 5.15.8-r1

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-qt/qtcore/Manifest                             |   1 -
 .../files/qtcore-5.15.8-fix-crash-w-debug.patch    |  41 -------
 dev-qt/qtcore/qtcore-5.15.8-r1.ebuild              | 122 ---------------------
 3 files changed, 164 deletions(-)

diff --git a/dev-qt/qtcore/Manifest b/dev-qt/qtcore/Manifest
index 1ba76bb0dd29..db6cd834f163 100644
--- a/dev-qt/qtcore/Manifest
+++ b/dev-qt/qtcore/Manifest
@@ -1,4 +1,3 @@
 DIST qtbase-5.15-gentoo-patchset-3.tar.xz 3856 BLAKE2B 0752426f9bc2dfa1ab2bc246b29f5d00305df05175a7801d7d5eddacfa46fcb605d9a317547edc01d3ef339f6effc2fcee7549cb7aecced37f0098166c70dbe2 SHA512 2515bea53232e76ca3e40bdaf1dd52fdf452052a2f40002ee91360d1fcceea3c5c2f5a8d2a3bfc0f9c2bacd61460a632c5b351accd73fd37b64985593219148e
-DIST qtbase-5.15.8-gentoo-kde-3.tar.xz 782344 BLAKE2B 115814a4d90ac286540cf6e50bd2b57baa8e0e327fc73c3ab06fe43ecd95e1e3739faecee5db112d95d17e4fb84494ad5557e70251f2c60142166715294bf366 SHA512 d50b0f02476ded9f053093ec15c5204a0ec664794dcc324996685f09400a2cbc76dc3fd0ebfc247ebd42fbe203b7d4c904e975fc985bf7928e43c6cd65f04f34
 DIST qtbase-5.15.8-gentoo-kde-5.tar.xz 793372 BLAKE2B f486a0275fdf4da28a88ba40b7e6f227267fa05e8f466f734f720e792de1796501d5f1fb4427a84ca2d709bfa07abd695ad59210f7fd11227b1bf465484736b8 SHA512 f51d7ee2d121acda1141b9816197afc57ac0176a12acc08a93c2a793694afb734f8f1ad280a5bf95170cf912e32edb4a6612befeb4198fec78a7e50bbb6a61cd
 DIST qtbase-everywhere-opensource-src-5.15.8.tar.xz 50259432 BLAKE2B cb1b790a384a5cad9a95fdc448e275d48a68c6ee2addf08b40f9963cc5762fd7ab15852dea8392dc76da39f1565c1e23ddb5875c280f0177e802082f4b4f7f2b SHA512 29e8877bafdbc908072209f1b27a5040b022e2b71f17f4ab4cecd570adeae21597f9af7f1d38758760f3cb30376eeb15c5f066bf02c6e9a9e3a4d07f967046ce

diff --git a/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch b/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch
deleted file mode 100644
index 74f5ed5c4886..000000000000
--- a/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 0c0b34badb8a56f5c0d7d43c3847508774c8e553 Mon Sep 17 00:00:00 2001
-From: Harald Sitter <sitter@kde.org>
-Date: Mon, 2 Jan 2023 12:38:02 +0100
-Subject: [PATCH] correctly set up ref counting in
- QThreadPool::tryStart(std::function)
-
-this function was inconsistent with the QThreadPool::tryStart(QRunnable)
-overload, where ref counting does get set up correctly. the lack of ref
-counting setup would later cause trouble because we assert the ref
-counting state all over QThreadPool. to prevent failed assertions we
-correctly set up ref counting now.
-
-this change is not applicable to Qt6 because the ref counting has
-already been removed there:
-https://github.com/qt/qtbase/commit/ecfda98d1f91c6a7da0d89826558d856cd88e670
-
-BUG: 449688
----
- src/corelib/thread/qthreadpool.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
-index 40cc646519..8aa06a4c8f 100644
---- a/src/corelib/thread/qthreadpool.cpp
-+++ b/src/corelib/thread/qthreadpool.cpp
-@@ -602,8 +602,12 @@ bool QThreadPool::tryStart(std::function<void()> functionToRun)
-         return false;
- 
-     QRunnable *runnable = QRunnable::create(std::move(functionToRun));
-+    Q_ASSERT(runnable->ref == 0);
-+    ++runnable->ref;
-     if (d->tryStart(runnable))
-         return true;
-+    --runnable->ref;
-+    Q_ASSERT(runnable->ref == 0);
-     delete runnable;
-     return false;
- }
--- 
-GitLab
-

diff --git a/dev-qt/qtcore/qtcore-5.15.8-r1.ebuild b/dev-qt/qtcore/qtcore-5.15.8-r1.ebuild
deleted file mode 100644
index 75b9d56cafc0..000000000000
--- a/dev-qt/qtcore/qtcore-5.15.8-r1.ebuild
+++ /dev/null
@@ -1,122 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-if [[ ${PV} != *9999* ]]; then
-	QT5_KDEPATCHSET_REV=3
-	KEYWORDS="amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86"
-fi
-
-QT5_MODULE="qtbase"
-inherit linux-info flag-o-matic qt5-build
-
-DESCRIPTION="Cross-platform application development framework"
-SLOT=5/${QT5_PV}
-
-IUSE="icu old-kernel systemd"
-
-DEPEND="
-	dev-libs/double-conversion:=
-	dev-libs/glib:2
-	dev-libs/libpcre2[pcre16,unicode]
-	sys-libs/zlib:=
-	icu? ( dev-libs/icu:= )
-	!icu? ( virtual/libiconv )
-	systemd? ( sys-apps/systemd:= )
-"
-RDEPEND="${DEPEND}"
-
-QT5_TARGET_SUBDIRS=(
-	src/tools/bootstrap
-	src/tools/moc
-	src/tools/rcc
-	src/corelib
-	src/tools/qlalr
-	doc
-)
-
-QT5_GENTOO_PRIVATE_CONFIG=(
-	!:network
-	!:sql
-	!:testlib
-	!:xml
-)
-
-PATCHES=( "${FILESDIR}/${P}-fix-crash-w-debug.patch" ) # bug 889160, pending upstream
-
-pkg_pretend() {
-	use kernel_linux || return
-	get_running_version
-	if kernel_is -lt 4 11 && ! use old-kernel; then
-		ewarn "The running kernel is older than 4.11. USE=old-kernel is needed for"
-		ewarn "dev-qt/qtcore to function on this kernel properly. Bugs #669994, #672856"
-	fi
-}
-
-src_prepare() {
-	# don't add -O3 to CXXFLAGS, bug 549140
-	sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die
-
-	# fix missing qt_version_tag symbol w/ LTO, bug 674382
-	sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
-
-	# Broken with FORTIFY_SOURCE=3
-	# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
-	# to unset F_S first, then explicitly set 2, to negate any default
-	# and anything set by the user if they're choosing 3 (or if they've
-	# modified GCC to set 3).
-	#
-	# Refs:
-	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078
-	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105709
-	# https://bugreports.qt.io/browse/QTBUG-103782
-	# bug #847145
-	if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
-		# We can't unconditionally do this b/c we fortify needs
-		# some level of optimisation.
-		filter-flags -D_FORTIFY_SOURCE=3
-		# (Qt doesn't seem to respect CPPFLAGS?)
-		append-flags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
-	fi
-
-	qt5-build_src_prepare
-
-	# workaround for 0148-Annotate-QMutex-...patch adding a header
-	perl bin/syncqt.pl -version ${PV} || die
-}
-
-src_configure() {
-	local myconf=(
-		$(qt_use icu)
-		$(qt_use !icu iconv)
-		$(qt_use systemd journald)
-	)
-	use old-kernel && myconf+=(
-		-no-feature-renameat2 # needs Linux 3.16, bug 669994
-		-no-feature-getentropy # needs Linux 3.17, bug 669994
-		-no-feature-statx # needs Linux 4.11, bug 672856
-	)
-	qt5-build_src_configure
-}
-
-src_install() {
-	qt5-build_src_install
-	qt5_symlink_binary_to_path qmake 5
-
-	local flags=(
-		DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG
-		OPENGL OPENSSL SSL WIDGETS
-	)
-
-	for flag in ${flags[@]}; do
-		cat >> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
-
-			#if defined(QT_NO_${flag}) && defined(QT_${flag})
-			# undef QT_NO_${flag}
-			#elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
-			# define QT_NO_${flag}
-			#endif
-		_EOF_
-	done
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2023-02-05 13:54 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2023-02-05 13:54 UTC (permalink / raw
  To: gentoo-commits

commit:     55d36e6c00a983651970661cd37205defd8536ce
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  5 11:36:00 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Feb  5 13:54:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55d36e6c

dev-qt/qtcore: drop 5.15.8-r2

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/qtcore-5.15.8-fix-crash-w-debug.patch    |  41 -------
 dev-qt/qtcore/qtcore-5.15.8-r2.ebuild              | 125 ---------------------
 2 files changed, 166 deletions(-)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch b/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch
deleted file mode 100644
index 74f5ed5c4886..000000000000
--- a/dev-qt/qtcore/files/qtcore-5.15.8-fix-crash-w-debug.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 0c0b34badb8a56f5c0d7d43c3847508774c8e553 Mon Sep 17 00:00:00 2001
-From: Harald Sitter <sitter@kde.org>
-Date: Mon, 2 Jan 2023 12:38:02 +0100
-Subject: [PATCH] correctly set up ref counting in
- QThreadPool::tryStart(std::function)
-
-this function was inconsistent with the QThreadPool::tryStart(QRunnable)
-overload, where ref counting does get set up correctly. the lack of ref
-counting setup would later cause trouble because we assert the ref
-counting state all over QThreadPool. to prevent failed assertions we
-correctly set up ref counting now.
-
-this change is not applicable to Qt6 because the ref counting has
-already been removed there:
-https://github.com/qt/qtbase/commit/ecfda98d1f91c6a7da0d89826558d856cd88e670
-
-BUG: 449688
----
- src/corelib/thread/qthreadpool.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
-index 40cc646519..8aa06a4c8f 100644
---- a/src/corelib/thread/qthreadpool.cpp
-+++ b/src/corelib/thread/qthreadpool.cpp
-@@ -602,8 +602,12 @@ bool QThreadPool::tryStart(std::function<void()> functionToRun)
-         return false;
- 
-     QRunnable *runnable = QRunnable::create(std::move(functionToRun));
-+    Q_ASSERT(runnable->ref == 0);
-+    ++runnable->ref;
-     if (d->tryStart(runnable))
-         return true;
-+    --runnable->ref;
-+    Q_ASSERT(runnable->ref == 0);
-     delete runnable;
-     return false;
- }
--- 
-GitLab
-

diff --git a/dev-qt/qtcore/qtcore-5.15.8-r2.ebuild b/dev-qt/qtcore/qtcore-5.15.8-r2.ebuild
deleted file mode 100644
index 5817a2b70616..000000000000
--- a/dev-qt/qtcore/qtcore-5.15.8-r2.ebuild
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-if [[ ${PV} != *9999* ]]; then
-	QT5_KDEPATCHSET_REV=3
-	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
-fi
-
-QT5_MODULE="qtbase"
-inherit linux-info flag-o-matic toolchain-funcs qt5-build
-
-DESCRIPTION="Cross-platform application development framework"
-SLOT=5/${QT5_PV}
-
-IUSE="icu old-kernel systemd"
-
-DEPEND="
-	dev-libs/double-conversion:=
-	dev-libs/glib:2
-	dev-libs/libpcre2[pcre16,unicode]
-	sys-libs/zlib:=
-	icu? ( dev-libs/icu:= )
-	!icu? ( virtual/libiconv )
-	systemd? ( sys-apps/systemd:= )
-"
-RDEPEND="${DEPEND}"
-
-QT5_TARGET_SUBDIRS=(
-	src/tools/bootstrap
-	src/tools/moc
-	src/tools/rcc
-	src/corelib
-	src/tools/qlalr
-	doc
-)
-
-QT5_GENTOO_PRIVATE_CONFIG=(
-	!:network
-	!:sql
-	!:testlib
-	!:xml
-)
-
-PATCHES=( "${FILESDIR}/${P}-fix-crash-w-debug.patch" ) # bug 889160, pending upstream
-
-pkg_pretend() {
-	use kernel_linux || return
-	get_running_version
-	if kernel_is -lt 4 11 && ! use old-kernel; then
-		ewarn "The running kernel is older than 4.11. USE=old-kernel is needed for"
-		ewarn "dev-qt/qtcore to function on this kernel properly. Bugs #669994, #672856"
-	fi
-}
-
-src_prepare() {
-	# don't add -O3 to CXXFLAGS, bug 549140
-	sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die
-
-	# fix missing qt_version_tag symbol w/ LTO, bug 674382
-	sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
-
-	# Broken with FORTIFY_SOURCE=3
-	# Our toolchain sets F_S=2 by default w/ >= -O2, so we need
-	# to unset F_S first, then explicitly set 2, to negate any default
-	# and anything set by the user if they're choosing 3 (or if they've
-	# modified GCC to set 3).
-	#
-	# Refs:
-	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078
-	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105709
-	# https://bugreports.qt.io/browse/QTBUG-103782
-	# bug #847145
-	if is-flagq '-O[23]' || is-flagq '-Ofast' ; then
-		# We can't unconditionally do this b/c we fortify needs
-		# some level of optimisation.
-		filter-flags -D_FORTIFY_SOURCE=3
-		# (Qt doesn't seem to respect CPPFLAGS?)
-		append-flags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
-	fi
-
-	# Leads to miscompiled qtcore, bug #865339
-	tc-is-clang && append-flags -fno-stack-clash-protection
-
-	qt5-build_src_prepare
-
-	# workaround for 0148-Annotate-QMutex-...patch adding a header
-	perl bin/syncqt.pl -version ${PV} || die
-}
-
-src_configure() {
-	local myconf=(
-		$(qt_use icu)
-		$(qt_use !icu iconv)
-		$(qt_use systemd journald)
-	)
-	use old-kernel && myconf+=(
-		-no-feature-renameat2 # needs Linux 3.16, bug 669994
-		-no-feature-getentropy # needs Linux 3.17, bug 669994
-		-no-feature-statx # needs Linux 4.11, bug 672856
-	)
-	qt5-build_src_configure
-}
-
-src_install() {
-	qt5-build_src_install
-	qt5_symlink_binary_to_path qmake 5
-
-	local flags=(
-		DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG
-		OPENGL OPENSSL SSL WIDGETS
-	)
-
-	for flag in ${flags[@]}; do
-		cat >> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
-
-			#if defined(QT_NO_${flag}) && defined(QT_${flag})
-			# undef QT_NO_${flag}
-			#elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
-			# define QT_NO_${flag}
-			#endif
-		_EOF_
-	done
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2022-06-26  8:25 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2022-06-26  8:25 UTC (permalink / raw
  To: gentoo-commits

commit:     cb10b0356e62b2521c0d4592a35b5dfb6e5cd2ca
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 26 08:22:31 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 26 08:25:13 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb10b035

dev-qt/qtcore: backport FORTIFY_SOURCE=3 patch

GCC 12 is now in ~arch and we're likely to get more people trying
out F_S=3 as a result. This patch is now in Qt5PatchCollection
and given the previous workaround ended up being insufficient
(it's not enough to force F_S=2 in qtcore, as reverse deps
end up being broken if _they_ are built with F_S=3, even
though the cause is in qtcore), let's backport the fix now.

Bug: https://bugs.gentoo.org/847145
Closes: https://bugs.gentoo.org/852974
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/qtcore-5.15.5-fortify-source-3.patch     |  61 ++++++++++++
 dev-qt/qtcore/qtcore-5.15.5-r1.ebuild              | 102 +++++++++++++++++++++
 2 files changed, 163 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.5-fortify-source-3.patch b/dev-qt/qtcore/files/qtcore-5.15.5-fortify-source-3.patch
new file mode 100644
index 000000000000..1be46b496cf9
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.5-fortify-source-3.patch
@@ -0,0 +1,61 @@
+https://invent.kde.org/qt/qt/qtbase/-/commit/6d3d164bec17876f5b24ae9102767ef1236aa37b
+
+From 6d3d164bec17876f5b24ae9102767ef1236aa37b Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 20 Jun 2022 20:35:12 +0100
+Subject: [PATCH] QArrayData: fix UB via reinterpret_cast (crash with
+ FORTIFY_SOURCE=3)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+FORTIFY_SOURCE=3 is a new level of FORTIFY_SOURCE available with GCC 12+.
+
+With Qt 5.15, it ends up triggering UB in the pointer arithmetic
+in QArrayData which breaks various FOSS applications using qtcore.
+
+Qt upstream fixed this independently for 6.x (in at least
+eab6eb64d2fab21c4791738323ca7d670a907de1) but did so at the same time as
+various internal changes and hence is not appropriate for cherry-picking to 5.15.x.
+
+I reported the issue to Qt (QTBUG-103782) and they've created a fix for 5.15 which
+is not yet public but based on the description in the bug, should be functionally
+the same as this. They have not backported the intrusive internal changes
+from 6.x.
+
+Originally grabbed from https://build.opensuse.org/package/view_file/KDE:Qt:5.15/libqt5-qtbase/mitigate-FORTIFY_SOURCE-3.patch.
+
+Bug: https://bugs.gentoo.org/847145
+Bug: https://bugs.gentoo.org/852974
+Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104964
+Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105709
+Task-number: QTBUG-103782
+Thanks-to: Martin Liška <mliska@suse.cz>
+--- a/src/corelib/tools/qarraydata.h
++++ b/src/corelib/tools/qarraydata.h
+@@ -42,6 +42,7 @@
+ 
+ #include <QtCore/qrefcount.h>
+ #include <string.h>
++#include <cstdint>
+ 
+ QT_BEGIN_NAMESPACE
+ 
+@@ -58,14 +59,14 @@ struct Q_CORE_EXPORT QArrayData
+     {
+         Q_ASSERT(size == 0
+                 || offset < 0 || size_t(offset) >= sizeof(QArrayData));
+-        return reinterpret_cast<char *>(this) + offset;
++        return reinterpret_cast<void *> (reinterpret_cast<uintptr_t>(this) + offset);
+     }
+ 
+     const void *data() const
+     {
+         Q_ASSERT(size == 0
+                 || offset < 0 || size_t(offset) >= sizeof(QArrayData));
+-        return reinterpret_cast<const char *>(this) + offset;
++        return reinterpret_cast<void *> (reinterpret_cast<uintptr_t>(this) + offset);
+     }
+ 
+     // This refers to array data mutability, not "header data" represented by
+GitLab

diff --git a/dev-qt/qtcore/qtcore-5.15.5-r1.ebuild b/dev-qt/qtcore/qtcore-5.15.5-r1.ebuild
new file mode 100644
index 000000000000..c2235698ecbf
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.15.5-r1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QT5_KDEPATCHSET_REV=1
+QT5_MODULE="qtbase"
+inherit linux-info qt5-build
+
+DESCRIPTION="Cross-platform application development framework"
+SLOT=5/${QT5_PV}
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+fi
+
+IUSE="icu old-kernel systemd"
+
+DEPEND="
+	dev-libs/double-conversion:=
+	dev-libs/glib:2
+	dev-libs/libpcre2[pcre16,unicode]
+	sys-libs/zlib:=
+	icu? ( dev-libs/icu:= )
+	!icu? ( virtual/libiconv )
+	systemd? ( sys-apps/systemd:= )
+"
+RDEPEND="${DEPEND}"
+
+QT5_TARGET_SUBDIRS=(
+	src/tools/bootstrap
+	src/tools/moc
+	src/tools/rcc
+	src/corelib
+	src/tools/qlalr
+	doc
+)
+
+QT5_GENTOO_PRIVATE_CONFIG=(
+	!:network
+	!:sql
+	!:testlib
+	!:xml
+)
+
+PATCHES=(
+	"${FILESDIR}"/${P}-fortify-source-3.patch
+)
+
+pkg_pretend() {
+	use kernel_linux || return
+	get_running_version
+	if kernel_is -lt 4 11 && ! use old-kernel; then
+		ewarn "The running kernel is older than 4.11. USE=old-kernel is needed for"
+		ewarn "dev-qt/qtcore to function on this kernel properly. Bugs #669994, #672856"
+	fi
+}
+
+src_prepare() {
+	# don't add -O3 to CXXFLAGS, bug 549140
+	sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die
+
+	# fix missing qt_version_tag symbol w/ LTO, bug 674382
+	sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
+
+	qt5-build_src_prepare
+}
+
+src_configure() {
+	local myconf=(
+		$(qt_use icu)
+		$(qt_use !icu iconv)
+		$(qt_use systemd journald)
+	)
+	use old-kernel && myconf+=(
+		-no-feature-renameat2 # needs Linux 3.16, bug 669994
+		-no-feature-getentropy # needs Linux 3.17, bug 669994
+		-no-feature-statx # needs Linux 4.11, bug 672856
+	)
+	qt5-build_src_configure
+}
+
+src_install() {
+	qt5-build_src_install
+	qt5_symlink_binary_to_path qmake 5
+
+	local flags=(
+		DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG
+		OPENGL OPENSSL SSL WIDGETS
+	)
+
+	for flag in ${flags[@]}; do
+		cat >> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
+
+			#if defined(QT_NO_${flag}) && defined(QT_${flag})
+			# undef QT_NO_${flag}
+			#elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
+			# define QT_NO_${flag}
+			#endif
+		_EOF_
+	done
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2022-03-30 18:57 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2022-03-30 18:57 UTC (permalink / raw
  To: gentoo-commits

commit:     3884552b6dd1bdeea1ca82bd23b6736c519ebe90
Author:     Han Gao <rabenda.cn <AT> gmail <DOT> com>
AuthorDate: Sun Mar 27 13:05:18 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Mar 30 18:56:21 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3884552b

dev-qt/qtcore: use link option -pthread instead of -lpthread

Bug: https://bugs.gentoo.org/803470
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Han Gao <rabenda.cn <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/24711
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch | 41 +++++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.3.ebuild              |  4 +++
 2 files changed, 45 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch b/dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch
new file mode 100644
index 000000000000..c83c59ac3113
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch
@@ -0,0 +1,41 @@
+# Use link option -pthread instead of -lpthread
+
+# https://github.com/riscv-collab/riscv-gcc/issues/12 use Option 4
+# https://stackoverflow.com/questions/23250863/difference-between-pthread-and-lpthread-while-compiling
+# In riscv, "-pthread" equivalent to add link option "--push-state --as-needed -latomic --pop-state"
+
+diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf
+index 544cc227..add969be 100644
+--- a/mkspecs/common/linux.conf
++++ b/mkspecs/common/linux.conf
+@@ -33,7 +33,7 @@ QMAKE_LIBS_EGL          = -lEGL
+ QMAKE_LIBS_OPENGL       = -lGL
+ QMAKE_LIBS_OPENGL_ES2   = -lGLESv2
+ QMAKE_LIBS_OPENVG       = -lOpenVG
+-QMAKE_LIBS_THREAD       = -lpthread
++QMAKE_LIBS_THREAD       = -pthread
+ QMAKE_LIBS_VULKAN       =
+ 
+ QMAKE_INCDIR_WAYLAND    =
+diff --git a/src/corelib/configure.json b/src/corelib/configure.json
+index 9b5d19d4..da028fb2 100644
+--- a/src/corelib/configure.json
++++ b/src/corelib/configure.json
+@@ -355,7 +355,7 @@
+                     "std::future<int> f = std::async([]() { return 42; });",
+                     "(void)f.get();"
+                 ],
+-                "qmake": "unix:LIBS += -lpthread"
++                "qmake": "unix:LIBS += -pthread"
+             }
+         },
+         "cxx11_random": {
+@@ -466,7 +466,7 @@
+                     "shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);",
+                     "shm_unlink(\"test\");"
+                 ],
+-                "qmake": "linux: LIBS += -lpthread -lrt"
++                "qmake": "linux: LIBS += -pthread -lrt"
+             }
+         },
+         "linkat": {

diff --git a/dev-qt/qtcore/qtcore-5.15.3.ebuild b/dev-qt/qtcore/qtcore-5.15.3.ebuild
index 156e4f73b725..8e924cdfabd0 100644
--- a/dev-qt/qtcore/qtcore-5.15.3.ebuild
+++ b/dev-qt/qtcore/qtcore-5.15.3.ebuild
@@ -43,6 +43,10 @@ QT5_GENTOO_PRIVATE_CONFIG=(
 	!:xml
 )
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-5.15.3-pthread.patch # bug 803470
+)
+
 pkg_pretend() {
 	use kernel_linux || return
 	get_running_version


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2021-08-25 14:36 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2021-08-25 14:36 UTC (permalink / raw
  To: gentoo-commits

commit:     d0008990d9c734c1e5bfbb52a33babf382efc2ab
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 25 12:54:55 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Aug 25 14:35:48 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0008990

dev-qt/qtcore: Revert "QString::lastIndexOf: fix off-by-one ..."

"... for zero length matches"

See also:
https://bugreports.qt.io/browse/QTBUG-94215
https://invent.kde.org/qt/qt/qtbase/-/merge_requests/46

Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/qtcore-5.15.2-revert-3a273ac4.patch      | 56 ++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.2-r10.ebuild             |  3 ++
 2 files changed, 59 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.2-revert-3a273ac4.patch b/dev-qt/qtcore/files/qtcore-5.15.2-revert-3a273ac4.patch
new file mode 100644
index 00000000000..a29e1b5256d
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.2-revert-3a273ac4.patch
@@ -0,0 +1,56 @@
+From d9a85af5f24d0608c79b2d87b01213833bee01e5 Mon Sep 17 00:00:00 2001
+From: David Faure <david.faure@kdab.com>
+Date: Thu, 19 Aug 2021 15:07:13 +0200
+Subject: [PATCH] Revert "QString::lastIndexOf: fix off-by-one for zero length
+ matches"
+
+This reverts commit 3a273ac47f20e82a1f2f63411b210025ca0f4495.
+
+See QTBUG-94215
+
+6cee204d56205e250b0675c9c6d4dd8a2367f3c4 for qtbase/dev changes the
+behaviour even further, I'm pretty sure we don't want that in Qt 5.15.x,
+see discussion in https://codereview.qt-project.org/c/qt/qtbase/+/365179.
+
+Change-Id: I663d74e0d44ebf46291fe0e8a7dc609be82eedc6
+---
+ src/corelib/text/qstring.cpp                    | 4 ++--
+ tests/auto/corelib/text/qstring/tst_qstring.cpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
+index 02a9fe3a30..e6e7cbaad4 100644
+--- a/src/corelib/text/qstring.cpp
++++ b/src/corelib/text/qstring.cpp
+@@ -4558,13 +4558,13 @@ int QString::lastIndexOf(const QRegularExpression &re, int from, QRegularExpress
+         return -1;
+     }
+ 
+-    int endpos = (from < 0) ? (size() + from + 1) : (from);
++    int endpos = (from < 0) ? (size() + from + 1) : (from + 1);
+     QRegularExpressionMatchIterator iterator = re.globalMatch(*this);
+     int lastIndex = -1;
+     while (iterator.hasNext()) {
+         QRegularExpressionMatch match = iterator.next();
+         int start = match.capturedStart();
+-        if (start <= endpos) {
++        if (start < endpos) {
+             lastIndex = start;
+             if (rmatch)
+                 *rmatch = std::move(match);
+diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
+index 8f53824050..4c4a8f0416 100644
+--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
++++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
+@@ -1674,7 +1674,7 @@ void tst_QString::lastIndexOf()
+     QCOMPARE(haystack.lastIndexOf(needle.toLatin1(), from, cs), expected);
+     QCOMPARE(haystack.lastIndexOf(needle.toLatin1().data(), from, cs), expected);
+ 
+-    if (from >= -1 && from < haystack.size() && needle.size() > 0) {
++    if (from >= -1 && from < haystack.size()) {
+         // unfortunately, QString and QRegExp don't have the same out of bound semantics
+         // I think QString is wrong -- See file log for contact information.
+         {
+-- 
+GitLab
+

diff --git a/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild b/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild
index 5d5fc72d4cc..d8791013a67 100644
--- a/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild
+++ b/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild
@@ -48,6 +48,9 @@ QT5_GENTOO_PRIVATE_CONFIG=(
 PATCHES=(
 	"${FILESDIR}"/${PN}-5.14.1-cmake-macro-backward-compat.patch # bug 703306
 	"${FILESDIR}"/${PN}-5.15.1-timezone-{1,2}.patch # bug 737914
+	# Revert to 5.15.2 (upstream Qt release) behavior, QTBUG-94215
+	# See also: https://invent.kde.org/qt/qt/qtbase/-/merge_requests/46
+	"${FILESDIR}"/${P}-revert-3a273ac4.patch
 )
 
 pkg_pretend() {


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2021-02-13 11:38 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2021-02-13 11:38 UTC (permalink / raw
  To: gentoo-commits

commit:     92d54be896563102786238893a9c645b8bdb43ef
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 13 11:37:36 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Feb 13 11:37:59 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92d54be8

dev-qt/qtcore: Fix headers for revdeps building with GCC-11

Closes: https://bugs.gentoo.org/768342
Closes: https://bugs.gentoo.org/768354
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-qt/qtcore/files/qtcore-5.15.2-gcc11.patch | 38 +++++++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.2-r2.ebuild         |  1 +
 2 files changed, 39 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.2-gcc11.patch b/dev-qt/qtcore/files/qtcore-5.15.2-gcc11.patch
new file mode 100644
index 00000000000..9d391311c34
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.2-gcc11.patch
@@ -0,0 +1,38 @@
+Description: include <limits> to fix some GCC 11 build issues
+Origin: upstream, commits:
+ https://code.qt.io/cgit/qt/qtbase.git/commit/?id=813a928c7c3cf986
+ https://code.qt.io/cgit/qt/qtbase.git/commit/?id=9c56d4da2ff631a8
+Last-Update: 2021-01-26
+
+--- a/src/corelib/global/qendian.h
++++ b/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>
+--- a/src/corelib/global/qfloat16.h
++++ b/src/corelib/global/qfloat16.h
+@@ -43,6 +43,7 @@
+ 
+ #include <QtCore/qglobal.h>
+ #include <QtCore/qmetatype.h>
++#include <limits>
+ #include <string.h>
+ 
+ #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__)
+--- a/src/corelib/text/qbytearraymatcher.h
++++ b/src/corelib/text/qbytearraymatcher.h
+@@ -42,6 +42,8 @@
+ 
+ #include <QtCore/qbytearray.h>
+ 
++#include <limits>
++
+ QT_BEGIN_NAMESPACE
+ 
+ 

diff --git a/dev-qt/qtcore/qtcore-5.15.2-r2.ebuild b/dev-qt/qtcore/qtcore-5.15.2-r2.ebuild
index e3a3aa50ca1..ed1722052c4 100644
--- a/dev-qt/qtcore/qtcore-5.15.2-r2.ebuild
+++ b/dev-qt/qtcore/qtcore-5.15.2-r2.ebuild
@@ -52,6 +52,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-5.15.1-timezone-{1,2}.patch # bug 737914
 	"${FILESDIR}"/${P}-fix-UB-in-QDateTime.patch # QTBUG-88656
 	"${FILESDIR}"/${P}-fix-alloc-mem-of-QByteArray.patch # QTBUG-87010
+	"${FILESDIR}"/${P}-gcc11.patch # bug 768342, 768354
 	"${WORKDIR}"/qtbase-${PV}-gcc11.patch # bug 752012
 )
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2021-01-02  1:23 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2021-01-02  1:23 UTC (permalink / raw
  To: gentoo-commits

commit:     78bf8d284d0bed6aa02af0e52aa9b27946c90ccb
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  1 16:56:03 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Jan  2 01:22:28 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78bf8d28

dev-qt/qtcore: Bounds-check time-zone offsets when parsing

See also: https://bugreports.qt.io/browse/QTBUG-88656

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/qtcore-5.15.2-fix-UB-in-QDateTime.patch  |  88 +++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.2-r1.ebuild              | 105 +++++++++++++++++++++
 2 files changed, 193 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.2-fix-UB-in-QDateTime.patch b/dev-qt/qtcore/files/qtcore-5.15.2-fix-UB-in-QDateTime.patch
new file mode 100644
index 00000000000..b131b7af365
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.2-fix-UB-in-QDateTime.patch
@@ -0,0 +1,88 @@
+From d2c0fc2b5f1c07c1e0acb1c0127578066b6f9b8e Mon Sep 17 00:00:00 2001
+From: Edward Welbourne <edward.welbourne@qt.io>
+Date: Tue, 24 Nov 2020 12:45:11 +0100
+Subject: [PATCH] Bounds-check time-zone offsets when parsing
+
+Parsing of time-zone offsets should check the offset string conforms
+to the expected format and has valid values in its fields. The
+QDateTime parser, fromOffsetString(), neglected the bounds check on
+hours; the QTzTimeZonePrivate parser, parsePosixTime(), neglected all
+upper bounds checks, only checking against negative valus.
+
+Drive-by - refined phrasing of a comment.
+
+Fixes: QTBUG-88656
+Change-Id: If04cdbe65064108eaa87c42310527783ad21b4c0
+Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
+(cherry picked from commit 380d97e1bd15e753907c378a070bdf7f1c1cf06e)
+Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
+---
+ src/corelib/time/qdatetime.cpp           |  2 +-
+ src/corelib/time/qtimezoneprivate_tz.cpp | 27 ++++++++++++++++-----------
+ 2 files changed, 17 insertions(+), 12 deletions(-)
+
+diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp
+index e824787880c..a2816e87f4a 100644
+--- a/src/corelib/time/qdatetime.cpp
++++ b/src/corelib/time/qdatetime.cpp
+@@ -240,7 +240,7 @@ static int fromOffsetString(QStringView offsetString, bool *valid) noexcept
+     const QStringView hhRef = time.left(qMin(hhLen, time.size()));
+     bool ok = false;
+     const int hour = C.toInt(hhRef, &ok);
+-    if (!ok)
++    if (!ok || hour > 23) // More generous than QTimeZone::MaxUtcOffsetSecs
+         return 0;
+ 
+     const QStringView mmRef = time.mid(qMin(mmIndex, time.size()));
+diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
+index b816b4ecff2..adc590878d7 100644
+--- a/src/corelib/time/qtimezoneprivate_tz.cpp
++++ b/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -394,29 +394,34 @@ static int parsePosixTime(const char *begin, const char *end)
+     // Format "hh[:mm[:ss]]"
+     int hour, min = 0, sec = 0;
+ 
+-    // Note that the calls to qstrtoll do *not* check the end pointer, which
+-    // means they proceed until they find a non-digit. We check that we're
+-    // still in range at the end, but we may have read from past end. It's the
+-    // caller's responsibility to ensure that begin is part of a
+-    // null-terminated string.
++    // Note that the calls to qstrtoll do *not* check against the end pointer,
++    // which means they proceed until they find a non-digit. We check that we're
++    // still in range at the end, but we may have read past end. It's the
++    // caller's responsibility to ensure that begin is part of a null-terminated
++    // string.
+ 
++    const int maxHour = QTimeZone::MaxUtcOffsetSecs / 3600;
+     bool ok = false;
+-    hour = qstrtoll(begin, &begin, 10, &ok);
+-    if (!ok || hour < 0)
++    const char *cut = begin;
++    hour = qstrtoll(begin, &cut, 10, &ok);
++    if (!ok || hour < 0 || hour > maxHour || cut > begin + 2)
+         return INT_MIN;
++    begin = cut;
+     if (begin < end && *begin == ':') {
+         // minutes
+         ++begin;
+-        min = qstrtoll(begin, &begin, 10, &ok);
+-        if (!ok || min < 0)
++        min = qstrtoll(begin, &cut, 10, &ok);
++        if (!ok || min < 0 || min > 59 || cut > begin + 2)
+             return INT_MIN;
+ 
++        begin = cut;
+         if (begin < end && *begin == ':') {
+             // seconds
+             ++begin;
+-            sec = qstrtoll(begin, &begin, 10, &ok);
+-            if (!ok || sec < 0)
++            sec = qstrtoll(begin, &cut, 10, &ok);
++            if (!ok || sec < 0 || sec > 59 || cut > begin + 2)
+                 return INT_MIN;
++            begin = cut;
+         }
+     }
+ 
+-- 
+2.16.3

diff --git a/dev-qt/qtcore/qtcore-5.15.2-r1.ebuild b/dev-qt/qtcore/qtcore-5.15.2-r1.ebuild
new file mode 100644
index 00000000000..b00b449ee60
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.15.2-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+QT5_MODULE="qtbase"
+inherit linux-info qt5-build
+
+DESCRIPTION="Cross-platform application development framework"
+SLOT=5/$(ver_cut 1-3)
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+IUSE="icu old-kernel systemd"
+
+DEPEND="
+	dev-libs/double-conversion:=
+	dev-libs/glib:2
+	dev-libs/libpcre2[pcre16,unicode]
+	sys-libs/zlib:=
+	icu? ( dev-libs/icu:= )
+	!icu? ( virtual/libiconv )
+	systemd? ( sys-apps/systemd:= )
+"
+RDEPEND="${DEPEND}
+	!<dev-qt/qtcore-4.8.7-r4:4
+	dev-qt/qtchooser
+"
+
+QT5_TARGET_SUBDIRS=(
+	src/tools/bootstrap
+	src/tools/moc
+	src/tools/rcc
+	src/corelib
+	src/tools/qlalr
+	doc
+)
+
+QT5_GENTOO_PRIVATE_CONFIG=(
+	!:network
+	!:sql
+	!:testlib
+	!:xml
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-5.14.1-cmake-macro-backward-compat.patch # bug 703306
+	"${FILESDIR}"/${PN}-5.15.1-timezone-{1,2}.patch # bug 737914
+	"${FILESDIR}"/${P}-fix-UB-in-QDateTime.patch # QTBUG-88656
+)
+
+pkg_pretend() {
+	use kernel_linux || return
+	get_running_version
+	if kernel_is -lt 4 11 && ! use old-kernel; then
+		ewarn "The running kernel is older than 4.11. USE=old-kernel is needed for"
+		ewarn "dev-qt/qtcore to function on this kernel properly. Bugs #669994, #672856"
+	fi
+}
+
+src_prepare() {
+	# don't add -O3 to CXXFLAGS, bug 549140
+	sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die
+
+	# fix missing qt_version_tag symbol w/ LTO, bug 674382
+	sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
+
+	qt5-build_src_prepare
+}
+
+src_configure() {
+	local myconf=(
+		$(qt_use icu)
+		$(qt_use !icu iconv)
+		$(qt_use systemd journald)
+	)
+	use old-kernel && myconf+=(
+		-no-feature-renameat2 # needs Linux 3.16, bug 669994
+		-no-feature-getentropy # needs Linux 3.17, bug 669994
+		-no-feature-statx # needs Linux 4.11, bug 672856
+	)
+	qt5-build_src_configure
+}
+
+src_install() {
+	qt5-build_src_install
+
+	local flags=(
+		DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG
+		OPENGL OPENSSL SSL WIDGETS
+	)
+
+	for flag in ${flags[@]}; do
+		cat >> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
+
+			#if defined(QT_NO_${flag}) && defined(QT_${flag})
+			# undef QT_NO_${flag}
+			#elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
+			# define QT_NO_${flag}
+			#endif
+		_EOF_
+	done
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2020-02-09 18:51 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2020-02-09 18:51 UTC (permalink / raw
  To: gentoo-commits

commit:     fe1eb44a73d1a8e99aae1eeb2b7504b326df2cd1
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  9 10:59:22 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Feb  9 18:51:02 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe1eb44a

dev-qt/qtcore: Fix cmake macro compat. for upgrade from <Qt-5.14

Closes: https://bugs.gentoo.org/703306
Closes: https://bugs.gentoo.org/705198
Package-Manager: Portage-2.3.87, Repoman-2.3.20
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...qtcore-5.14.1-cmake-macro-backward-compat.patch | 50 +++++++++++++
 dev-qt/qtcore/qtcore-5.14.1-r1.ebuild              | 85 ++++++++++++++++++++++
 2 files changed, 135 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.14.1-cmake-macro-backward-compat.patch b/dev-qt/qtcore/files/qtcore-5.14.1-cmake-macro-backward-compat.patch
new file mode 100644
index 00000000000..30b5abc3975
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.14.1-cmake-macro-backward-compat.patch
@@ -0,0 +1,50 @@
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Sun, 9 Feb 2020 11:45:00 +0100
+Subject: [PATCH] qtcore: Fix cmake macro compat. for upgrade from <Qt-5.14
+
+In upstream commit:
+
+https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=63d9cd17
+
+_populate_$${CMAKE_MODULE_NAME}_plugin_properties in 5.14.0 gained an additional argument
+IsDebugAndRelease without providing backward compatibility. This macro is used (at least) for
+QtGui and QtDesigner plugins added by qtimageformats, qtsvg, qtvirtualkeyboard and qtwayland.
+During upgrade from <Qt-5.14 to >=Qt-5.14, as a consequence of slot upgrade rebuilds, some
+reverse dependencies are slated for rebuild before these Qt consumers have been rebuilt and their
+cmake files regenerated, leading to cmake errors like:
+
+https://bugs.gentoo.org/703306
+https://bugs.gentoo.org/705198
+
+From mkspecs/features/create_cmake.prf:
+
+# CMAKE_DEBUG_AND_RELEASE is used to tell the _populate_$${CMAKE_MODULE_NAME}_target_properties
+# functions whether a Configuration specific generator expression needs to be added to the values
+# of INTERFACE_LINK_LIBRARIES and INTERFACE_LINK_OPTIONS. For debug_and_release builds, we do need
+# configuration specific values. For singular builds (only release or only debug), we want the
+# values to be applied regardless of the configuration.
+# This would allow on Linux and macOS (and with a recent enough version of CMake on Windows) to
+# build a Debug configuration of an application, even if Qt was built in a Release configuration.
+
+qt5-build.eclass is configuring either as 'release' or as 'debug', so we make IsDebugAndRelease
+optional and default to FALSE.
+
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in	2020-01-23 13:37:32.000000000 +0100
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in	2020-02-09 15:15:21.156219814 +0100
+@@ -538,8 +538,14 @@
+ 
+     file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
+ 
+-    macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION
+-          IsDebugAndRelease)
++    macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
++        set(IsDebugAndRelease FALSE)
++        set (list_var ${ARGN})
++        list(LENGTH list_var num_extra_arg)
++        if (${num_extra_arg} GREATER 0)
++            list(GET list_var 0 IsDebugAndRelease)
++        endif()
++
+         set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
+ 
+ !!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)

diff --git a/dev-qt/qtcore/qtcore-5.14.1-r1.ebuild b/dev-qt/qtcore/qtcore-5.14.1-r1.ebuild
new file mode 100644
index 00000000000..d96ec59bb31
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.14.1-r1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+QT5_MODULE="qtbase"
+inherit qt5-build
+
+DESCRIPTION="Cross-platform application development framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+IUSE="icu systemd"
+
+DEPEND="
+	dev-libs/double-conversion:=
+	dev-libs/glib:2
+	dev-libs/libpcre2[pcre16,unicode]
+	sys-libs/zlib:=
+	icu? ( dev-libs/icu:= )
+	!icu? ( virtual/libiconv )
+	systemd? ( sys-apps/systemd:= )
+"
+RDEPEND="${DEPEND}
+	!<dev-qt/qtcore-4.8.7-r4:4
+"
+
+QT5_TARGET_SUBDIRS=(
+	src/tools/bootstrap
+	src/tools/moc
+	src/tools/rcc
+	src/corelib
+	src/tools/qlalr
+	doc
+)
+
+QT5_GENTOO_PRIVATE_CONFIG=(
+	!:network
+	!:sql
+	!:testlib
+	!:xml
+)
+
+PATCHES=( "${FILESDIR}/${P}-cmake-macro-backward-compat.patch" ) # bug 703306
+
+src_prepare() {
+	# don't add -O3 to CXXFLAGS, bug 549140
+	sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die
+
+	# fix missing qt_version_tag symbol w/ LTO, bug 674382
+	sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
+
+	qt5-build_src_prepare
+}
+
+src_configure() {
+	local myconf=(
+		-no-feature-statx	# bug 672856
+		$(qt_use icu)
+		$(qt_use !icu iconv)
+		$(qt_use systemd journald)
+	)
+	qt5-build_src_configure
+}
+
+src_install() {
+	qt5-build_src_install
+
+	local flags=(
+		DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG
+		OPENGL OPENSSL SSL WIDGETS
+	)
+
+	for flag in ${flags[@]}; do
+		cat >> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
+
+			#if defined(QT_NO_${flag}) && defined(QT_${flag})
+			# undef QT_NO_${flag}
+			#elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
+			# define QT_NO_${flag}
+			#endif
+		_EOF_
+	done
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2020-01-25 23:56 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2020-01-25 23:56 UTC (permalink / raw
  To: gentoo-commits

commit:     f0f2e0e6f77f988b30bcaeef18e2d4e28708f7b1
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 25 23:29:54 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Jan 25 23:56:18 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0f2e0e6

dev-qt/qtcore: Fix CVE-2019-18281

Bug: https://bugs.gentoo.org/699226
Package-Manager: Portage-2.3.85, Repoman-2.3.20
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/qtcore-5.12.3-CVE-2019-18281.patch       | 98 ++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.12.3-r1.ebuild              | 86 +++++++++++++++++++
 2 files changed, 184 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2019-18281.patch b/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2019-18281.patch
new file mode 100644
index 00000000000..055794b5196
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2019-18281.patch
@@ -0,0 +1,98 @@
+From 1232205e32464d90e871f39eb1e14fcf9b78a163 Mon Sep 17 00:00:00 2001
+From: Rainer Keller <Rainer.Keller@qt.io>
+Date: Tue, 27 Aug 2019 14:44:48 +0200
+Subject: [PATCH] Fix crash when text contains too many directional chars
+
+In case a text to be layouted contains more than 128 directional characters
+it causes the application to crash
+
+The function initScriptAnalysisAndIsolatePairs() collects information of
+RTL/LTR chaaracters into vector "isolatePairs". The size of the vector is
+capped to 128. Later the function generateDirectionalRuns() iterates
+the text again and tries to access items from the previously capped vector
+above the upper bound.
+
+Task-number: QTBUG-77819
+Change-Id: Ibb7bf12c12b1db22f43ff46236518da3fdeed26a
+Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
+---
+ src/gui/text/qtextengine.cpp                        | 15 +++++++--------
+ tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp | 17 +++++++++++++++++
+ 2 files changed, 24 insertions(+), 8 deletions(-)
+
+diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
+index 2da13289bfd..a7834587b1e 100644
+--- a/src/gui/text/qtextengine.cpp
++++ b/src/gui/text/qtextengine.cpp
+@@ -399,6 +399,7 @@ struct QBidiAlgorithm {
+                         analysis[i].bidiDirection = (level & 1) ? QChar::DirR : QChar::DirL;
+                     runHasContent = true;
+                     lastRunWithContent = -1;
++                    ++isolatePairPosition;
+                 }
+                 int runBeforeIsolate = runs.size();
+                 ushort newLevel = isRtl ? ((stack.top().level + 1) | 1) : ((stack.top().level + 2) & ~1);
+@@ -440,21 +441,19 @@ struct QBidiAlgorithm {
+                 doEmbed(true, true, false);
+                 break;
+             case QChar::DirLRI:
+-                Q_ASSERT(isolatePairs.at(isolatePairPosition).start == i);
+                 doEmbed(false, false, true);
+-                ++isolatePairPosition;
+                 break;
+             case QChar::DirRLI:
+-                Q_ASSERT(isolatePairs.at(isolatePairPosition).start == i);
+                 doEmbed(true, false, true);
+-                ++isolatePairPosition;
+                 break;
+             case QChar::DirFSI: {
+-                const auto &pair = isolatePairs.at(isolatePairPosition);
+-                Q_ASSERT(pair.start == i);
+-                bool isRtl = QStringView(text + pair.start + 1, pair.end - pair.start - 1).isRightToLeft();
++                bool isRtl = false;
++                if (isolatePairPosition < isolatePairs.size()) {
++                    const auto &pair = isolatePairs.at(isolatePairPosition);
++                    Q_ASSERT(pair.start == i);
++                    isRtl = QStringView(text + pair.start + 1, pair.end - pair.start - 1).isRightToLeft();
++                }
+                 doEmbed(isRtl, false, true);
+-                ++isolatePairPosition;
+                 break;
+             }
+ 
+diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+index 9c477589f93..f0a32c2ed40 100644
+--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
++++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+@@ -138,6 +138,7 @@ private slots:
+     void noModificationOfInputString();
+     void superscriptCrash_qtbug53911();
+     void showLineAndParagraphSeparatorsCrash();
++    void tooManyDirectionalCharctersCrash_qtbug77819();
+ 
+ private:
+     QFont testFont;
+@@ -2309,5 +2310,21 @@ void tst_QTextLayout::nbspWithFormat()
+     QCOMPARE(layout.lineAt(1).textLength(), s2.length() + 1 + s3.length());
+ }
+ 
++void tst_QTextLayout::tooManyDirectionalCharctersCrash_qtbug77819()
++{
++    QString data;
++    data += QString::fromUtf8("\xe2\x81\xa8"); // U+2068 FSI character
++    data += QString::fromUtf8("\xe2\x81\xa7"); // U+2067 RLI character
++
++    // duplicating the text
++    for (int i = 0; i < 10; i++)
++        data += data;
++
++    // Nothing to test. It must not crash in beginLayout().
++    QTextLayout tl(data);
++    tl.beginLayout();
++    tl.endLayout();
++}
++
+ QTEST_MAIN(tst_QTextLayout)
+ #include "tst_qtextlayout.moc"
+-- 
+2.16.3

diff --git a/dev-qt/qtcore/qtcore-5.12.3-r1.ebuild b/dev-qt/qtcore/qtcore-5.12.3-r1.ebuild
new file mode 100644
index 00000000000..ff88ef5f4ec
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.12.3-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+QT5_MODULE="qtbase"
+inherit qt5-build
+
+DESCRIPTION="Cross-platform application development framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~arm ~x86"
+fi
+
+IUSE="icu systemd"
+
+DEPEND="
+	dev-libs/double-conversion:=
+	dev-libs/glib:2
+	dev-libs/libpcre2[pcre16,unicode]
+	sys-libs/zlib:=
+	icu? ( dev-libs/icu:= )
+	!icu? ( virtual/libiconv )
+	systemd? ( sys-apps/systemd:= )
+"
+RDEPEND="${DEPEND}
+	!<dev-qt/qtcore-4.8.7-r4:4
+"
+
+QT5_TARGET_SUBDIRS=(
+	src/tools/bootstrap
+	src/tools/moc
+	src/tools/rcc
+	src/tools/qfloat16-tables
+	src/corelib
+	src/tools/qlalr
+	doc
+)
+
+QT5_GENTOO_PRIVATE_CONFIG=(
+	!:network
+	!:sql
+	!:testlib
+	!:xml
+)
+
+PATCHES=( "${FILESDIR}/${P}-CVE-2019-18281.patch" )
+
+src_prepare() {
+	# don't add -O3 to CXXFLAGS, bug 549140
+	sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die
+
+	# fix missing qt_version_tag symbol w/ LTO, bug 674382
+	sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
+
+	qt5-build_src_prepare
+}
+
+src_configure() {
+	local myconf=(
+		-no-feature-statx	# bug 672856
+		$(qt_use icu)
+		$(qt_use !icu iconv)
+		$(qt_use systemd journald)
+	)
+	qt5-build_src_configure
+}
+
+src_install() {
+	qt5-build_src_install
+
+	local flags=(
+		DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG
+		OPENGL OPENSSL SSL WIDGETS
+	)
+
+	for flag in ${flags[@]}; do
+		cat >> "${D%/}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
+
+			#if defined(QT_NO_${flag}) && defined(QT_${flag})
+			# undef QT_NO_${flag}
+			#elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
+			# define QT_NO_${flag}
+			#endif
+		_EOF_
+	done
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2018-10-19 20:23 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2018-10-19 20:23 UTC (permalink / raw
  To: gentoo-commits

commit:     6151f696be8a9c1f35f708a30fc884d30fe5605b
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 19 20:07:24 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Oct 19 20:23:29 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6151f696

dev-qt/qtcore: Fix build with x86

Thanks-to: Sylvia <fierevere <AT> ya.ru>
Closes: https://bugs.gentoo.org/669010
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 .../files/qtcore-5.11.2-export-qt_open64.patch     | 31 +++++++++
 dev-qt/qtcore/qtcore-5.11.2-r1.ebuild              | 79 ++++++++++++++++++++++
 2 files changed, 110 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.11.2-export-qt_open64.patch b/dev-qt/qtcore/files/qtcore-5.11.2-export-qt_open64.patch
new file mode 100644
index 00000000000..a0a6bff9f66
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.11.2-export-qt_open64.patch
@@ -0,0 +1,31 @@
+From 4fc4f7b0ce0e6ee186a7d7fe9b5dd20e94efe432 Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Fri, 21 Sep 2018 09:04:24 -0700
+Subject: [PATCH] Export qt_open64 from QtCore
+
+Other libs use qcore_unix_p.h.
+
+qopenglprogrambinarycache.cpp:function QOpenGLProgramBinaryCache::load(QByteArray const&, unsigned int): error: undefined reference to 'qt_open64(char const*, int, unsigned int)'
+
+Change-Id: I44e7d800c68141bdaae0fffd155675d15eded2e4
+Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
+Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
+---
+ src/corelib/kernel/qcore_unix_p.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
+index cb98bef3476..5a2a29a3273 100644
+--- a/src/corelib/kernel/qcore_unix_p.h
++++ b/src/corelib/kernel/qcore_unix_p.h
+@@ -178,7 +178,7 @@ inline void qt_ignore_sigpipe()
+ 
+ #if defined(Q_PROCESSOR_X86_32) && defined(__GLIBC__)
+ #  if !__GLIBC_PREREQ(2, 22)
+-int qt_open64(const char *pathname, int flags, mode_t);
++Q_CORE_EXPORT int qt_open64(const char *pathname, int flags, mode_t);
+ #    undef QT_OPEN
+ #    define QT_OPEN qt_open64
+ #  endif
+-- 
+2.16.3

diff --git a/dev-qt/qtcore/qtcore-5.11.2-r1.ebuild b/dev-qt/qtcore/qtcore-5.11.2-r1.ebuild
new file mode 100644
index 00000000000..e40ed0f6f4a
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.11.2-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+QT5_MODULE="qtbase"
+inherit qt5-build
+
+DESCRIPTION="Cross-platform application development framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd"
+fi
+
+IUSE="icu systemd"
+
+DEPEND="
+	dev-libs/double-conversion:=
+	dev-libs/glib:2
+	dev-libs/libpcre2[pcre16,unicode]
+	sys-libs/zlib
+	icu? ( dev-libs/icu:= )
+	!icu? ( virtual/libiconv )
+	systemd? ( sys-apps/systemd:= )
+"
+RDEPEND="${DEPEND}
+	!<dev-qt/qtcore-4.8.7-r4:4
+"
+
+QT5_TARGET_SUBDIRS=(
+	src/tools/bootstrap
+	src/tools/moc
+	src/tools/rcc
+	src/tools/qfloat16-tables
+	src/corelib
+	src/tools/qlalr
+	doc
+)
+
+QT5_GENTOO_PRIVATE_CONFIG=(
+	!:network
+	!:sql
+	!:testlib
+	!:xml
+)
+
+PATCHES=(
+	"${FILESDIR}/${P}-export-qt_open64.patch" # bug 669010
+)
+
+src_configure() {
+	local myconf=(
+		$(qt_use icu)
+		$(qt_use !icu iconv)
+		$(qt_use systemd journald)
+	)
+	qt5-build_src_configure
+}
+
+src_install() {
+	qt5-build_src_install
+
+	local flags=(
+		ALSA CUPS DBUS EGL EGLFS EGL_X11 EVDEV FONTCONFIG FREETYPE
+		HARFBUZZ IMAGEFORMAT_JPEG IMAGEFORMAT_PNG LIBPROXY MITSHM
+		OPENGL OPENSSL OPENVG PULSEAUDIO SHAPE SSL TSLIB WIDGETS
+		XCURSOR	XFIXES XKB XRANDR XSYNC ZLIB
+	)
+
+	for flag in ${flags[@]}; do
+		cat >> "${D%/}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
+
+			#if defined(QT_NO_${flag}) && defined(QT_${flag})
+			# undef QT_NO_${flag}
+			#elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
+			# define QT_NO_${flag}
+			#endif
+		_EOF_
+	done
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2017-05-14  0:14 Davide Pesavento
  0 siblings, 0 replies; 15+ messages in thread
From: Davide Pesavento @ 2017-05-14  0:14 UTC (permalink / raw
  To: gentoo-commits

commit:     43c10326958cf85bccdb6270b5963cba45052412
Author:     Zhao Yongming <ming.zym <AT> gmail <DOT> com>
AuthorDate: Tue Apr 11 07:16:08 2017 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Sun May 14 00:13:39 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43c10326

dev-qt/qtcore: fix building against libressl

Patch from libressl overlay.

Closes: https://github.com/gentoo/gentoo/pull/4409
Gentoo-Bug: 584796

Package-Manager: Portage-2.3.5, Repoman-2.3.2

 dev-qt/qtcore/files/qtcore-4.8.7-libressl.patch | 52 +++++++++++++++++++++++++
 dev-qt/qtcore/qtcore-4.8.7-r2.ebuild            |  1 +
 2 files changed, 53 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-4.8.7-libressl.patch b/dev-qt/qtcore/files/qtcore-4.8.7-libressl.patch
new file mode 100644
index 00000000000..b838c7a687b
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-4.8.7-libressl.patch
@@ -0,0 +1,52 @@
+--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig	2015-11-25 01:38:42.103898399 -0500
++++ src/network/ssl/qsslsocket_openssl_symbols.cpp	2015-11-25 01:40:50.146247648 -0500
+@@ -224,13 +224,17 @@
+ #ifndef OPENSSL_NO_SSL2
+ DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+ DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
++#endif
+ DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
+ DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
+ #ifndef OPENSSL_NO_SSL2
+ DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+ DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
++#endif
+ DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
+ DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
+ #else
+@@ -818,13 +822,17 @@
+ #ifndef OPENSSL_NO_SSL2
+     RESOLVEFUNC(SSLv2_client_method)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+     RESOLVEFUNC(SSLv3_client_method)
++#endif
+     RESOLVEFUNC(SSLv23_client_method)
+     RESOLVEFUNC(TLSv1_client_method)
+ #ifndef OPENSSL_NO_SSL2
+     RESOLVEFUNC(SSLv2_server_method)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+     RESOLVEFUNC(SSLv3_server_method)
++#endif
+     RESOLVEFUNC(SSLv23_server_method)
+     RESOLVEFUNC(TLSv1_server_method)
+     RESOLVEFUNC(X509_NAME_entry_count)
+--- src/network/ssl/qsslsocket_openssl.cpp.orig	2015-11-25 01:44:55.235087906 -0500
++++ src/network/ssl/qsslsocket_openssl.cpp	2015-11-25 01:45:45.194443818 -0500
+@@ -263,7 +263,11 @@
+ #endif
+         break;
+     case QSsl::SslV3:
++#ifndef OPENSSL_NO_SSL3
+         ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method());
++#else
++        ctx = 0; // SSL 3 not supported by the system, but chosen deliberately -> error
++#endif
+         break;
+     case QSsl::SecureProtocols: // SslV2 will be disabled below
+     case QSsl::TlsV1SslV3: // SslV2 will be disabled below

diff --git a/dev-qt/qtcore/qtcore-4.8.7-r2.ebuild b/dev-qt/qtcore/qtcore-4.8.7-r2.ebuild
index dd67e084f00..d7f2cb00d27 100644
--- a/dev-qt/qtcore/qtcore-4.8.7-r2.ebuild
+++ b/dev-qt/qtcore/qtcore-4.8.7-r2.ebuild
@@ -37,6 +37,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch" # bug 514968
 	"${FILESDIR}/${PN}-4.8.5-qeventdispatcher-recursive.patch" # bug 514968
 	"${FILESDIR}/${PN}-4.8.6-moc-boost-1.60.patch" # bug 556104
+	"${FILESDIR}/${PN}-4.8.7-libressl.patch" # bug 584796
 )
 
 QT4_TARGET_DIRECTORIES="


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2017-04-23 19:08 Andreas Sturmlechner
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Sturmlechner @ 2017-04-23 19:08 UTC (permalink / raw
  To: gentoo-commits

commit:     87e6967f8b82468e077a8f2004732e2db1cbf751
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 23 13:54:19 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Apr 23 19:07:31 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87e6967f

dev-qt/qtcore: Try to fix random plasmashell crashes

Backports from Qt-5.8.0.

See also: https://bugs.kde.org/show_bug.cgi?id=342763

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 dev-qt/qtcore/files/qtcore-5.7.1-qipm.patch    | 152 +++++++++++++++
 dev-qt/qtcore/files/qtcore-5.7.1-qsfpm-1.patch | 252 +++++++++++++++++++++++++
 dev-qt/qtcore/files/qtcore-5.7.1-qsfpm-2.patch | 195 +++++++++++++++++++
 dev-qt/qtcore/qtcore-5.7.1-r3.ebuild           |  48 +++++
 4 files changed, 647 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.7.1-qipm.patch b/dev-qt/qtcore/files/qtcore-5.7.1-qipm.patch
new file mode 100644
index 00000000000..abea1458807
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.7.1-qipm.patch
@@ -0,0 +1,152 @@
+From baad82d242a4d8c1af6c87faaa7f25584183fd53 Mon Sep 17 00:00:00 2001
+From: Stephen Kelly <steveire@gmail.com>
+Date: Tue, 20 Dec 2016 00:44:12 +0000
+Subject: [PATCH] QIPM: Persist model indexes after emitting layoutChange, not
+ before
+
+Callers can persist a QModelIndex which was not persisted before in a
+slot connected to the signal, and such a persisted index must be updated
+in the course of the layoutChange.
+
+Store the indexes to persist after emitting the signal.
+
+Task-number: QTBUG-32981
+Change-Id: Ibee4c0d84817d72603a03fe5b22fdeefeac0695e
+Reviewed-by: David Faure <david.faure@kdab.com>
+---
+ src/corelib/itemmodels/qidentityproxymodel.cpp     | 18 ++---
+ .../tst_qidentityproxymodel.cpp                    | 76 ++++++++++++++++++++++
+ 2 files changed, 85 insertions(+), 9 deletions(-)
+
+diff --git a/src/corelib/itemmodels/qidentityproxymodel.cpp b/src/corelib/itemmodels/qidentityproxymodel.cpp
+index e537793..7c30679 100644
+--- a/src/corelib/itemmodels/qidentityproxymodel.cpp
++++ b/src/corelib/itemmodels/qidentityproxymodel.cpp
+@@ -496,15 +496,6 @@ void QIdentityProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<QPe
+ {
+     Q_Q(QIdentityProxyModel);
+ 
+-    const auto proxyPersistentIndexes = q->persistentIndexList();
+-    for (const QPersistentModelIndex &proxyPersistentIndex : proxyPersistentIndexes) {
+-        proxyIndexes << proxyPersistentIndex;
+-        Q_ASSERT(proxyPersistentIndex.isValid());
+-        const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex);
+-        Q_ASSERT(srcPersistentIndex.isValid());
+-        layoutChangePersistentIndexes << srcPersistentIndex;
+-    }
+-
+     QList<QPersistentModelIndex> parents;
+     parents.reserve(sourceParents.size());
+     for (const QPersistentModelIndex &parent : sourceParents) {
+@@ -518,6 +509,15 @@ void QIdentityProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<QPe
+     }
+ 
+     q->layoutAboutToBeChanged(parents, hint);
++
++    const auto proxyPersistentIndexes = q->persistentIndexList();
++    for (const QPersistentModelIndex &proxyPersistentIndex : proxyPersistentIndexes) {
++        proxyIndexes << proxyPersistentIndex;
++        Q_ASSERT(proxyPersistentIndex.isValid());
++        const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex);
++        Q_ASSERT(srcPersistentIndex.isValid());
++        layoutChangePersistentIndexes << srcPersistentIndex;
++    }
+ }
+ 
+ void QIdentityProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint)
+diff --git a/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
+index e946f31..564b854 100644
+--- a/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
++++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
+@@ -68,6 +68,8 @@ private slots:
+ 
+     void itemData();
+ 
++    void persistIndexOnLayoutChange();
++
+ protected:
+     void verifyIdentity(QAbstractItemModel *model, const QModelIndex &parent = QModelIndex());
+ 
+@@ -377,5 +379,79 @@ void tst_QIdentityProxyModel::itemData()
+     QCOMPARE(proxy.itemData(topIndex).value(Qt::DisplayRole).toString(), QStringLiteral("Monday_appended"));
+ }
+ 
++void dump(QAbstractItemModel* model, QString const& indent = " - ", QModelIndex const& parent = {})
++{
++    for (auto row = 0; row < model->rowCount(parent); ++row)
++    {
++        auto idx = model->index(row, 0, parent);
++        qDebug() << (indent + idx.data().toString());
++        dump(model, indent + "- ", idx);
++    }
++}
++
++void tst_QIdentityProxyModel::persistIndexOnLayoutChange()
++{
++    DynamicTreeModel model;
++
++    QList<int> ancestors;
++    for (auto i = 0; i < 3; ++i)
++    {
++        Q_UNUSED(i);
++        ModelInsertCommand insertCommand(&model);
++        insertCommand.setAncestorRowNumbers(ancestors);
++        insertCommand.setStartRow(0);
++        insertCommand.setEndRow(0);
++        insertCommand.doCommand();
++        ancestors.push_back(0);
++    }
++    ModelInsertCommand insertCommand(&model);
++    insertCommand.setAncestorRowNumbers(ancestors);
++    insertCommand.setStartRow(0);
++    insertCommand.setEndRow(1);
++    insertCommand.doCommand();
++
++    // dump(&model);
++    // " - 1"
++    // " - - 2"
++    // " - - - 3"
++    // " - - - - 4"
++    // " - - - - 5"
++
++    QIdentityProxyModel proxy;
++    proxy.setSourceModel(&model);
++
++    QPersistentModelIndex persistentIndex;
++
++    QPersistentModelIndex sourcePersistentIndex = model.match(model.index(0, 0), Qt::DisplayRole, "5", 1, Qt::MatchRecursive).first();
++
++    QCOMPARE(sourcePersistentIndex.data().toString(), QStringLiteral("5"));
++
++    bool gotLayoutAboutToBeChanged = false;
++    bool gotLayoutChanged = false;
++
++    QObject::connect(&proxy, &QAbstractItemModel::layoutAboutToBeChanged, &proxy, [&proxy, &persistentIndex, &gotLayoutAboutToBeChanged]
++    {
++        gotLayoutAboutToBeChanged = true;
++        persistentIndex = proxy.match(proxy.index(0, 0), Qt::DisplayRole, "5", 1, Qt::MatchRecursive).first();
++    });
++
++    QObject::connect(&proxy, &QAbstractItemModel::layoutChanged, &proxy, [&proxy, &persistentIndex, &sourcePersistentIndex, &gotLayoutChanged]
++    {
++        gotLayoutChanged = true;
++        QCOMPARE(QModelIndex(persistentIndex), proxy.mapFromSource(sourcePersistentIndex));
++    });
++
++    ModelChangeChildrenLayoutsCommand layoutChangeCommand(&model, 0);
++
++    layoutChangeCommand.setAncestorRowNumbers(QList<int>{0, 0, 0});
++    layoutChangeCommand.setSecondAncestorRowNumbers(QList<int>{0, 0});
++
++    layoutChangeCommand.doCommand();
++
++    QVERIFY(gotLayoutAboutToBeChanged);
++    QVERIFY(gotLayoutChanged);
++    QVERIFY(persistentIndex.isValid());
++}
++
+ QTEST_MAIN(tst_QIdentityProxyModel)
+ #include "tst_qidentityproxymodel.moc"
+-- 
+2.7.4
+

diff --git a/dev-qt/qtcore/files/qtcore-5.7.1-qsfpm-1.patch b/dev-qt/qtcore/files/qtcore-5.7.1-qsfpm-1.patch
new file mode 100644
index 00000000000..9edbe18617a
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.7.1-qsfpm-1.patch
@@ -0,0 +1,252 @@
+From 3bd0fd8f97e7a33a874929a383a42e6c710bfff3 Mon Sep 17 00:00:00 2001
+From: Stephen Kelly <steveire@gmail.com>
+Date: Sat, 17 Dec 2016 06:20:06 +0000
+Subject: [PATCH] QSFPM: Fix handling of source model layout change
+
+In sourceLayoutAboutToBeChanged the source model update is ignored if
+the affected parents are filtered out anyway.  The same logic is
+attempted in the sourceLayoutChanged slot, but there the early-return
+logic is applied too late - the mapping is cleared before performing the
+early-return.  Because pointers into the mapping are used in the
+internalPointer of QModelIndexes in this class, persistent indexes used
+later will segfault when attempting to dereference it.
+
+Additionally, if a parent becomes invalid as a result of the
+layoutChange, it would be filtered out by the condition in the loop,
+resulting in a different result in the comparison of emptiness of the
+parents container.
+
+Fix that by persisting the parent's container, and performing the test
+for early-return before clearing the mapping.
+
+Task-number: QTBUG-47711
+Task-number: QTBUG-32981
+Change-Id: If45e8a1c97d39454160f52041bc9ae7e337dce97
+Reviewed-by: David Faure <david.faure@kdab.com>
+---
+ src/corelib/itemmodels/qsortfilterproxymodel.cpp   |  31 ++---
+ .../tst_qsortfilterproxymodel.cpp                  | 126 +++++++++++++++++++++
+ 2 files changed, 137 insertions(+), 20 deletions(-)
+
+diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+index b0ddfa8..3331521 100644
+--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
++++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+@@ -171,6 +171,7 @@ public:
+     QRowsRemoval itemsBeingRemoved;
+ 
+     QModelIndexPairList saved_persistent_indexes;
++    QList<QPersistentModelIndex> saved_layoutChange_parents;
+ 
+     QHash<QModelIndex, Mapping *>::const_iterator create_mapping(
+         const QModelIndex &source_parent) const;
+@@ -1331,23 +1332,23 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<Q
+     Q_UNUSED(hint); // We can't forward Hint because we might filter additional rows or columns
+     saved_persistent_indexes.clear();
+ 
+-    QList<QPersistentModelIndex> parents;
++    saved_layoutChange_parents.clear();
+     for (const QPersistentModelIndex &parent : sourceParents) {
+         if (!parent.isValid()) {
+-            parents << QPersistentModelIndex();
++            saved_layoutChange_parents << QPersistentModelIndex();
+             continue;
+         }
+         const QModelIndex mappedParent = q->mapFromSource(parent);
+         // Might be filtered out.
+         if (mappedParent.isValid())
+-            parents << mappedParent;
++            saved_layoutChange_parents << mappedParent;
+     }
+ 
+     // All parents filtered out.
+-    if (!sourceParents.isEmpty() && parents.isEmpty())
++    if (!sourceParents.isEmpty() && saved_layoutChange_parents.isEmpty())
+         return;
+ 
+-    emit q->layoutAboutToBeChanged(parents);
++    emit q->layoutAboutToBeChanged(saved_layoutChange_parents);
+     if (persistent.indexes.isEmpty())
+         return;
+ 
+@@ -1359,6 +1360,9 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersisten
+     Q_Q(QSortFilterProxyModel);
+     Q_UNUSED(hint); // We can't forward Hint because we might filter additional rows or columns
+ 
++    if (!sourceParents.isEmpty() && saved_layoutChange_parents.isEmpty())
++        return;
++
+     // Optimize: We only actually have to clear the mapping related to the contents of
+     // sourceParents, not everything.
+     qDeleteAll(source_index_mapping);
+@@ -1373,21 +1377,8 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersisten
+         source_index_mapping.clear();
+     }
+ 
+-    QList<QPersistentModelIndex> parents;
+-    for (const QPersistentModelIndex &parent : sourceParents) {
+-        if (!parent.isValid()) {
+-            parents << QPersistentModelIndex();
+-            continue;
+-        }
+-        const QModelIndex mappedParent = q->mapFromSource(parent);
+-        if (mappedParent.isValid())
+-            parents << mappedParent;
+-    }
+-
+-    if (!sourceParents.isEmpty() && parents.isEmpty())
+-        return;
+-
+-    emit q->layoutChanged(parents);
++    emit q->layoutChanged(saved_layoutChange_parents);
++    saved_layoutChange_parents.clear();
+ }
+ 
+ void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeInserted(
+diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+index 38e3c68..6b98d9f 100644
+--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
++++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+@@ -145,6 +145,8 @@ private slots:
+     void canDropMimeData();
+     void filterHint();
+ 
++    void sourceLayoutChangeLeavesValidPersistentIndexes();
++
+ protected:
+     void buildHierarchy(const QStringList &data, QAbstractItemModel *model);
+     void checkHierarchy(const QStringList &data, const QAbstractItemModel *model);
+@@ -4181,5 +4183,129 @@ void tst_QSortFilterProxyModel::filterHint()
+              QAbstractItemModel::NoLayoutChangeHint);
+ }
+ 
++/**
++
++  Creates a model where each item has one child, to a set depth,
++  and the last item has no children.  For a model created with
++  setDepth(4):
++
++    - 1
++    - - 2
++    - - - 3
++    - - - - 4
++*/
++class StepTreeModel : public QAbstractItemModel
++{
++    Q_OBJECT
++public:
++    StepTreeModel(QObject * parent = 0)
++        : QAbstractItemModel(parent), m_depth(0) {}
++
++    int columnCount(const QModelIndex& = QModelIndex()) const override { return 1; }
++
++    int rowCount(const QModelIndex& parent = QModelIndex()) const override
++    {
++        quintptr parentId = (parent.isValid()) ? parent.internalId() : 0;
++        return (parentId < m_depth) ? 1 : 0;
++    }
++
++    QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override
++    {
++        if (role != Qt::DisplayRole)
++            return QVariant();
++
++        return QString::number(index.internalId());
++    }
++
++    QModelIndex index(int, int, const QModelIndex& parent = QModelIndex()) const override
++    {
++        quintptr parentId = (parent.isValid()) ? parent.internalId() : 0;
++        if (parentId >= m_depth)
++            return QModelIndex();
++
++        return createIndex(0, 0, parentId + 1);
++    }
++
++    QModelIndex parent(const QModelIndex& index) const override
++    {
++        if (index.internalId() == 0)
++            return QModelIndex();
++
++        return createIndex(0, 0, index.internalId() - 1);
++    }
++
++    void setDepth(quintptr depth)
++    {
++        int parentIdWithLayoutChange = (m_depth < depth) ? m_depth : depth;
++
++        QList<QPersistentModelIndex> parentsOfLayoutChange;
++        parentsOfLayoutChange.push_back(createIndex(0, 0, parentIdWithLayoutChange));
++
++        layoutAboutToBeChanged(parentsOfLayoutChange);
++
++        auto existing = persistentIndexList();
++
++        QList<QModelIndex> updated;
++
++        for (auto idx : existing) {
++            if (indexDepth(idx) <= depth)
++                updated.push_back(idx);
++            else
++                updated.push_back({});
++        }
++
++        m_depth = depth;
++
++        changePersistentIndexList(existing, updated);
++
++        layoutChanged(parentsOfLayoutChange);
++    }
++
++private:
++    static quintptr indexDepth(QModelIndex const& index)
++    {
++        return (index.isValid()) ? 1 + indexDepth(index.parent()) : 0;
++    }
++
++private:
++    quintptr m_depth;
++};
++
++void tst_QSortFilterProxyModel::sourceLayoutChangeLeavesValidPersistentIndexes()
++{
++    StepTreeModel model;
++    Q_SET_OBJECT_NAME(model);
++    model.setDepth(4);
++
++    QSortFilterProxyModel proxy1;
++    proxy1.setSourceModel(&model);
++    Q_SET_OBJECT_NAME(proxy1);
++
++    proxy1.setFilterRegExp("1|2");
++
++    // The current state of things:
++    //  model         proxy
++    //   - 1           - 1
++    //   - - 2         - - 2
++    //   - - - 3
++    //   - - - - 4
++
++    // The setDepth call below removes '4' with a layoutChanged call.
++    // Because the proxy filters that out anyway, the proxy doesn't need
++    // to emit any signals or update persistent indexes.
++
++    QPersistentModelIndex persistentIndex = proxy1.index(0, 0, proxy1.index(0, 0));
++
++    model.setDepth(3);
++
++    // Calling parent() causes the internalPointer to be used.
++    // Before fixing QTBUG-47711, that could be a dangling pointer.
++    // The use of qDebug here makes sufficient use of the heap to
++    // cause corruption at runtime with normal use on linux (before
++    // the fix). valgrind confirms the fix.
++    qDebug() << persistentIndex.parent();
++    QVERIFY(persistentIndex.parent().isValid());
++}
++
+ QTEST_MAIN(tst_QSortFilterProxyModel)
+ #include "tst_qsortfilterproxymodel.moc"
+-- 
+2.7.4
+
+

diff --git a/dev-qt/qtcore/files/qtcore-5.7.1-qsfpm-2.patch b/dev-qt/qtcore/files/qtcore-5.7.1-qsfpm-2.patch
new file mode 100644
index 00000000000..973649637e6
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.7.1-qsfpm-2.patch
@@ -0,0 +1,195 @@
+From 0874861bcc70313c343aba5e5566ed30b69eed1c Mon Sep 17 00:00:00 2001
+From: Stephen Kelly <steveire@gmail.com>
+Date: Mon, 19 Dec 2016 21:13:57 +0000
+Subject: [PATCH] QSFPM: Remove data manipulation from move handlers
+
+Similar to the fix in the parent commit, incorrect updating of the
+internal data structures during layout changes can lead to dangling
+pointers being dereferenced later.  Moves are treated as layoutChanges
+by this proxy by forwarding to the appropriate method.  However, data is
+incorrectly cleared prior to that forwarding.  Remove that, and let the
+layoutChange handling take appropriate action.
+
+Change-Id: Iee951e37152328a4e6a5fb8e5385c32a2fe4c0bd
+Reviewed-by: David Faure <david.faure@kdab.com>
+---
+ src/corelib/itemmodels/qsortfilterproxymodel.cpp   | 67 ++++------------------
+ .../tst_qsortfilterproxymodel.cpp                  | 46 +++++++++++++++
+ 2 files changed, 58 insertions(+), 55 deletions(-)
+
+diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+index 3331521..226a240 100644
+--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
++++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+@@ -1418,49 +1418,27 @@ void QSortFilterProxyModelPrivate::_q_sourceRowsRemoved(
+ void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeMoved(
+     const QModelIndex &sourceParent, int /* sourceStart */, int /* sourceEnd */, const QModelIndex &destParent, int /* dest */)
+ {
+-    Q_Q(QSortFilterProxyModel);
+     // Because rows which are contiguous in the source model might not be contiguous
+     // in the proxy due to sorting, the best thing we can do here is be specific about what
+     // parents are having their children changed.
+     // Optimize: Emit move signals if the proxy is not sorted. Will need to account for rows
+     // being filtered out though.
+ 
+-    saved_persistent_indexes.clear();
+-
+     QList<QPersistentModelIndex> parents;
+-    parents << q->mapFromSource(sourceParent);
++    parents << sourceParent;
+     if (sourceParent != destParent)
+-      parents << q->mapFromSource(destParent);
+-    emit q->layoutAboutToBeChanged(parents);
+-    if (persistent.indexes.isEmpty())
+-        return;
+-    saved_persistent_indexes = store_persistent_indexes();
++        parents << destParent;
++    _q_sourceLayoutAboutToBeChanged(parents, QAbstractItemModel::NoLayoutChangeHint);
+ }
+ 
+ void QSortFilterProxyModelPrivate::_q_sourceRowsMoved(
+     const QModelIndex &sourceParent, int /* sourceStart */, int /* sourceEnd */, const QModelIndex &destParent, int /* dest */)
+ {
+-    Q_Q(QSortFilterProxyModel);
+-
+-    // Optimize: We only need to clear and update the persistent indexes which are children of
+-    // sourceParent or destParent
+-    qDeleteAll(source_index_mapping);
+-    source_index_mapping.clear();
+-
+-    update_persistent_indexes(saved_persistent_indexes);
+-    saved_persistent_indexes.clear();
+-
+-    if (dynamic_sortfilter && update_source_sort_column()) {
+-        //update_source_sort_column might have created wrong mapping so we have to clear it again
+-        qDeleteAll(source_index_mapping);
+-        source_index_mapping.clear();
+-    }
+-
+     QList<QPersistentModelIndex> parents;
+-    parents << q->mapFromSource(sourceParent);
++    parents << sourceParent;
+     if (sourceParent != destParent)
+-      parents << q->mapFromSource(destParent);
+-    emit q->layoutChanged(parents);
++        parents << destParent;
++    _q_sourceLayoutChanged(parents, QAbstractItemModel::NoLayoutChangeHint);
+ }
+ 
+ void QSortFilterProxyModelPrivate::_q_sourceColumnsAboutToBeInserted(
+@@ -1522,42 +1500,21 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsRemoved(
+ void QSortFilterProxyModelPrivate::_q_sourceColumnsAboutToBeMoved(
+     const QModelIndex &sourceParent, int /* sourceStart */, int /* sourceEnd */, const QModelIndex &destParent, int /* dest */)
+ {
+-    Q_Q(QSortFilterProxyModel);
+-
+-    saved_persistent_indexes.clear();
+-
+     QList<QPersistentModelIndex> parents;
+-    parents << q->mapFromSource(sourceParent);
++    parents << sourceParent;
+     if (sourceParent != destParent)
+-      parents << q->mapFromSource(destParent);
+-    emit q->layoutAboutToBeChanged(parents);
+-
+-    if (persistent.indexes.isEmpty())
+-        return;
+-    saved_persistent_indexes = store_persistent_indexes();
++        parents << destParent;
++    _q_sourceLayoutAboutToBeChanged(parents, QAbstractItemModel::NoLayoutChangeHint);
+ }
+ 
+ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved(
+     const QModelIndex &sourceParent, int /* sourceStart */, int /* sourceEnd */, const QModelIndex &destParent, int /* dest */)
+ {
+-    Q_Q(QSortFilterProxyModel);
+-
+-    qDeleteAll(source_index_mapping);
+-    source_index_mapping.clear();
+-
+-    update_persistent_indexes(saved_persistent_indexes);
+-    saved_persistent_indexes.clear();
+-
+-    if (dynamic_sortfilter && update_source_sort_column()) {
+-        qDeleteAll(source_index_mapping);
+-        source_index_mapping.clear();
+-    }
+-
+     QList<QPersistentModelIndex> parents;
+-    parents << q->mapFromSource(sourceParent);
++    parents << sourceParent;
+     if (sourceParent != destParent)
+-      parents << q->mapFromSource(destParent);
+-    emit q->layoutChanged(parents);
++        parents << destParent;
++    _q_sourceLayoutChanged(parents, QAbstractItemModel::NoLayoutChangeHint);
+ }
+ 
+ /*!
+diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+index 6b98d9f..7b6c470 100644
+--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
++++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+@@ -146,6 +146,7 @@ private slots:
+     void filterHint();
+ 
+     void sourceLayoutChangeLeavesValidPersistentIndexes();
++    void rowMoveLeavesValidPersistentIndexes();
+ 
+ protected:
+     void buildHierarchy(const QStringList &data, QAbstractItemModel *model);
+@@ -4307,5 +4308,50 @@ void tst_QSortFilterProxyModel::sourceLayoutChangeLeavesValidPersistentIndexes()
+     QVERIFY(persistentIndex.parent().isValid());
+ }
+ 
++void tst_QSortFilterProxyModel::rowMoveLeavesValidPersistentIndexes()
++{
++    DynamicTreeModel model;
++    Q_SET_OBJECT_NAME(model);
++
++    QList<int> ancestors;
++    for (auto i = 0; i < 5; ++i)
++    {
++        Q_UNUSED(i);
++        ModelInsertCommand insertCommand(&model);
++        insertCommand.setAncestorRowNumbers(ancestors);
++        insertCommand.setStartRow(0);
++        insertCommand.setEndRow(0);
++        insertCommand.doCommand();
++        ancestors.push_back(0);
++    }
++
++    QSortFilterProxyModel proxy1;
++    proxy1.setSourceModel(&model);
++    Q_SET_OBJECT_NAME(proxy1);
++
++    proxy1.setFilterRegExp("1|2");
++
++    auto item5 = model.match(model.index(0, 0), Qt::DisplayRole, "5", 1, Qt::MatchRecursive).first();
++    auto item3 = model.match(model.index(0, 0), Qt::DisplayRole, "3", 1, Qt::MatchRecursive).first();
++
++    Q_ASSERT(item5.isValid());
++    Q_ASSERT(item3.isValid());
++
++    QPersistentModelIndex persistentIndex = proxy1.match(proxy1.index(0, 0), Qt::DisplayRole, "2", 1, Qt::MatchRecursive).first();
++
++    ModelMoveCommand moveCommand(&model, 0);
++    moveCommand.setAncestorRowNumbers(QList<int>{0, 0, 0, 0});
++    moveCommand.setStartRow(0);
++    moveCommand.setEndRow(0);
++    moveCommand.setDestRow(0);
++    moveCommand.setDestAncestors(QList<int>{0, 0, 0});
++    moveCommand.doCommand();
++
++    // Calling parent() causes the internalPointer to be used.
++    // Before fixing QTBUG-47711 (moveRows case), that could be
++    // a dangling pointer.
++    QVERIFY(persistentIndex.parent().isValid());
++}
++
+ QTEST_MAIN(tst_QSortFilterProxyModel)
+ #include "tst_qsortfilterproxymodel.moc"
+-- 
+2.7.4
+
+

diff --git a/dev-qt/qtcore/qtcore-5.7.1-r3.ebuild b/dev-qt/qtcore/qtcore-5.7.1-r3.ebuild
new file mode 100644
index 00000000000..93fad42b1eb
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.7.1-r3.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+QT5_MODULE="qtbase"
+inherit qt5-build
+
+DESCRIPTION="Cross-platform application development framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86"
+fi
+
+IUSE="icu systemd"
+
+DEPEND="
+	dev-libs/double-conversion:=
+	dev-libs/glib:2
+	>=dev-libs/libpcre-8.38[pcre16,unicode]
+	>=sys-libs/zlib-1.2.5
+	virtual/libiconv
+	icu? ( dev-libs/icu:= )
+	systemd? ( sys-apps/systemd:= )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-5.6.2-plugins.patch
+	"${FILESDIR}"/${P}-qipm.patch
+	"${FILESDIR}"/${P}-qsfpm-{1,2}.patch
+)
+
+QT5_TARGET_SUBDIRS=(
+	src/tools/bootstrap
+	src/tools/moc
+	src/tools/rcc
+	src/corelib
+	src/tools/qlalr
+	doc
+)
+
+src_configure() {
+	local myconf=(
+		$(qt_use icu)
+		$(qt_use systemd journald)
+	)
+	qt5-build_src_configure
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2016-11-17 14:36 Michael Palimaka
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Palimaka @ 2016-11-17 14:36 UTC (permalink / raw
  To: gentoo-commits

commit:     5ebe88c3c2988c62baaffb71e0249e97fc30ba51
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 14:35:17 2016 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 14:35:55 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ebe88c3

dev-qt/qtcore: backport patch from upstream that resolves various crashes

Gentoo-bug: 581068

Package-Manager: portage-2.3.2

 dev-qt/qtcore/files/qtcore-5.6.2-plugins.patch | 81 ++++++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.6.2-r1.ebuild           | 43 ++++++++++++++
 2 files changed, 124 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.6.2-plugins.patch b/dev-qt/qtcore/files/qtcore-5.6.2-plugins.patch
new file mode 100644
index 00000000..d969869
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.6.2-plugins.patch
@@ -0,0 +1,81 @@
+From ca4d93d85ee446c5e30ec8e7814651e45cbf1218 Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Thu, 12 Nov 2015 10:14:51 -0800
+Subject: Stop unloading plugins in QPluginLoader and QFactoryLoader
+
+QPluginLoader hasn't unloaded in its destructor since Qt 5.0, but we
+missed the equivalent code in QFactoryLoader (which bypasses
+QPluginLoader). Besides, QPluginLoader::unload() was still doing
+unloading, which it won't anymore.
+
+Not unloading plugins is Qt's policy, as decided during the 5.0
+development process and reaffirmed now in 5.6. This is due to static
+data in plugins leaking out and remaining in use past the unloading of
+the plugin, causing crashes.
+
+This does not affect QLibrary and QLibrary::unload(). Those are meant
+for non-Qt loadable modules, so unloading them may be safe.
+
+Task-number: QTBUG-49061
+Discussed-on: http://lists.qt-project.org/pipermail/development/2015-November/023681.html
+Change-Id: I461e9fc7199748faa187ffff1416070f138df8db
+(cherry picked from commit 494376f980e96339b6f1eff7c41336ca4d853065)
+Discussed-again-on: http://lists.qt-project.org/pipermail/development/2016-October/027476.html
+Reviewed-by: Lars Knoll <lars.knoll@qt.io>
+---
+ src/corelib/plugin/qfactoryloader.cpp | 6 ++++--
+ src/corelib/plugin/qpluginloader.cpp  | 5 +++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
+index dcf1b1a..b6558f5 100644
+--- a/src/corelib/plugin/qfactoryloader.cpp
++++ b/src/corelib/plugin/qfactoryloader.cpp
+@@ -208,10 +208,12 @@ void QFactoryLoader::update()
+                     ++keyUsageCount;
+                 }
+             }
+-            if (keyUsageCount || keys.isEmpty())
++            if (keyUsageCount || keys.isEmpty()) {
++                library->setLoadHints(QLibrary::PreventUnloadHint); // once loaded, don't unload
+                 d->libraryList += library;
+-            else
++            } else {
+                 library->release();
++            }
+         }
+     }
+ #else
+diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
+index 37f2368..0ea8280 100644
+--- a/src/corelib/plugin/qpluginloader.cpp
++++ b/src/corelib/plugin/qpluginloader.cpp
+@@ -148,6 +148,7 @@ QPluginLoader::QPluginLoader(const QString &fileName, QObject *parent)
+     : QObject(parent), d(0), did_load(false)
+ {
+     setFileName(fileName);
++    setLoadHints(QLibrary::PreventUnloadHint);
+ }
+ 
+ /*!
+@@ -342,7 +343,7 @@ static QString locatePlugin(const QString& fileName)
+ void QPluginLoader::setFileName(const QString &fileName)
+ {
+ #if defined(QT_SHARED)
+-    QLibrary::LoadHints lh;
++    QLibrary::LoadHints lh = QLibrary::PreventUnloadHint;
+     if (d) {
+         lh = d->loadHints();
+         d->release();
+@@ -391,7 +392,7 @@ Q_GLOBAL_STATIC(StaticPluginList, staticPluginList)
+     \brief Give the load() function some hints on how it should behave.
+ 
+     You can give hints on how the symbols in the plugin are
+-    resolved. By default, none of the hints are set.
++    resolved. By default since Qt 5.7, QLibrary::PreventUnloadHint is set.
+ 
+     See the documentation of QLibrary::loadHints for a complete
+     description of how this property works.
+-- 
+cgit v1.0-4-g1e03
+

diff --git a/dev-qt/qtcore/qtcore-5.6.2-r1.ebuild b/dev-qt/qtcore/qtcore-5.6.2-r1.ebuild
new file mode 100644
index 00000000..3ae1e1c
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.6.2-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+QT5_MODULE="qtbase"
+inherit qt5-build
+
+DESCRIPTION="Cross-platform application development framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86"
+fi
+
+IUSE="icu systemd"
+
+DEPEND="
+	dev-libs/glib:2
+	>=dev-libs/libpcre-8.38[pcre16,unicode]
+	>=sys-libs/zlib-1.2.5
+	virtual/libiconv
+	icu? ( dev-libs/icu:= )
+	systemd? ( sys-apps/systemd:= )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-plugins.patch" )
+
+QT5_TARGET_SUBDIRS=(
+	src/tools/bootstrap
+	src/tools/moc
+	src/tools/rcc
+	src/corelib
+	src/tools/qlalr
+)
+
+src_configure() {
+	local myconf=(
+		$(qt_use icu)
+		$(qt_use systemd journald)
+	)
+	qt5-build_src_configure
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
@ 2015-10-20  1:36 Davide Pesavento
  0 siblings, 0 replies; 15+ messages in thread
From: Davide Pesavento @ 2015-10-20  1:36 UTC (permalink / raw
  To: gentoo-commits

commit:     b13815a11545ddf9d5ef1db942ad7aea1d8c58c3
Author:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 20 01:35:27 2015 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Tue Oct 20 01:35:27 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b13815a1

dev-qt/qtcore: fix build on ia64

Gentoo-Bug: 559802

Package-Manager: portage-2.2.23

 .../qtcore/files/qtcore-5.5.1-qatomic_ia64.h.patch | 45 ++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.5.1.ebuild                  |  4 ++
 2 files changed, 49 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.5.1-qatomic_ia64.h.patch b/dev-qt/qtcore/files/qtcore-5.5.1-qatomic_ia64.h.patch
new file mode 100644
index 0000000..c45fd91
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.5.1-qatomic_ia64.h.patch
@@ -0,0 +1,45 @@
+From deb6b5032c8eed35021b3c697a770645d90b11ed Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89meric=20MASCHINO?= <emeric.maschino@gmail.com>
+Date: Wed, 9 Sep 2015 22:56:32 +0200
+Subject: [PATCH] Fixed compilation errors in qatomic_ia64.h
+
+QBasicAtomicOps<size>::testAndSetRelaxed(T &, T, T) and
+QBasicAtomicOps<size>::testAndSetOrdered(T &, T, T) bodies don't match
+any prototypes in qatomic_ia64.h: the optional parameter T *currentValue
+is missing.
+
+Task-number: QTBUG-48197
+Change-Id: I0112c429b161b4a0ddb6e8a0400a436282ffb1c7
+Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
+---
+ src/corelib/arch/qatomic_ia64.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/corelib/arch/qatomic_ia64.h b/src/corelib/arch/qatomic_ia64.h
+index c880e85..2ba6d12 100644
+--- a/src/corelib/arch/qatomic_ia64.h
++++ b/src/corelib/arch/qatomic_ia64.h
+@@ -1035,16 +1035,16 @@ bool QBasicAtomicOps<size>::deref(T &_q_value) Q_DECL_NOTHROW
+ }
+ 
+ template<int size> template <typename T> inline
+-bool QBasicAtomicOps<size>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW
++bool QBasicAtomicOps<size>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW
+ {
+-    return testAndSetAcquire(_q_value, expectedValue, newValue);
++    return testAndSetAcquire(_q_value, expectedValue, newValue, currentValue);
+ }
+ 
+ template<int size> template <typename T> inline
+-bool QBasicAtomicOps<size>::testAndSetOrdered(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW
++bool QBasicAtomicOps<size>::testAndSetOrdered(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW
+ {
+     orderedMemoryFence(_q_value);
+-    return testAndSetAcquire(_q_value, expectedValue, newValue);
++    return testAndSetAcquire(_q_value, expectedValue, newValue, currentValue);
+ }
+ 
+ template<int size> template <typename T> inline
+-- 
+2.6.2
+

diff --git a/dev-qt/qtcore/qtcore-5.5.1.ebuild b/dev-qt/qtcore/qtcore-5.5.1.ebuild
index 6ba815b..9f42484 100644
--- a/dev-qt/qtcore/qtcore-5.5.1.ebuild
+++ b/dev-qt/qtcore/qtcore-5.5.1.ebuild
@@ -24,6 +24,10 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+	"${FILESDIR}/${P}-qatomic_ia64.h.patch" # bug 559802
+)
+
 QT5_TARGET_SUBDIRS=(
 	src/tools/bootstrap
 	src/tools/moc


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-02-19 13:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-28 11:00 [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/ Michael Palimaka
  -- strict thread matches above, loose matches on Subject: below --
2023-02-19 13:24 Andreas Sturmlechner
2023-02-05 13:54 Andreas Sturmlechner
2022-06-26  8:25 Sam James
2022-03-30 18:57 Andreas Sturmlechner
2021-08-25 14:36 Andreas Sturmlechner
2021-02-13 11:38 Andreas Sturmlechner
2021-01-02  1:23 Andreas Sturmlechner
2020-02-09 18:51 Andreas Sturmlechner
2020-01-25 23:56 Andreas Sturmlechner
2018-10-19 20:23 Andreas Sturmlechner
2017-05-14  0:14 Davide Pesavento
2017-04-23 19:08 Andreas Sturmlechner
2016-11-17 14:36 Michael Palimaka
2015-10-20  1:36 Davide Pesavento

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox