public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2016-04-10 13:10 Davide Pesavento
  0 siblings, 0 replies; 14+ messages in thread
From: Davide Pesavento @ 2016-04-10 13:10 UTC (permalink / raw
  To: gentoo-commits

commit:     db8680a067ad1ed5499ee4ea2f727a302a3b16fd
Author:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 10 13:10:12 2016 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Sun Apr 10 13:10:38 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db8680a0

dev-qt/qtcore: backport upstream patch fixing build against >=systemd-229-r100

Gentoo-Bug: 578316

Package-Manager: portage-2.2.28

 dev-qt/qtcore/files/qtcore-5.5.1-libsystemd.patch | 56 +++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.5.1-r1.ebuild              |  5 +-
 2 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/dev-qt/qtcore/files/qtcore-5.5.1-libsystemd.patch b/dev-qt/qtcore/files/qtcore-5.5.1-libsystemd.patch
new file mode 100644
index 0000000..edb58d1
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.5.1-libsystemd.patch
@@ -0,0 +1,56 @@
+From c689bcafd3196aad22372e8056fe0ccb13c15f35 Mon Sep 17 00:00:00 2001
+From: Heiko Becker <heirecka@exherbo.org>
+Date: Fri, 12 Feb 2016 12:37:15 +0100
+Subject: Search for libsystemd first, fall back to libsystemd-journal
+
+systemd >= 209 merged the individual libraries libsystemd-journal,
+libsystemd-login, libsystemd-id128 and libsystemd-daemon into
+a single library, libsystemd. To ease the transition one could pass
+an option to its build to generate stub libraries and matching
+pkg-config files. With systemd >= 229 this option has now been
+removed, causing the build to fail when the journald option is
+enabled.
+
+Change-Id: I26670f207f1a9e79c16be5ce8c8a49353143c5ba
+Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
+Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
+---
+ config.tests/unix/journald/journald.pro | 6 +++++-
+ src/corelib/global/global.pri           | 5 ++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/config.tests/unix/journald/journald.pro b/config.tests/unix/journald/journald.pro
+index 2bb50ce..ea76564 100644
+--- a/config.tests/unix/journald/journald.pro
++++ b/config.tests/unix/journald/journald.pro
+@@ -1,6 +1,10 @@
+ SOURCES = journald.c
+ 
+ CONFIG += link_pkgconfig
+-PKGCONFIG_PRIVATE += libsystemd-journal
++
++packagesExist(libsystemd): \
++    PKGCONFIG_PRIVATE += libsystemd
++else: \
++    PKGCONFIG_PRIVATE += libsystemd-journal
+ 
+ CONFIG -= qt
+diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
+index aa4945f..dd84695 100644
+--- a/src/corelib/global/global.pri
++++ b/src/corelib/global/global.pri
+@@ -53,7 +53,10 @@ slog2 {
+ 
+ journald {
+     CONFIG += link_pkgconfig
+-    PKGCONFIG_PRIVATE += libsystemd-journal
++    packagesExist(libsystemd): \
++        PKGCONFIG_PRIVATE += libsystemd
++    else: \
++        PKGCONFIG_PRIVATE += libsystemd-journal
+     DEFINES += QT_USE_JOURNALD
+ }
+ 
+-- 
+2.8.1
+

diff --git a/dev-qt/qtcore/qtcore-5.5.1-r1.ebuild b/dev-qt/qtcore/qtcore-5.5.1-r1.ebuild
index 2781f1e..f6506e9 100644
--- a/dev-qt/qtcore/qtcore-5.5.1-r1.ebuild
+++ b/dev-qt/qtcore/qtcore-5.5.1-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -25,7 +25,8 @@ DEPEND="
 RDEPEND="${DEPEND}"
 
 PATCHES=(
-	"${FILESDIR}/${P}-qatomic_ia64.h.patch" # bug 559802
+	"${FILESDIR}/${PN}-5.5.1-qatomic_ia64.h.patch" # bug 559802
+	"${FILESDIR}/${PN}-5.5.1-libsystemd.patch" # bug 578316
 )
 
 QT5_TARGET_SUBDIRS=(


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

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2016-04-16 17:14 Davide Pesavento
  0 siblings, 0 replies; 14+ messages in thread
From: Davide Pesavento @ 2016-04-16 17:14 UTC (permalink / raw
  To: gentoo-commits

commit:     a9c5c21338553698f4f94deeede165c665042324
Author:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 16 17:07:40 2016 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Sat Apr 16 17:13:54 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9c5c213

dev-qt/qtcore: extend moc patch with workarounds for newer boost versions

Gentoo-Bug: 556104

Package-Manager: portage-2.2.28

 dev-qt/qtcore/files/qtcore-4.8.6-moc-boost-1.60.patch | 16 ++++++++++++++++
 dev-qt/qtcore/qtcore-4.8.6-r2.ebuild                  |  4 ++--
 dev-qt/qtcore/qtcore-4.8.7-r1.ebuild                  |  4 ++--
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/dev-qt/qtcore/files/qtcore-4.8.6-moc-boost-1.60.patch b/dev-qt/qtcore/files/qtcore-4.8.6-moc-boost-1.60.patch
new file mode 100644
index 0000000..91a5526
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-4.8.6-moc-boost-1.60.patch
@@ -0,0 +1,16 @@
+diff -up qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp.QTBUG-22829 qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp
+--- qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp.QTBUG-22829	2015-05-07 09:14:44.000000000 -0500
++++ qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp	2016-03-16 13:20:43.145899869 -0500
+@@ -188,8 +188,11 @@ int runMoc(int _argc, char **_argv)
+     pp.macros["Q_MOC_RUN"];
+     pp.macros["__cplusplus"];
+ 
+-    // Workaround a bug while parsing the boost/type_traits/has_operator.hpp header. See QTBUG-22829
++    // Workaround a bug while parsing some boost headers. See QTBUG-22829
+     pp.macros["BOOST_TT_HAS_OPERATOR_HPP_INCLUDED"];
++    pp.macros["BOOST_LEXICAL_CAST_INCLUDED"];
++    pp.macros["BOOST_NEXT_PRIOR_HPP_INCLUDED"];
++    pp.macros["BOOST_TYPE_TRAITS_HPP"];
+ 
+     QByteArray filename;
+     QByteArray output;

diff --git a/dev-qt/qtcore/qtcore-4.8.6-r2.ebuild b/dev-qt/qtcore/qtcore-4.8.6-r2.ebuild
index e56367b..365c019 100644
--- a/dev-qt/qtcore/qtcore-4.8.6-r2.ebuild
+++ b/dev-qt/qtcore/qtcore-4.8.6-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -29,10 +29,10 @@ MULTILIB_WRAPPED_HEADERS=(
 )
 
 PATCHES=(
-	"${FILESDIR}/${PN}-4.8.5-moc-boost-lexical-cast.patch"
 	"${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-QNAM-corruptions-fix.patch" # bug 548622
+	"${FILESDIR}/${PN}-4.8.6-moc-boost-1.60.patch" # bug 556104
 )
 
 QT4_TARGET_DIRECTORIES="

diff --git a/dev-qt/qtcore/qtcore-4.8.7-r1.ebuild b/dev-qt/qtcore/qtcore-4.8.7-r1.ebuild
index c2d986b..331ce32 100644
--- a/dev-qt/qtcore/qtcore-4.8.7-r1.ebuild
+++ b/dev-qt/qtcore/qtcore-4.8.7-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -35,9 +35,9 @@ MULTILIB_WRAPPED_HEADERS=(
 )
 
 PATCHES=(
-	"${FILESDIR}/${PN}-4.8.5-moc-boost-lexical-cast.patch"
 	"${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
 )
 
 QT4_TARGET_DIRECTORIES="


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

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2017-10-26 12:11 Michael Palimaka
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Palimaka @ 2017-10-26 12:11 UTC (permalink / raw
  To: gentoo-commits

commit:     c4e4d38735de346d371854586b1fea91a043d391
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 26 12:10:15 2017 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Thu Oct 26 12:11:12 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4e4d387

dev-qt/qtcore: improve moc patch to solve breakage with sys-libs/glibc-2.25-r8

Patch from Fedora.

Bug: https://bugs.gentoo.org/635394
Package-Manager: Portage-2.3.8, Repoman-2.3.3

 dev-qt/qtcore/files/qtcore-4.8.7-moc.patch | 17 ++++++
 dev-qt/qtcore/qtcore-4.8.7-r3.ebuild       | 92 ++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-4.8.7-moc.patch b/dev-qt/qtcore/files/qtcore-4.8.7-moc.patch
new file mode 100644
index 00000000000..7660dedc163
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-4.8.7-moc.patch
@@ -0,0 +1,17 @@
+diff -up qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp.QTBUG-22829 qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp
+--- qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp.QTBUG-22829	2015-05-07 09:14:44.000000000 -0500
++++ qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp	2016-03-16 13:20:43.145899869 -0500
+@@ -188,8 +188,12 @@ int runMoc(int _argc, char **_argv)
+     pp.macros["Q_MOC_RUN"];
+     pp.macros["__cplusplus"];
+ 
+-    // Workaround a bug while parsing the boost/type_traits/has_operator.hpp header. See QTBUG-22829
++    // Workaround a bug while parsing some boost headers. See QTBUG-22829
+     pp.macros["BOOST_TT_HAS_OPERATOR_HPP_INCLUDED"];
++    pp.macros["BOOST_LEXICAL_CAST_INCLUDED"];
++    pp.macros["BOOST_NEXT_PRIOR_HPP_INCLUDED"];
++    pp.macros["BOOST_TYPE_TRAITS_HPP"];
++    pp.macros["_SYS_SYSMACROS_H_OUTER"];
+ 
+     QByteArray filename;
+     QByteArray output;

diff --git a/dev-qt/qtcore/qtcore-4.8.7-r3.ebuild b/dev-qt/qtcore/qtcore-4.8.7-r3.ebuild
new file mode 100644
index 00000000000..d4979c7760e
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-4.8.7-r3.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="Cross-platform application development framework"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="+glib iconv icu libressl qt3support ssl"
+
+DEPEND="
+	>=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+	glib? ( dev-libs/glib:2[${MULTILIB_USEDEP}] )
+	iconv? ( >=virtual/libiconv-0-r2[${MULTILIB_USEDEP}] )
+	icu? ( dev-libs/icu:=[${MULTILIB_USEDEP}] )
+	ssl? (
+		!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+		libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
+	)
+"
+RDEPEND="${DEPEND}"
+PDEPEND="
+	~dev-qt/qttranslations-${PV}
+	qt3support? ( ~dev-qt/qtgui-${PV}[aqua=,debug=,glib=,qt3support,${MULTILIB_USEDEP}] )
+"
+
+MULTILIB_WRAPPED_HEADERS=(
+	/usr/include/qt4/Qt/qconfig.h
+	/usr/include/qt4/QtCore/qconfig.h
+)
+
+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.7-libressl.patch" # bug 584796
+	"${FILESDIR}/${PN}-4.8.7-moc.patch" # bug 556104, 635394
+)
+
+QT4_TARGET_DIRECTORIES="
+	src/tools/bootstrap
+	src/tools/moc
+	src/tools/rcc
+	src/tools/uic
+	src/corelib
+	src/network
+	src/xml
+	src/plugins/codecs/cn
+	src/plugins/codecs/jp
+	src/plugins/codecs/kr
+	src/plugins/codecs/tw
+	tools/linguist/lconvert
+	tools/linguist/lrelease
+	tools/linguist/lupdate"
+
+QCONFIG_DEFINE="QT_ZLIB"
+
+src_prepare() {
+	qt4-build-multilib_src_prepare
+
+	# bug 172219
+	sed -i -e "s:CXXFLAGS.*=:CXXFLAGS=${CXXFLAGS} :" \
+		-e "s:LFLAGS.*=:LFLAGS=${LDFLAGS} :" \
+		qmake/Makefile.unix || die "sed qmake/Makefile.unix failed"
+
+	# bug 427782
+	sed -i -e '/^CPPFLAGS\s*=/ s/-g //' \
+		qmake/Makefile.unix || die "sed CPPFLAGS in qmake/Makefile.unix failed"
+	sed -i -e 's/setBootstrapVariable QMAKE_CFLAGS_RELEASE/QMakeVar set QMAKE_CFLAGS_RELEASE/' \
+		-e 's/setBootstrapVariable QMAKE_CXXFLAGS_RELEASE/QMakeVar set QMAKE_CXXFLAGS_RELEASE/' \
+		configure || die "sed configure setBootstrapVariable failed"
+}
+
+multilib_src_configure() {
+	local myconf=(
+		-no-accessibility -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon
+		-no-phonon-backend -no-svg -no-webkit -no-script -no-scripttools -no-declarative
+		-system-zlib -no-gif -no-libtiff -no-libpng -no-libmng -no-libjpeg
+		-no-cups -no-dbus -no-gtkstyle -no-nas-sound -no-opengl -no-openvg
+		-no-sm -no-xshape -no-xvideo -no-xsync -no-xinerama -no-xcursor -no-xfixes
+		-no-xrandr -no-xrender -no-mitshm -no-fontconfig -no-freetype -no-xinput -no-xkb
+		$(qt_use glib)
+		$(qt_use iconv)
+		$(qt_use icu)
+		$(use ssl && echo -openssl-linked || echo -no-openssl)
+		$(qt_use qt3support)
+	)
+	qt4_multilib_src_configure
+}


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

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2018-06-16  7:38 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2018-06-16  7:38 UTC (permalink / raw
  To: gentoo-commits

commit:     f0846d1dae72990117b3928fe609e545bdaeb29f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 16 07:37:55 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Jun 16 07:37:55 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0846d1d

dev-qt/qtcore: Restore qt5_use_modules macro

See also: https://codereview.qt-project.org/#/c/232367/

Bug: https://bugs.gentoo.org/653646
Package-Manager: Portage-2.3.40, Repoman-2.3.9

 .../qtcore-5.11.0-restore-qt5_use_modules.patch    | 224 +++++++++++++++++++++
 ...11.0_rc2.ebuild => qtcore-5.11.0_rc2-r1.ebuild} |   2 +
 2 files changed, 226 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.11.0-restore-qt5_use_modules.patch b/dev-qt/qtcore/files/qtcore-5.11.0-restore-qt5_use_modules.patch
new file mode 100644
index 00000000000..3b1818d22bb
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.11.0-restore-qt5_use_modules.patch
@@ -0,0 +1,224 @@
+From d1bbe4acbd8ce09f8f4263bca1aa5682c6559c23 Mon Sep 17 00:00:00 2001
+From: Kevin Funk <kevin.funk@kdab.com>
+Date: Thu, 14 Jun 2018 14:50:39 +0200
+Subject: [PATCH] CMake: Restore qt5_use_modules() function
+
+It appears that in the 5 years since we deprecated this function, people
+have not stopped using it. The removal of qt5_use_modules() caused lots of
+troubles in packages still using it when they were compiled against Qt 5.11.0.
+
+Instead, let's revive this function and keep it for the Qt5 life time.
+
+See discussion on qt-development mailing list:
+  http://lists.qt-project.org/pipermail/development/2018-June/032837.html
+
+Change-Id: Ic263e3bb6706268cb9ea38a0711665f166a3aa9e
+---
+ src/corelib/Qt5CoreMacros.cmake                    | 51 ++++++++++++++++++++++
+ tests/auto/cmake/CMakeLists.txt                    |  1 +
+ .../cmake/test_use_modules_function/CMakeLists.txt | 18 ++++++++
+ .../auto/cmake/test_use_modules_function/three.cpp | 45 +++++++++++++++++++
+ tests/auto/cmake/test_use_modules_function/two.cpp | 43 ++++++++++++++++++
+ 5 files changed, 158 insertions(+)
+ create mode 100644 tests/auto/cmake/test_use_modules_function/CMakeLists.txt
+ create mode 100644 tests/auto/cmake/test_use_modules_function/three.cpp
+ create mode 100644 tests/auto/cmake/test_use_modules_function/two.cpp
+
+diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
+index 1627de40029..819b48f9734 100644
+--- a/src/corelib/Qt5CoreMacros.cmake
++++ b/src/corelib/Qt5CoreMacros.cmake
+@@ -294,3 +294,54 @@ function(QT5_ADD_RESOURCES outfiles )
+ endfunction()
+ 
+ set(_Qt5_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..")
++
++if (NOT CMAKE_VERSION VERSION_LESS 2.8.9)
++    macro(qt5_use_modules _target _link_type)
++        if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
++            if(CMAKE_WARN_DEPRECATED)
++                set(messageType WARNING)
++            endif()
++            if(CMAKE_ERROR_DEPRECATED)
++                set(messageType FATAL_ERROR)
++            endif()
++            if(messageType)
++                message(${messageType} "The qt5_use_modules macro is obsolete. Use target_link_libraries with IMPORTED targets instead.")
++            endif()
++        endif()
++
++        if (NOT TARGET ${_target})
++            message(FATAL_ERROR "The first argument to qt5_use_modules must be an existing target.")
++        endif()
++        if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE" )
++            set(_qt5_modules ${ARGN})
++            set(_qt5_link_type ${_link_type})
++        else()
++            set(_qt5_modules ${_link_type} ${ARGN})
++        endif()
++
++        if ("${_qt5_modules}" STREQUAL "")
++            message(FATAL_ERROR "qt5_use_modules requires at least one Qt module to use.")
++        endif()
++
++        foreach(_module ${_qt5_modules})
++            if (NOT Qt5${_module}_FOUND)
++                find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH)
++                if (NOT Qt5${_module}_FOUND)
++                    message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
++                endif()
++            endif()
++            target_link_libraries(${_target} ${_qt5_link_type} ${Qt5${_module}_LIBRARIES})
++            set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_module}_INCLUDE_DIRS})
++            set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_module}_COMPILE_DEFINITIONS})
++            set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
++            set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
++            set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
++            if (Qt5_POSITION_INDEPENDENT_CODE
++                    AND (CMAKE_VERSION VERSION_LESS 2.8.12
++                        AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
++                        OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)))
++                set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE})
++            endif()
++        endforeach()
++    endmacro()
++endif()
+diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
+index f1d86570919..ec75ec7caf7 100644
+--- a/tests/auto/cmake/CMakeLists.txt
++++ b/tests/auto/cmake/CMakeLists.txt
+@@ -47,6 +47,7 @@ find_package(Qt5Core REQUIRED)
+ 
+ include("${_Qt5CTestMacros}")
+ 
++expect_pass(test_use_modules_function)
+ expect_pass(test_umbrella_config)
+ expect_pass(test_wrap_cpp_and_resources)
+ if (NOT NO_WIDGETS)
+diff --git a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
+new file mode 100644
+index 00000000000..be05c75054c
+--- /dev/null
++++ b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
+@@ -0,0 +1,18 @@
++
++cmake_minimum_required(VERSION 2.8)
++
++project(test_use_modules_function)
++
++set(CMAKE_AUTOMOC ON)
++
++set(CMAKE_INCLUDE_CURRENT_DIR ON)
++
++add_executable(two two.cpp)
++add_executable(three three.cpp)
++
++find_package(Qt5Core)
++
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
++
++qt5_use_modules(two Test)
++qt5_use_modules(three Gui Test)
+diff --git a/tests/auto/cmake/test_use_modules_function/three.cpp b/tests/auto/cmake/test_use_modules_function/three.cpp
+new file mode 100644
+index 00000000000..507cc8479d0
+--- /dev/null
++++ b/tests/auto/cmake/test_use_modules_function/three.cpp
+@@ -0,0 +1,45 @@
++/****************************************************************************
++**
++** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
++** Contact: https://www.qt.io/licensing/
++**
++** This file is part of the test suite of the Qt Toolkit.
++**
++** $QT_BEGIN_LICENSE:GPL-EXCEPT$
++** Commercial License Usage
++** Licensees holding valid commercial Qt licenses may use this file in
++** accordance with the commercial license agreement provided with the
++** Software or, alternatively, in accordance with the terms contained in
++** a written agreement between you and The Qt Company. For licensing terms
++** and conditions see https://www.qt.io/terms-conditions. For further
++** information use the contact form at https://www.qt.io/contact-us.
++**
++** GNU General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU
++** General Public License version 3 as published by the Free Software
++** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
++** included in the packaging of this file. Please review the following
++** information to ensure the GNU General Public License requirements will
++** be met: https://www.gnu.org/licenses/gpl-3.0.html.
++**
++** $QT_END_LICENSE$
++**
++****************************************************************************/
++
++#include <QtTest>
++#include <QWindow>
++
++class Three : public QObject
++{
++    Q_OBJECT
++public:
++    Three(QObject *parent = 0)
++    {
++        QWindow *w = new QWindow;
++        w->show();
++    }
++};
++
++QTEST_MAIN(Three)
++
++#include "three.moc"
+diff --git a/tests/auto/cmake/test_use_modules_function/two.cpp b/tests/auto/cmake/test_use_modules_function/two.cpp
+new file mode 100644
+index 00000000000..44eb7fe96e3
+--- /dev/null
++++ b/tests/auto/cmake/test_use_modules_function/two.cpp
+@@ -0,0 +1,43 @@
++/****************************************************************************
++**
++** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
++** Contact: https://www.qt.io/licensing/
++**
++** This file is part of the test suite of the Qt Toolkit.
++**
++** $QT_BEGIN_LICENSE:GPL-EXCEPT$
++** Commercial License Usage
++** Licensees holding valid commercial Qt licenses may use this file in
++** accordance with the commercial license agreement provided with the
++** Software or, alternatively, in accordance with the terms contained in
++** a written agreement between you and The Qt Company. For licensing terms
++** and conditions see https://www.qt.io/terms-conditions. For further
++** information use the contact form at https://www.qt.io/contact-us.
++**
++** GNU General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU
++** General Public License version 3 as published by the Free Software
++** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
++** included in the packaging of this file. Please review the following
++** information to ensure the GNU General Public License requirements will
++** be met: https://www.gnu.org/licenses/gpl-3.0.html.
++**
++** $QT_END_LICENSE$
++**
++****************************************************************************/
++
++#include <QtTest>
++
++class Two : public QObject
++{
++    Q_OBJECT
++public:
++    Two(QObject *parent = 0)
++    {
++
++    }
++};
++
++QTEST_MAIN(Two)
++
++#include "two.moc"
+-- 
+2.16.3
+

diff --git a/dev-qt/qtcore/qtcore-5.11.0_rc2.ebuild b/dev-qt/qtcore/qtcore-5.11.0_rc2-r1.ebuild
similarity index 95%
rename from dev-qt/qtcore/qtcore-5.11.0_rc2.ebuild
rename to dev-qt/qtcore/qtcore-5.11.0_rc2-r1.ebuild
index 489161041fc..52a62e65c92 100644
--- a/dev-qt/qtcore/qtcore-5.11.0_rc2.ebuild
+++ b/dev-qt/qtcore/qtcore-5.11.0_rc2-r1.ebuild
@@ -43,6 +43,8 @@ QT5_GENTOO_PRIVATE_CONFIG=(
 	!:xml
 )
 
+PATCHES=( "${FILESDIR}/${PN}-5.11.0-restore-qt5_use_modules.patch" )
+
 src_configure() {
 	local myconf=(
 		$(qt_use icu)


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

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2020-02-02 23:24 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2020-02-02 23:24 UTC (permalink / raw
  To: gentoo-commits

commit:     2130279f2fa917a2e5ee9a29cd8413b39484897a
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  2 18:50:59 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Feb  2 23:23:54 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2130279f

dev-qt/qtcore: Fix CVE-2020-0569 and CVE-2020-0570

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

 .../qtcore/files/qtcore-5.12.3-CVE-2020-0569.patch | 28 +++++++
 .../qtcore/files/qtcore-5.12.3-CVE-2020-0570.patch | 54 +++++++++++++
 dev-qt/qtcore/qtcore-5.12.3-r2.ebuild              | 90 ++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.13.2-r2.ebuild              | 89 +++++++++++++++++++++
 4 files changed, 261 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2020-0569.patch b/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2020-0569.patch
new file mode 100644
index 00000000000..b0e5b564e2d
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2020-0569.patch
@@ -0,0 +1,28 @@
+From bf131e8d2181b3404f5293546ed390999f760404 Mon Sep 17 00:00:00 2001
+From: Olivier Goffart <ogoffart@woboq.com>
+Date: Fri, 8 Nov 2019 11:30:40 +0100
+Subject: Do not load plugin from the $PWD
+
+I see no reason why this would make sense to look for plugins in the current
+directory. And when there are plugins there, it may actually be wrong
+
+Change-Id: I5f5aa168021fedddafce90effde0d5762cd0c4c5
+Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
+---
+ src/corelib/plugin/qpluginloader.cpp | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
+index cadff4f32b..c2443dbdda 100644
+--- a/src/corelib/plugin/qpluginloader.cpp
++++ b/src/corelib/plugin/qpluginloader.cpp
+@@ -305,7 +305,6 @@ static QString locatePlugin(const QString& fileName)
+         paths.append(fileName.left(slash)); // don't include the '/'
+     } else {
+         paths = QCoreApplication::libraryPaths();
+-        paths.prepend(QStringLiteral(".")); // search in current dir first
+     }
+ 
+     for (const QString &path : qAsConst(paths)) {
+-- 
+cgit v1.2.1

diff --git a/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2020-0570.patch b/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2020-0570.patch
new file mode 100644
index 00000000000..1f6b2dfafec
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.12.3-CVE-2020-0570.patch
@@ -0,0 +1,54 @@
+From e6f1fde24f77f63fb16b2df239f82a89d2bf05dd Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Fri, 10 Jan 2020 09:26:27 -0800
+Subject: QLibrary/Unix: do not attempt to load a library relative to $PWD
+
+I added the code in commit 5219c37f7c98f37f078fee00fe8ca35d83ff4f5d to
+find libraries in a haswell/ subdir of the main path, but we only need
+to do that transformation if the library is contains at least one
+directory seprator. That is, if the user asks to load "lib/foo", then we
+should try "lib/haswell/foo" (often, the path prefix will be absolute).
+
+When the library name the user requested has no directory separators, we
+let dlopen() do the transformation for us. Testing on Linux confirms
+glibc does so:
+
+$ LD_DEBUG=libs /lib64/ld-linux-x86-64.so.2 --inhibit-cache ./qml -help |& grep Xcursor
+   1972475:     find library=libXcursor.so.1 [0]; searching
+   1972475:       trying file=/usr/lib64/haswell/avx512_1/libXcursor.so.1
+   1972475:       trying file=/usr/lib64/haswell/libXcursor.so.1
+   1972475:       trying file=/usr/lib64/libXcursor.so.1
+   1972475:     calling init: /usr/lib64/libXcursor.so.1
+   1972475:     calling fini: /usr/lib64/libXcursor.so.1 [0]
+
+Fixes: QTBUG-81272
+Change-Id: I596aec77785a4e4e84d5fffd15e89689bb91ffbb
+Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
+---
+ src/corelib/plugin/qlibrary_unix.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
+index f0de1010d7..135b82cd37 100644
+--- a/src/corelib/plugin/qlibrary_unix.cpp
++++ b/src/corelib/plugin/qlibrary_unix.cpp
+@@ -1,7 +1,7 @@
+ /****************************************************************************
+ **
+ ** Copyright (C) 2016 The Qt Company Ltd.
+-** Copyright (C) 2018 Intel Corporation
++** Copyright (C) 2020 Intel Corporation
+ ** Contact: https://www.qt.io/licensing/
+ **
+ ** This file is part of the QtCore module of the Qt Toolkit.
+@@ -218,6 +218,8 @@ bool QLibraryPrivate::load_sys()
+         for(int suffix = 0; retry && !pHnd && suffix < suffixes.size(); suffix++) {
+             if (!prefixes.at(prefix).isEmpty() && name.startsWith(prefixes.at(prefix)))
+                 continue;
++            if (path.isEmpty() && prefixes.at(prefix).contains(QLatin1Char('/')))
++                continue;
+             if (!suffixes.at(suffix).isEmpty() && name.endsWith(suffixes.at(suffix)))
+                 continue;
+             if (loadHints & QLibrary::LoadArchiveMemberHint) {
+-- 
+cgit v1.2.1

diff --git a/dev-qt/qtcore/qtcore-5.12.3-r2.ebuild b/dev-qt/qtcore/qtcore-5.12.3-r2.ebuild
new file mode 100644
index 00000000000..a4e53c82962
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.12.3-r2.ebuild
@@ -0,0 +1,90 @@
+# 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"
+	"${FILESDIR}/${P}-CVE-2020-0569.patch"
+	"${FILESDIR}/${P}-CVE-2020-0570.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
+}

diff --git a/dev-qt/qtcore/qtcore-5.13.2-r2.ebuild b/dev-qt/qtcore/qtcore-5.13.2-r2.ebuild
new file mode 100644
index 00000000000..417c8e6a627
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.13.2-r2.ebuild
@@ -0,0 +1,89 @@
+# 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/tools/qfloat16-tables
+	src/corelib
+	src/tools/qlalr
+	doc
+)
+
+QT5_GENTOO_PRIVATE_CONFIG=(
+	!:network
+	!:sql
+	!:testlib
+	!:xml
+)
+
+PATCHES=(
+	"${FILESDIR}/${PN}-5.12.3-CVE-2020-0569.patch"
+	"${FILESDIR}/${PN}-5.12.3-CVE-2020-0570.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] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2020-10-10 17:40 Andreas K. Hüttel
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas K. Hüttel @ 2020-10-10 17:40 UTC (permalink / raw
  To: gentoo-commits

commit:     8cc44eb4b719129f109dfa623efd5420d1665b63
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 10 17:39:33 2020 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Oct 10 17:40:00 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cc44eb4

dev-qt/qtcore: Revert timezone handling to 5.14 state

This is an obvious workaround, until we and upstream have
decided what to do...

Closes: https://bugs.gentoo.org/737914
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch | 271 +++++++++++++++++++++
 dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch |  47 ++++
 dev-qt/qtcore/qtcore-5.15.1-r1.ebuild              | 104 ++++++++
 3 files changed, 422 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch b/dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch
new file mode 100644
index 00000000000..1c8f1e89e7d
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.1-timezone-1.patch
@@ -0,0 +1,271 @@
+From c337f6fae51b987ce7dbed1fd9bea41e6073efbb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
+Date: Sat, 10 Oct 2020 19:26:13 +0200
+Subject: [PATCH 1/2] Revert "Cache system zone ID when fetched from the
+ file-system"
+
+This reverts commit c70ce3d042025c858faffe661f85d2482a2a0d8c.
+---
+ src/corelib/time/qtimezoneprivate_tz.cpp | 205 +++++++----------------
+ 1 file changed, 64 insertions(+), 141 deletions(-)
+
+diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
+index c5c70b7364..01f9a6cce0 100644
+--- a/src/corelib/time/qtimezoneprivate_tz.cpp
++++ b/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -1,6 +1,5 @@
+ /****************************************************************************
+ **
+-** Copyright (C) 2020 The Qt Company Ltd.
+ ** Copyright (C) 2019 Crimson AS <info@crimson.no>
+ ** Copyright (C) 2013 John Layt <jlayt@kde.org>
+ ** Contact: https://www.qt.io/licensing/
+@@ -43,19 +42,18 @@
+ #include "qtimezoneprivate_p.h"
+ #include "private/qlocale_tools_p.h"
+ 
+-#include <QtCore/QDataStream>
+-#include <QtCore/QDateTime>
+ #include <QtCore/QFile>
+-#include <QtCore/QHash>
+ #include <QtCore/QMutex>
++#include <QtCore/QHash>
++#include <QtCore/QDataStream>
++#include <QtCore/QDateTime>
+ 
+ #include <qdebug.h>
+-#include <qplatformdefs.h>
+ 
+ #include <algorithm>
+ #include <errno.h>
+ #include <limits.h>
+-#ifndef Q_OS_INTEGRITY
++#if !defined(Q_OS_INTEGRITY)
+ #include <sys/param.h> // to use MAXSYMLINKS constant
+ #endif
+ #include <unistd.h>    // to use _SC_SYMLOOP_MAX constant
+@@ -1102,146 +1100,28 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::previousTransition(qint64 beforeMSecs
+     return last > tranCache().cbegin() ? dataForTzTransition(*--last) : invalidData();
+ }
+ 
+-bool QTzTimeZonePrivate::isTimeZoneIdAvailable(const QByteArray &ianaId) const
+-{
+-    return tzZones->contains(ianaId);
+-}
+-
+-QList<QByteArray> QTzTimeZonePrivate::availableTimeZoneIds() const
+-{
+-    QList<QByteArray> result = tzZones->keys();
+-    std::sort(result.begin(), result.end());
+-    return result;
+-}
+-
+-QList<QByteArray> QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const
++static long getSymloopMax()
+ {
+-    // TODO AnyCountry
+-    QList<QByteArray> result;
+-    for (auto it = tzZones->cbegin(), end = tzZones->cend(); it != end; ++it) {
+-        if (it.value().country == country)
+-            result << it.key();
+-    }
+-    std::sort(result.begin(), result.end());
+-    return result;
+-}
+-
+-// Getting the system zone's ID:
+-
+-namespace {
+-class ZoneNameReader : public QObject
+-{
+-public:
+-    QByteArray name()
+-    {
+-        /* Assumptions:
+-           a) Systems don't change which of localtime and TZ they use without a
+-              reboot.
+-           b) When they change, they use atomic renames, hence a new device and
+-              inode for the new file.
+-           c) If we change which *name* is used for a zone, while referencing
+-              the same final zoneinfo file, we don't care about the change of
+-              name (e.g. if Europe/Oslo and Europe/Berlin are both symlinks to
+-              the same CET file, continuing to use the old name, after
+-              /etc/localtime changes which of the two it points to, is
+-              harmless).
+-
+-           The alternative would be to use a file-system watcher, but they are a
+-           scarce resource.
+-         */
+-        const StatIdent local = identify("/etc/localtime");
+-        const StatIdent tz = identify("/etc/TZ");
+-        if (!m_name.isEmpty() && m_last.isValid() && (m_last == local || m_last == tz))
+-            return m_name;
+-
+-        m_name = etcLocalTime();
+-        if (!m_name.isEmpty()) {
+-            m_last = local;
+-            return m_name;
+-        }
+-
+-        m_name = etcTZ();
+-        m_last = m_name.isEmpty() ? StatIdent() : tz;
+-        return m_name;
+-    }
+-
+-
+-private:
+-    QByteArray m_name;
+-    struct StatIdent
+-    {
+-        static constexpr unsigned long bad = ~0ul;
+-        unsigned long m_dev, m_ino;
+-        StatIdent() : m_dev(bad), m_ino(bad) {}
+-        StatIdent(const QT_STATBUF &data) : m_dev(data.st_dev), m_ino(data.st_ino) {}
+-        bool isValid() { return m_dev != bad || m_ino != bad; }
+-        bool operator==(const StatIdent &other)
+-        { return other.m_dev == m_dev && other.m_ino == m_ino; }
+-    };
+-    StatIdent m_last;
+-
+-    static StatIdent identify(const char *path)
+-    {
+-        QT_STATBUF data;
+-        return QT_STAT(path, &data) == -1 ? StatIdent() : StatIdent(data);
+-    }
+-
+-    static QByteArray etcLocalTime()
+-    {
+-        // On most distros /etc/localtime is a symlink to a real file so extract
+-        // name from the path
+-        const QLatin1String zoneinfo("/zoneinfo/");
+-        QString path = QStringLiteral("/etc/localtime");
+-        long iteration = getSymloopMax();
+-        // Symlink may point to another symlink etc. before being under zoneinfo/
+-        // We stop on the first path under /zoneinfo/, even if it is itself a
+-        // symlink, like America/Montreal pointing to America/Toronto
+-        do {
+-            path = QFile::symLinkTarget(path);
+-            int index = path.indexOf(zoneinfo);
+-            if (index >= 0) // Found zoneinfo file; extract zone name from path:
+-                return path.midRef(index + zoneinfo.size()).toUtf8();
+-        } while (!path.isEmpty() && --iteration > 0);
+-
+-        return QByteArray();
+-    }
+-
+-    static QByteArray etcTZ()
+-    {
+-        // Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ:
+-        const QString path = QStringLiteral("/etc/TZ");
+-        QFile zone(path);
+-        if (zone.open(QIODevice::ReadOnly))
+-            return zone.readAll().trimmed();
+-
+-        return QByteArray();
+-    }
+-
+-    // Any chain of symlinks longer than this is assumed to be a loop:
+-    static long getSymloopMax()
+-    {
+-#ifdef SYMLOOP_MAX
+-        // If defined, at runtime it can only be greater than this, so this is a safe bet:
+-        return SYMLOOP_MAX;
++#if defined(SYMLOOP_MAX)
++    return SYMLOOP_MAX; // if defined, at runtime it can only be greater than this, so this is a safe bet
+ #else
+-        errno = 0;
+-        long result = sysconf(_SC_SYMLOOP_MAX);
+-        if (result >= 0)
+-            return result;
+-        // result is -1, meaning either error or no limit
+-        Q_ASSERT(!errno); // ... but it can't be an error, POSIX mandates _SC_SYMLOOP_MAX
+-
+-        // therefore we can make up our own limit
+-#  ifdef MAXSYMLINKS
+-        return MAXSYMLINKS;
++    errno = 0;
++    long result = sysconf(_SC_SYMLOOP_MAX);
++    if (result >= 0)
++        return result;
++    // result is -1, meaning either error or no limit
++    Q_ASSERT(!errno); // ... but it can't be an error, POSIX mandates _SC_SYMLOOP_MAX
++
++    // therefore we can make up our own limit
++#  if defined(MAXSYMLINKS)
++    return MAXSYMLINKS;
+ #  else
+-        return 8;
++    return 8;
+ #  endif
+ #endif
+-    }
+-};
+ }
+ 
++// TODO Could cache the value and monitor the required files for any changes
+ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
+ {
+     // Check TZ env var first, if not populated try find it
+@@ -1256,9 +1136,28 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
+     else if (ianaId.startsWith(':'))
+         ianaId = ianaId.mid(1);
+ 
++    // On most distros /etc/localtime is a symlink to a real file so extract name from the path
++    if (ianaId.isEmpty()) {
++        const QLatin1String zoneinfo("/zoneinfo/");
++        QString path = QFile::symLinkTarget(QStringLiteral("/etc/localtime"));
++        int index = -1;
++        long iteration = getSymloopMax();
++        // Symlink may point to another symlink etc. before being under zoneinfo/
++        // We stop on the first path under /zoneinfo/, even if it is itself a
++        // symlink, like America/Montreal pointing to America/Toronto
++        while (iteration-- > 0 && !path.isEmpty() && (index = path.indexOf(zoneinfo)) < 0)
++            path = QFile::symLinkTarget(path);
++        if (index >= 0) {
++            // /etc/localtime is a symlink to the current TZ file, so extract from path
++            ianaId = path.midRef(index + zoneinfo.size()).toUtf8();
++        }
++    }
++
++    // Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ:
+     if (ianaId.isEmpty()) {
+-        thread_local static ZoneNameReader reader;
+-        ianaId = reader.name();
++        QFile zone(QStringLiteral("/etc/TZ"));
++        if (zone.open(QIODevice::ReadOnly))
++            ianaId = zone.readAll().trimmed();
+     }
+ 
+     // Give up for now and return UTC
+@@ -1268,4 +1167,28 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
+     return ianaId;
+ }
+ 
++bool QTzTimeZonePrivate::isTimeZoneIdAvailable(const QByteArray &ianaId) const
++{
++    return tzZones->contains(ianaId);
++}
++
++QList<QByteArray> QTzTimeZonePrivate::availableTimeZoneIds() const
++{
++    QList<QByteArray> result = tzZones->keys();
++    std::sort(result.begin(), result.end());
++    return result;
++}
++
++QList<QByteArray> QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Country country) const
++{
++    // TODO AnyCountry
++    QList<QByteArray> result;
++    for (auto it = tzZones->cbegin(), end = tzZones->cend(); it != end; ++it) {
++        if (it.value().country == country)
++            result << it.key();
++    }
++    std::sort(result.begin(), result.end());
++    return result;
++}
++
+ QT_END_NAMESPACE
+-- 
+2.28.0
+

diff --git a/dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch b/dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch
new file mode 100644
index 00000000000..611c979a469
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.1-timezone-2.patch
@@ -0,0 +1,47 @@
+From ffc9093a199a542791920b30d1835c3248920aa0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
+Date: Sat, 10 Oct 2020 19:26:35 +0200
+Subject: [PATCH 2/2] Revert "Purge two old time-zone lookup fallbacks"
+
+This reverts commit b0383cbd388336f698ceeac11a4f50cdff931dd9.
+---
+ src/corelib/time/qtimezoneprivate_tz.cpp | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
+index 01f9a6cce0..eea6f5e962 100644
+--- a/src/corelib/time/qtimezoneprivate_tz.cpp
++++ b/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -1153,6 +1153,29 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
+         }
+     }
+ 
++    // On Debian Etch up to Jessie, /etc/localtime is a copy of the relevant
++    // zoneinfo file, whose name is recorded in /etc/timezone:
++    if (ianaId.isEmpty()) {
++        QFile tzif(QStringLiteral("/etc/timezone"));
++        if (tzif.open(QIODevice::ReadOnly))
++            ianaId = tzif.readAll().trimmed();
++    }
++
++    // On some Red Hat distros /etc/localtime is real file with name held in /etc/sysconfig/clock
++    // in a line like ZONE="Europe/Oslo" or TIMEZONE="Europe/Oslo"
++    if (ianaId.isEmpty()) {
++        QFile tzif(QStringLiteral("/etc/sysconfig/clock"));
++        if (tzif.open(QIODevice::ReadOnly)) {
++            while (ianaId.isEmpty() && !tzif.atEnd()) {
++                const QByteArray line(tzif.readLine().trimmed());
++                if (line.startsWith("ZONE="))
++                    ianaId = line.mid(6, line.length() - 7);
++                else if (line.startsWith("TIMEZONE="))
++                    ianaId = line.mid(10, line.length() - 11);
++            }
++        }
++    }
++
+     // Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ:
+     if (ianaId.isEmpty()) {
+         QFile zone(QStringLiteral("/etc/TZ"));
+-- 
+2.28.0
+

diff --git a/dev-qt/qtcore/qtcore-5.15.1-r1.ebuild b/dev-qt/qtcore/qtcore-5.15.1-r1.ebuild
new file mode 100644
index 00000000000..e5a80a34d43
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.15.1-r1.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2020 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
+"
+
+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.patch"                   # bug 737914
+	"${FILESDIR}/${PN}-5.15.1-timezone-2.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
+
+	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] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2021-01-07 16:31 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2021-01-07 16:31 UTC (permalink / raw
  To: gentoo-commits

commit:     04865eef221ea16b0ec3c2b92f0a549bc56a8dce
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  7 15:54:57 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Jan  7 16:30:35 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04865eef

dev-qt/qtcore: Fix allocated memory of QByteArray

...returned by QIODevice::readLine.

See also: https://bugreports.qt.io/browse/QTBUG-87010
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...qtcore-5.15.2-fix-alloc-mem-of-QByteArray.patch |  54 +++++++++++
 dev-qt/qtcore/qtcore-5.15.2-r2.ebuild              | 106 +++++++++++++++++++++
 2 files changed, 160 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.2-fix-alloc-mem-of-QByteArray.patch b/dev-qt/qtcore/files/qtcore-5.15.2-fix-alloc-mem-of-QByteArray.patch
new file mode 100644
index 00000000000..892d89d2948
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.2-fix-alloc-mem-of-QByteArray.patch
@@ -0,0 +1,54 @@
+From 6485b6d45ad165cf976138cf8ab683c42515e794 Mon Sep 17 00:00:00 2001
+From: Kai Koehne <kai.koehne@qt.io>
+Date: Tue, 13 Oct 2020 15:47:31 +0200
+Subject: [PATCH] Fix allocated memory of QByteArray returned by
+ QIODevice::readLine
+
+If the maxSize argument is 0 (the default), QIODevice::readLine will
+allocate a QByteArray with the size of the next chunk of data, which
+may be quite large. Before returning, it then resizes the byte array
+to the actual size that was read.
+
+But since change 6b884d2aa129, QByteArray::resize() does no
+longer shrink the capacity. This means that the returned QByteArray
+keeps it's maximum size as allocated memory. This can lead to
+excessive memory consumption, especially if the returned QByteArray's
+are stored for further processing in the client code.
+
+Fix this by explicitly calling QByteArray::squeeze() before returning.
+
+[ChangeLog][QtCore][QIODevice] Fixes a regression in Qt 5.15 causing
+QByteArray's that are returned by QIODevice::readLine() to
+consume large amounts of memory.
+
+Fixes: QTBUG-87010
+Change-Id: I1f95fc4098849e900680fc945238bfeda881022c
+Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
+(cherry picked from commit 263b29eedb223dec1ecaee193302070af87a1852,
+limited squeeze() call if bytes are actually read to preserve retVal.isNull()
+behavior in 5.15)
+---
+ src/corelib/io/qiodevice.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
+index cc1d1102522..0f11c2e805c 100644
+--- a/src/corelib/io/qiodevice.cpp
++++ b/src/corelib/io/qiodevice.cpp
+@@ -1480,10 +1480,12 @@ QByteArray QIODevice::readLine(qint64 maxSize)
+     } else
+         readBytes = readLine(result.data(), result.size());
+ 
+-    if (readBytes <= 0)
++    if (readBytes <= 0) {
+         result.clear();
+-    else
++    } else {
+         result.resize(readBytes);
++        result.squeeze();
++    }
+ 
+     return result;
+ }
+-- 
+2.16.3

diff --git a/dev-qt/qtcore/qtcore-5.15.2-r2.ebuild b/dev-qt/qtcore/qtcore-5.15.2-r2.ebuild
new file mode 100644
index 00000000000..3fce1aceac5
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.15.2-r2.ebuild
@@ -0,0 +1,106 @@
+# 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
+	"${FILESDIR}"/${P}-fix-alloc-mem-of-QByteArray.patch # QTBUG-87010
+)
+
+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] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2021-09-22 20:01 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2021-09-22 20:01 UTC (permalink / raw
  To: gentoo-commits

commit:     8d4714fcd0c97dfa8c420ef2596923d9b3a5379f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 22 12:58:24 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Sep 22 19:47:17 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d4714fc

dev-qt/qtcore: Switch to KDE 64a00680 snapshot

Incorporates upstream commit d2bd04d9fe03912097d3246b7d03ef14f425256b,
so we can drop a patch from FILESDIR. Does not otherwise change anything
for dev-qt/qtcore.

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

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

diff --git a/dev-qt/qtcore/Manifest b/dev-qt/qtcore/Manifest
index 6ec5cdd58fd..6dd68edabe8 100644
--- a/dev-qt/qtcore/Manifest
+++ b/dev-qt/qtcore/Manifest
@@ -1,3 +1,3 @@
-DIST qtbase-5.15.2-c2ea67ec.tar.gz 67964503 BLAKE2B 2f55d1913d840a9150912074e81b7ebc38d86dbe259a51f65924868d97ed0cd5852fd6387e85933e956b0bd80404284b9e0f01506080f154751c0e1cf27ba398 SHA512 40eeaca1698613ab0c756053b58737cbef9fceed7cf7007aec5b558f992675a25d304ec83afdc7eab34bb854149d4e0ce61f2cc03003b553b4fc8a786f258e17
+DIST qtbase-5.15.2-64a00680.tar.gz 67963186 BLAKE2B ad8cdd4f18e44791467f607585eed0ef00d16316cf31f246eb4fb7db650af4a9831792a84df8c0a59c34a538eb43de85a3815558425e5cc6d5c77695e954d5d2 SHA512 c5959125cffbfc817024a039ae6c9c5b0a5b3fef0d45e178e008ba3e4fbd79ff35f2a97ebd986897b700aca50e14183891dcd517c18674ccec410c7b4bf45a12
 DIST qtbase-5.15.2-gcc11.patch.xz 1208 BLAKE2B a2e5764b723adda991eca5b84cf8e15437a4832febd12e3c93cdc394931af666e17c01e229e9be7e0efc446a955cc26388c0f93cadfcabd93cc6b6f03bb41eb0 SHA512 da3a41ea5d9573a029946d26b26d51d6dce9c8b91db6d78ca71d8343d3ceb5010d21750dcb45abb663e227b5f068985ff4ed51da07efd17c64cc8dd5aef8f3e4
 DIST qtbase-everywhere-src-5.15.2.tar.xz 50179672 BLAKE2B 0e4bdaab43cf59664bde89f87ea260c39acc2ef866d8629d41d9c326cab0ab68bcd943c86a472ae74bc9fb0b7ad50795ccb66275bb6b77d1fcf0a38b5662cb42 SHA512 a549bfaf867d746ff744ab224eb65ac1bdcdac7e8457dfa379941b2b225a90442fcfc1e1175b9afb1f169468f8130b7ab917c67be67156520a4bfb5c92d304f9

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
deleted file mode 100644
index a29e1b5256d..00000000000
--- a/dev-qt/qtcore/files/qtcore-5.15.2-revert-3a273ac4.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-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 d8791013a67..7cdf654113b 100644
--- a/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild
+++ b/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-KDE_ORG_COMMIT=c2ea67ecefe049f6e9bb8f910d7f9c60319d8619
+KDE_ORG_COMMIT=64a0068011e12f178fb7ff65fafe7cfaa4620719
 QT5_MODULE="qtbase"
 inherit linux-info qt5-build
 
@@ -48,9 +48,6 @@ 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] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2021-12-16 13:37 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2021-12-16 13:37 UTC (permalink / raw
  To: gentoo-commits

commit:     11cc810ba55dfd4db304cc59cefa8b53365337f2
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 16 13:32:37 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Dec 16 13:33:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11cc810b

dev-qt/qtcore: Fix stack smashing crash

Test it in ~arch while upstream are making up their minds.

See also: https://invent.kde.org/qt/qt/qtbase/-/merge_requests/81
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=445719
Bug: https://bugs.gentoo.org/824286
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/qtcore-5.15.2-fix-stack-smashing.patch   | 105 ++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.2-r12.ebuild             | 106 +++++++++++++++++++++
 2 files changed, 211 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.2-fix-stack-smashing.patch b/dev-qt/qtcore/files/qtcore-5.15.2-fix-stack-smashing.patch
new file mode 100644
index 000000000000..cfc187251ccb
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.2-fix-stack-smashing.patch
@@ -0,0 +1,105 @@
+From 463c338b09710609e0dc82f67e03c829a7b83788 Mon Sep 17 00:00:00 2001
+From: Allan Sandfeld Jensen <allan.jensen@qt.io>
+Date: Fri, 14 May 2021 10:43:11 +0200
+Subject: [PATCH] Avoid mixing atomic futex changes and QAtomic
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Either the mix of futex and atomic, or the mix of 32-bit futex and
+64-bit atomic doesn't work. In any case, the existing code leads to
+bad behavior.
+
+* asturm 2021-11-19: Also threw the typo fix from 587e3bb0 into the mix.
+
+Pick-to: 6.1 5.15
+Fixes: QTBUG-92188
+Change-Id: Icc6ba28d6e2465c373d00e84f4da2b92c037e797
+Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
+Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
+(cherry picked from commit 2d9cc639a4a7a5e97979a6034364bd67dfa10c23)
+---
+ src/corelib/thread/qsemaphore.cpp | 46 ++++++++++++-------------------
+ 1 file changed, 17 insertions(+), 29 deletions(-)
+
+diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
+index d4fb756b94..1d01fc1b28 100644
+--- a/src/corelib/thread/qsemaphore.cpp
++++ b/src/corelib/thread/qsemaphore.cpp
+@@ -357,47 +357,31 @@ void QSemaphore::release(int n)
+         quintptr prevValue = u.fetchAndAddRelease(nn);
+         if (futexNeedsWake(prevValue)) {
+ #ifdef FUTEX_OP
+-            if (!futexHasWaiterCount) {
+-                /*
+-                   On 32-bit systems, all waiters are waiting on the same address,
+-                   so we'll wake them all and ask the kernel to clear the high bit.
+-
+-                   atomic {
+-                      int oldval = u;
+-                      u = oldval & ~(1 << 31);
+-                      futexWake(u, INT_MAX);
+-                      if (oldval == 0)       // impossible condition
+-                          futexWake(u, INT_MAX);
+-                   }
+-                */
+-                quint32 op = FUTEX_OP_ANDN | FUTEX_OP_OPARG_SHIFT;
+-                quint32 oparg = 31;
+-                quint32 cmp = FUTEX_OP_CMP_EQ;
+-                quint32 cmparg = 0;
+-                futexWakeOp(u, INT_MAX, INT_MAX, u, FUTEX_OP(op, oparg, cmp, cmparg));
+-            } else {
++            if (futexHasWaiterCount) {
+                 /*
+                    On 64-bit systems, the single-token waiters wait on the low half
+                    and the multi-token waiters wait on the upper half. So we ask
+                    the kernel to wake up n single-token waiters and all multi-token
+-                   waiters (if any), then clear the multi-token wait bit.
++                   waiters (if any), and clear the multi-token wait bit.
+ 
+                    atomic {
+                       int oldval = *upper;
+-                      *upper = oldval & ~(1 << 31);
++                      *upper = oldval | 0;
+                       futexWake(lower, n);
+-                      if (oldval < 0)   // sign bit set
++                      if (oldval != 0)   // always true
+                           futexWake(upper, INT_MAX);
+                    }
+                 */
+-                quint32 op = FUTEX_OP_ANDN | FUTEX_OP_OPARG_SHIFT;
+-                quint32 oparg = 31;
+-                quint32 cmp = FUTEX_OP_CMP_LT;
++                quint32 op = FUTEX_OP_OR;
++                quint32 oparg = 0;
++                quint32 cmp = FUTEX_OP_CMP_NE;
+                 quint32 cmparg = 0;
++                u.fetchAndAndRelease(futexNeedsWakeAllBit - 1);
+                 futexWakeOp(*futexLow32(&u), n, INT_MAX, *futexHigh32(&u), FUTEX_OP(op, oparg, cmp, cmparg));
++                return;
+             }
+-#else
+-            // Unset the bit and wake everyone. There are two possibibilies
++#endif
++            // Unset the bit and wake everyone. There are two possibilities
+             // under which a thread can set the bit between the AND and the
+             // futexWake:
+             // 1) it did see the new counter value, but it wasn't enough for
+@@ -405,8 +389,12 @@ void QSemaphore::release(int n)
+             // 2) it did not see the new counter value, in which case its
+             //    futexWait will fail.
+             u.fetchAndAndRelease(futexNeedsWakeAllBit - 1);
+-            futexWakeAll(u);
+-#endif
++            if (futexHasWaiterCount) {
++                futexWakeAll(*futexLow32(&u));
++                futexWakeAll(*futexHigh32(&u));
++            } else {
++                futexWakeAll(u);
++            }
+         }
+         return;
+     }
+-- 
+2.34.0
+

diff --git a/dev-qt/qtcore/qtcore-5.15.2-r12.ebuild b/dev-qt/qtcore/qtcore-5.15.2-r12.ebuild
new file mode 100644
index 000000000000..005fd2c6c0fd
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.15.2-r12.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+KDE_ORG_COMMIT=7c6c0030cf80ef7b9ace42996b0e0c3a72f76860
+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 ~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}
+	>=dev-qt/qtchooser-66-r1
+"
+
+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
+	# See also: https://invent.kde.org/qt/qt/qtbase/-/merge_requests/81
+	"${FILESDIR}"/${P}-fix-stack-smashing.patch # bug 824286, KDE-bug 445719
+)
+
+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] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2022-01-12 16:14 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2022-01-12 16:14 UTC (permalink / raw
  To: gentoo-commits

commit:     c66afae009859b5a3018825c0e2ed348e3af4a01
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 12 15:46:40 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Jan 12 16:12:13 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c66afae0

dev-qt/qtcore: Drop 5.15.2-r12

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

 .../files/qtcore-5.15.2-fix-stack-smashing.patch   | 105 --------------------
 dev-qt/qtcore/qtcore-5.15.2-r12.ebuild             | 106 ---------------------
 2 files changed, 211 deletions(-)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.2-fix-stack-smashing.patch b/dev-qt/qtcore/files/qtcore-5.15.2-fix-stack-smashing.patch
deleted file mode 100644
index cfc187251ccb..000000000000
--- a/dev-qt/qtcore/files/qtcore-5.15.2-fix-stack-smashing.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From 463c338b09710609e0dc82f67e03c829a7b83788 Mon Sep 17 00:00:00 2001
-From: Allan Sandfeld Jensen <allan.jensen@qt.io>
-Date: Fri, 14 May 2021 10:43:11 +0200
-Subject: [PATCH] Avoid mixing atomic futex changes and QAtomic
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Either the mix of futex and atomic, or the mix of 32-bit futex and
-64-bit atomic doesn't work. In any case, the existing code leads to
-bad behavior.
-
-* asturm 2021-11-19: Also threw the typo fix from 587e3bb0 into the mix.
-
-Pick-to: 6.1 5.15
-Fixes: QTBUG-92188
-Change-Id: Icc6ba28d6e2465c373d00e84f4da2b92c037e797
-Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
-(cherry picked from commit 2d9cc639a4a7a5e97979a6034364bd67dfa10c23)
----
- src/corelib/thread/qsemaphore.cpp | 46 ++++++++++++-------------------
- 1 file changed, 17 insertions(+), 29 deletions(-)
-
-diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
-index d4fb756b94..1d01fc1b28 100644
---- a/src/corelib/thread/qsemaphore.cpp
-+++ b/src/corelib/thread/qsemaphore.cpp
-@@ -357,47 +357,31 @@ void QSemaphore::release(int n)
-         quintptr prevValue = u.fetchAndAddRelease(nn);
-         if (futexNeedsWake(prevValue)) {
- #ifdef FUTEX_OP
--            if (!futexHasWaiterCount) {
--                /*
--                   On 32-bit systems, all waiters are waiting on the same address,
--                   so we'll wake them all and ask the kernel to clear the high bit.
--
--                   atomic {
--                      int oldval = u;
--                      u = oldval & ~(1 << 31);
--                      futexWake(u, INT_MAX);
--                      if (oldval == 0)       // impossible condition
--                          futexWake(u, INT_MAX);
--                   }
--                */
--                quint32 op = FUTEX_OP_ANDN | FUTEX_OP_OPARG_SHIFT;
--                quint32 oparg = 31;
--                quint32 cmp = FUTEX_OP_CMP_EQ;
--                quint32 cmparg = 0;
--                futexWakeOp(u, INT_MAX, INT_MAX, u, FUTEX_OP(op, oparg, cmp, cmparg));
--            } else {
-+            if (futexHasWaiterCount) {
-                 /*
-                    On 64-bit systems, the single-token waiters wait on the low half
-                    and the multi-token waiters wait on the upper half. So we ask
-                    the kernel to wake up n single-token waiters and all multi-token
--                   waiters (if any), then clear the multi-token wait bit.
-+                   waiters (if any), and clear the multi-token wait bit.
- 
-                    atomic {
-                       int oldval = *upper;
--                      *upper = oldval & ~(1 << 31);
-+                      *upper = oldval | 0;
-                       futexWake(lower, n);
--                      if (oldval < 0)   // sign bit set
-+                      if (oldval != 0)   // always true
-                           futexWake(upper, INT_MAX);
-                    }
-                 */
--                quint32 op = FUTEX_OP_ANDN | FUTEX_OP_OPARG_SHIFT;
--                quint32 oparg = 31;
--                quint32 cmp = FUTEX_OP_CMP_LT;
-+                quint32 op = FUTEX_OP_OR;
-+                quint32 oparg = 0;
-+                quint32 cmp = FUTEX_OP_CMP_NE;
-                 quint32 cmparg = 0;
-+                u.fetchAndAndRelease(futexNeedsWakeAllBit - 1);
-                 futexWakeOp(*futexLow32(&u), n, INT_MAX, *futexHigh32(&u), FUTEX_OP(op, oparg, cmp, cmparg));
-+                return;
-             }
--#else
--            // Unset the bit and wake everyone. There are two possibibilies
-+#endif
-+            // Unset the bit and wake everyone. There are two possibilities
-             // under which a thread can set the bit between the AND and the
-             // futexWake:
-             // 1) it did see the new counter value, but it wasn't enough for
-@@ -405,8 +389,12 @@ void QSemaphore::release(int n)
-             // 2) it did not see the new counter value, in which case its
-             //    futexWait will fail.
-             u.fetchAndAndRelease(futexNeedsWakeAllBit - 1);
--            futexWakeAll(u);
--#endif
-+            if (futexHasWaiterCount) {
-+                futexWakeAll(*futexLow32(&u));
-+                futexWakeAll(*futexHigh32(&u));
-+            } else {
-+                futexWakeAll(u);
-+            }
-         }
-         return;
-     }
--- 
-2.34.0
-

diff --git a/dev-qt/qtcore/qtcore-5.15.2-r12.ebuild b/dev-qt/qtcore/qtcore-5.15.2-r12.ebuild
deleted file mode 100644
index 005fd2c6c0fd..000000000000
--- a/dev-qt/qtcore/qtcore-5.15.2-r12.ebuild
+++ /dev/null
@@ -1,106 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-KDE_ORG_COMMIT=7c6c0030cf80ef7b9ace42996b0e0c3a72f76860
-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 ~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}
-	>=dev-qt/qtchooser-66-r1
-"
-
-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
-	# See also: https://invent.kde.org/qt/qt/qtbase/-/merge_requests/81
-	"${FILESDIR}"/${P}-fix-stack-smashing.patch # bug 824286, KDE-bug 445719
-)
-
-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] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2022-07-23 11:22 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2022-07-23 11:22 UTC (permalink / raw
  To: gentoo-commits

commit:     f80f3b27a81313f051b2ba0961a110aa14abb76d
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Tue Jun 21 00:42:04 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Jul 23 11:21:01 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f80f3b27

dev-qt/qtcore: fix musl with libexecinfo

QtCore incorrectly assumes that execinfo is already linked on Linux if
execinfo.h is present. The edge case here is that on musl you can
install libexecinfo standalone, thereby QtCore will detect the header
but not the library, and QtCore will think that glibc has already linked it.

There is no code/config for QMake to detect and link against
-lexecinfo except on the BSD:s. Qt should properly add something
similar for non-glibc as well.

This is just a *fix* compatible with all supported Gentoo systems.

Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Closes: https://github.com/gentoo/gentoo/pull/26012
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../qtcore-5.15.5-hack_never_use_execinfo.patch    | 27 ++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.5-r2.ebuild              |  2 ++
 2 files changed, 29 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.5-hack_never_use_execinfo.patch b/dev-qt/qtcore/files/qtcore-5.15.5-hack_never_use_execinfo.patch
new file mode 100644
index 000000000000..c74de19c6144
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.5-hack_never_use_execinfo.patch
@@ -0,0 +1,27 @@
+QtCore only links with -lexecinfo on *bsd and
+incorrectly assumes it's already linked on Linux
+if execinfo.h exists.
+
+This is a fix specificallly for non-glibc systems, was written for musl.
+We'll look to add a build system option for libexecinfo in future.
+
+---
+ src/corelib/global/qlogging.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
+index 89f49324..1c34a1af 100644
+--- a/src/corelib/global/qlogging.cpp
++++ b/src/corelib/global/qlogging.cpp
+@@ -106,7 +106,7 @@
+ #    if __UCLIBC_HAS_BACKTRACE__
+ #      define QLOGGING_HAVE_BACKTRACE
+ #    endif
+-#  elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
++#  elif (defined(__GLIBC__) && defined(__GLIBCXX__))
+ #    define QLOGGING_HAVE_BACKTRACE
+ #  endif
+ #endif
+-- 
+2.35.1
+

diff --git a/dev-qt/qtcore/qtcore-5.15.5-r2.ebuild b/dev-qt/qtcore/qtcore-5.15.5-r2.ebuild
index 22d03f26bc3a..2b2d3b2fe2b5 100644
--- a/dev-qt/qtcore/qtcore-5.15.5-r2.ebuild
+++ b/dev-qt/qtcore/qtcore-5.15.5-r2.ebuild
@@ -27,6 +27,8 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}/${P}-hack_never_use_execinfo.patch" )
+
 QT5_TARGET_SUBDIRS=(
 	src/tools/bootstrap
 	src/tools/moc


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

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2022-07-23 11:22 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2022-07-23 11:22 UTC (permalink / raw
  To: gentoo-commits

commit:     c4859473944244496cbd0b28f5fb525a4a930e4b
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 17 15:57:54 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Jul 23 11:21:01 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4859473

dev-qt/qtcore: Fix configure w/ slibtool

Closes: https://bugs.gentoo.org/792804
Package-Manager: Portage-3.0.32, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-qt/qtcore/files/qtcore-5.15.5-slibtool.patch | 29 ++++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.5-r2.ebuild            |  2 ++
 2 files changed, 31 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.5-slibtool.patch b/dev-qt/qtcore/files/qtcore-5.15.5-slibtool.patch
new file mode 100644
index 000000000000..a7ae5702cb4d
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.5-slibtool.patch
@@ -0,0 +1,29 @@
+From beebf54552e85c07496aa748710df76131620834 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Sun, 17 Jul 2022 17:43:27 +0200
+Subject: [PATCH] Remove quoting around $MAKE call
+
+Fixes build with e.g. MAKE='make libtool=...'
+
+Gentoo-bug: https://bugs.gentoo.org/792804
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index b6c9b462..096706b0 100755
+--- a/configure
++++ b/configure
+@@ -795,7 +795,7 @@ setBootstrapVariable()
+ 
+     if [ "$OPT_VERBOSE" = yes ]; then
+         # Show the output of make
+-        (cd "$outpath/qmake"; "$MAKE") || exit 2
++        (cd "$outpath/qmake"; $MAKE) || exit 2
+     else
+         # Hide the output of make
+         # Use bash to print dots, if we have it, and stdout is a tty.
+-- 
+2.35.1
+

diff --git a/dev-qt/qtcore/qtcore-5.15.5-r2.ebuild b/dev-qt/qtcore/qtcore-5.15.5-r2.ebuild
index 2b2d3b2fe2b5..e86b12357c55 100644
--- a/dev-qt/qtcore/qtcore-5.15.5-r2.ebuild
+++ b/dev-qt/qtcore/qtcore-5.15.5-r2.ebuild
@@ -61,6 +61,8 @@ src_prepare() {
 	# fix missing qt_version_tag symbol w/ LTO, bug 674382
 	sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
 
+	eapply "${FILESDIR}/${P}-slibtool.patch" # bug 792804, TODO: merge into _QT5_GENTOOPATCHSET_REV
+
 	qt5-build_src_prepare
 }
 


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

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2022-08-15 10:43 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2022-08-15 10:43 UTC (permalink / raw
  To: gentoo-commits

commit:     0f18ee87c123a9194c6caee268403ecc7dc45e80
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 15 10:37:37 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Aug 15 10:37:37 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f18ee87

dev-qt/qtcore: drop 5.15.5-r1

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

 dev-qt/qtcore/Manifest                             |   1 -
 .../files/qtcore-5.15.5-fortify-source-3.patch     |  61 ------------
 dev-qt/qtcore/qtcore-5.15.5-r1.ebuild              | 102 ---------------------
 3 files changed, 164 deletions(-)

diff --git a/dev-qt/qtcore/Manifest b/dev-qt/qtcore/Manifest
index 9667a62512b5..88d6a49f0581 100644
--- a/dev-qt/qtcore/Manifest
+++ b/dev-qt/qtcore/Manifest
@@ -1,4 +1,3 @@
 DIST qtbase-5.15-gentoo-patchset-1.tar.xz 4204 BLAKE2B 1399eb6f4c776d370e1837351a72b604440658a3a2d1bd0c725b9ef149b09d236347f5f4b37f652c33310048a0a7df54e24453b404dc45507fd4f7c5fdf144cd SHA512 c857fc746bacb047321cdb762f3c7c48ce2a0d24045a9e708edd38532568dbbc74e9e971425a72a3c2a5ca0662b3e6333831f6c1b7746525b99d46000b63111f
-DIST qtbase-5.15.5-gentoo-kde-1.tar.xz 520224 BLAKE2B 48807bc79cede557b114786ee072d8d94545f4ada3d96aa4fe04dbf79a356dc6c17d9299014ed70aa10296346c30c7512fb7d9f88ee4b301e9a54a241363be8b SHA512 ab9f27d506d7aa1a9339ba52d51daffb4c6f9abb5d858fd728ef2110528bc0f2ae101b4e2e7c344836b42e4aafa2c5a4ab5c5fa37465e692cce500c0f3347fa7
 DIST qtbase-5.15.5-gentoo-kde-2.tar.xz 526240 BLAKE2B 68ecca0805c2ea0b29b65706b0c03a3ead1d106e089f2a48a988035842d0cc8ac67d950cbc67ae8f8be860fd11443579d3e06bfe96a2e3161f94e07206d2815e SHA512 d877a2eb4cd05b712a7db6a943f955d3ced88f51efe3e29b2d6716fba4da08398dbd2ed580ca5b9bfbd92a5a20e34451e06a324274447d4b3692b25af4ff8ddf
 DIST qtbase-everywhere-opensource-src-5.15.5.tar.xz 50247388 BLAKE2B e9bbfe8e73e6f25ccadeef722818b5aeb82d1f136bec21fcbc3b26bf76044b38f25c7268010c648e1161e9b61013b8b775f17b9fdcfdd70402bdfbf70bf7f9d5 SHA512 ce80eedc88abbd5a200bacc10a8e94adc1ef2122ac220715ba084adf1e32d67f2dc66168503de5fb5b5a6ab15f7a75ca23dc9956aed12ead994a8ffa6291ef87

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
deleted file mode 100644
index 1be46b496cf9..000000000000
--- a/dev-qt/qtcore/files/qtcore-5.15.5-fortify-source-3.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-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
deleted file mode 100644
index 80b1d1cbcbf4..000000000000
--- a/dev-qt/qtcore/qtcore-5.15.5-r1.ebuild
+++ /dev/null
@@ -1,102 +0,0 @@
-# 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] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/
@ 2022-08-24 14:17 Andreas Sturmlechner
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Sturmlechner @ 2022-08-24 14:17 UTC (permalink / raw
  To: gentoo-commits

commit:     b7878373380a080f7a9c7f60e5ae420937f64e94
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 24 14:06:31 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Aug 24 14:16:50 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7878373

dev-qt/qtcore: Don't access QObjectPrivate::declarativeData unguarded

QTBUG: https://bugreports.qt.io/browse/QTBUG-105286

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

 .../qtcore/files/qtcore-5.15.5-QTBUG-105286.patch  | 165 +++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.5-r3.ebuild              | 105 +++++++++++++
 2 files changed, 270 insertions(+)

diff --git a/dev-qt/qtcore/files/qtcore-5.15.5-QTBUG-105286.patch b/dev-qt/qtcore/files/qtcore-5.15.5-QTBUG-105286.patch
new file mode 100644
index 000000000000..985dd283dbd4
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.5-QTBUG-105286.patch
@@ -0,0 +1,165 @@
+From 7f9253defd2e90f900d963c6d248a2a0bdaca1a8 Mon Sep 17 00:00:00 2001
+From: Volker Hilsheimer <volker.hilsheimer@qt.io>
+Date: Tue, 16 Aug 2022 15:32:58 +0200
+Subject: [PATCH] Don't access QObjectPrivate::declarativeData unguarded
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The QObjectPrivate::declarativeData member is stored in a union with
+currentChildBeingDeleted. The QObject destructor always sets the
+currentChildBeingDeleted member of the union. It also sets the
+isDeletingChildren bool, which is the only way to find out which union
+member we can safely access.
+
+While the QObject destructor is deleting children and isDeletingChildren
+is set, we must not access the declarativeData member of the union.
+
+Add a test case that initializes the function pointers for the
+declarative handlers and constructs a situation where an object
+emits a signal while it is destroying children.
+
+Fixes: QTBUG-105286
+Pick-to: 6.4 6.3 6.3.2 6.2 5.15
+Change-Id: Iea5ba2f7843b6926a8d157be166e6044d98d6c02
+Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
+Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
+(cherry picked from commit 3be99799a675a631c67e05897383af9abbc377b3)
+---
+ src/corelib/kernel/qobject.cpp                |  4 +-
+ src/corelib/kernel/qobject_p.h                |  2 +-
+ .../corelib/kernel/qobject/tst_qobject.cpp    | 77 +++++++++++++++++++
+ 3 files changed, 80 insertions(+), 3 deletions(-)
+
+diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
+index 0124f88abd..1f3843669b 100644
+--- a/src/corelib/kernel/qobject.cpp
++++ b/src/corelib/kernel/qobject.cpp
+@@ -992,7 +992,7 @@ QObject::~QObject()
+         emit destroyed(this);
+     }
+ 
+-    if (d->declarativeData) {
++    if (!d->isDeletingChildren && d->declarativeData) {
+         if (static_cast<QAbstractDeclarativeDataImpl*>(d->declarativeData)->ownedByQml1) {
+             if (QAbstractDeclarativeData::destroyed_qml1)
+                 QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this);
+@@ -2583,7 +2583,7 @@ int QObject::receivers(const char *signal) const
+         if (!d->isSignalConnected(signal_index))
+             return receivers;
+ 
+-        if (d->declarativeData && QAbstractDeclarativeData::receivers) {
++        if (!d->isDeletingChildren && d->declarativeData && QAbstractDeclarativeData::receivers) {
+             receivers += QAbstractDeclarativeData::receivers(d->declarativeData, this,
+                                                              signal_index);
+         }
+diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
+index 66c19d174e..46dcb93521 100644
+--- a/src/corelib/kernel/qobject_p.h
++++ b/src/corelib/kernel/qobject_p.h
+@@ -428,7 +428,7 @@ inline void QObjectPrivate::checkForIncompatibleLibraryVersion(int version) cons
+ 
+ inline bool QObjectPrivate::isDeclarativeSignalConnected(uint signal_index) const
+ {
+-    return declarativeData && QAbstractDeclarativeData::isSignalConnected
++    return !isDeletingChildren && declarativeData && QAbstractDeclarativeData::isSignalConnected
+             && QAbstractDeclarativeData::isSignalConnected(declarativeData, q_func(), signal_index);
+ }
+ 
+diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+index 9bd66c0835..ed4a0bae5d 100644
+--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
++++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+@@ -158,6 +158,7 @@ private slots:
+     void nullReceiver();
+     void functorReferencesConnection();
+     void disconnectDisconnects();
++    void declarativeData();
+ };
+ 
+ struct QObjectCreatedOnShutdown
+@@ -7679,5 +7680,81 @@ void tst_QObject::disconnectDisconnects()
+ Q_STATIC_ASSERT(QtPrivate::HasQ_OBJECT_Macro<tst_QObject>::Value);
+ Q_STATIC_ASSERT(!QtPrivate::HasQ_OBJECT_Macro<SiblingDeleter>::Value);
+ 
++#ifdef QT_BUILD_INTERNAL
++/*
++    Since QObjectPrivate stores the declarativeData pointer in a union with the pointer
++    to the currently destroyed child, calls to the QtDeclarative handlers need to be
++    correctly guarded. QTBUG-105286
++*/
++namespace QtDeclarative {
++static QAbstractDeclarativeData *theData;
++
++static void destroyed(QAbstractDeclarativeData *data, QObject *)
++{
++    QCOMPARE(data, theData);
++}
++static void signalEmitted(QAbstractDeclarativeData *data, QObject *, int, void **)
++{
++    QCOMPARE(data, theData);
++}
++// we can't use QCOMPARE in the next two functions, as they don't return void
++static int receivers(QAbstractDeclarativeData *data, const QObject *, int)
++{
++    QTest::qCompare(data, theData, "data", "theData", __FILE__, __LINE__);
++    return 0;
++}
++static bool isSignalConnected(QAbstractDeclarativeData *data, const QObject *, int)
++{
++    QTest::qCompare(data, theData, "data", "theData", __FILE__, __LINE__);
++    return true;
++}
++
++class Object : public QObject
++{
++    Q_OBJECT
++public:
++    using QObject::QObject;
++    ~Object()
++    {
++        if (Object *p = static_cast<Object *>(parent()))
++            p->emitSignal();
++    }
++
++    void emitSignal()
++    {
++        emit theSignal();
++    }
++
++signals:
++    void theSignal();
++};
++
++}
++#endif
++
++void tst_QObject::declarativeData()
++{
++#ifdef QT_BUILD_INTERNAL
++    QScopedValueRollback destroyed(QAbstractDeclarativeData::destroyed,
++                                   QtDeclarative::destroyed);
++    QScopedValueRollback signalEmitted(QAbstractDeclarativeData::signalEmitted,
++                                       QtDeclarative::signalEmitted);
++    QScopedValueRollback receivers(QAbstractDeclarativeData::receivers,
++                                   QtDeclarative::receivers);
++    QScopedValueRollback isSignalConnected(QAbstractDeclarativeData::isSignalConnected,
++                                           QtDeclarative::isSignalConnected);
++
++    QtDeclarative::Object p;
++    QObjectPrivate *priv = QObjectPrivate::get(&p);
++    priv->declarativeData = QtDeclarative::theData = new QAbstractDeclarativeData;
++
++    connect(&p, &QtDeclarative::Object::theSignal, &p, []{
++    });
++
++    QtDeclarative::Object *child = new QtDeclarative::Object;
++    child->setParent(&p);
++#endif
++}
++
+ QTEST_MAIN(tst_QObject)
+ #include "tst_qobject.moc"
+-- 
+GitLab
+

diff --git a/dev-qt/qtcore/qtcore-5.15.5-r3.ebuild b/dev-qt/qtcore/qtcore-5.15.5-r3.ebuild
new file mode 100644
index 000000000000..521f2c4e0632
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-5.15.5-r3.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QT5_KDEPATCHSET_REV=2
+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}"
+
+PATCHES=(
+	"${FILESDIR}/${P}-hack_never_use_execinfo.patch"
+	"${FILESDIR}/${P}-QTBUG-105286.patch"
+)
+
+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
+)
+
+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
+
+	eapply "${FILESDIR}/${P}-slibtool.patch" # bug 792804, TODO: merge into _QT5_GENTOOPATCHSET_REV
+
+	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] 14+ messages in thread

end of thread, other threads:[~2022-08-24 14:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-02 23:24 [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/, dev-qt/qtcore/files/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2022-08-24 14:17 Andreas Sturmlechner
2022-08-15 10:43 Andreas Sturmlechner
2022-07-23 11:22 Andreas Sturmlechner
2022-07-23 11:22 Andreas Sturmlechner
2022-01-12 16:14 Andreas Sturmlechner
2021-12-16 13:37 Andreas Sturmlechner
2021-09-22 20:01 Andreas Sturmlechner
2021-01-07 16:31 Andreas Sturmlechner
2020-10-10 17:40 Andreas K. Hüttel
2018-06-16  7:38 Andreas Sturmlechner
2017-10-26 12:11 Michael Palimaka
2016-04-16 17:14 Davide Pesavento
2016-04-10 13:10 Davide Pesavento

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