commit:     9152c25f592db19e2d6f6ab0aab991a463503a34
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 21 05:46:22 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Oct 21 06:21:50 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9152c25f

dev-qt/qtbase: fix qsb and qmake with sandbox

Also add to 6.5.3, while the issue has been less prominent in
6.5.x, there has been users that ran into issues with older
versions, and is needed for stable users.

See bug #915695 for details, the others are essentially duplicates
which are hopefully fixed too (please report if still issues given
I could never reproduce myself and cannot confirm).

Closes: https://bugs.gentoo.org/908809
Closes: https://bugs.gentoo.org/908816
Closes: https://bugs.gentoo.org/913493
Closes: https://bugs.gentoo.org/915695
Thanks-to: vowstar
Thanks-to: Mike Gilbert <floppym <AT> gentoo.org>
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../qtbase-6.5.3-forkfd-childstack-size.patch      | 27 ++++++++++++++++++++++
 ...{qtbase-6.5.3.ebuild => qtbase-6.5.3-r1.ebuild} |  1 +
 ...{qtbase-6.6.0.ebuild => qtbase-6.6.0-r1.ebuild} |  1 +
 3 files changed, 29 insertions(+)

diff --git a/dev-qt/qtbase/files/qtbase-6.5.3-forkfd-childstack-size.patch 
b/dev-qt/qtbase/files/qtbase-6.5.3-forkfd-childstack-size.patch
new file mode 100644
index 000000000000..34cbec61895b
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.5.3-forkfd-childstack-size.patch
@@ -0,0 +1,27 @@
+Avoid crash that happens for some users in qsb, qmake, and
+potentially other Qt tools when ran under sandbox leading
+to build failures for qtdeclarative and other packages.
+
+Note that this is the initial (simple) version of the patch
+to ensure no issues, a more proper fix should land upstream
+eventually.
+
+https://bugs.gentoo.org/908809
+https://bugs.gentoo.org/908816
+https://bugs.gentoo.org/913493
+https://bugs.gentoo.org/915695
+https://codereview.qt-project.org/c/qt/qtbase/+/513140
+From: Huang Rui <[email protected]>
+Date: Fri, 20 Oct 2023 10:16:01 +0800
+Subject: [PATCH] folkfd_linux,c: set stack size to 8192
+--- a/src/3rdparty/forkfd/forkfd_linux.c
++++ b/src/3rdparty/forkfd/forkfd_linux.c
+@@ -157,7 +157,7 @@ static int system_forkfd_pidfd_set_flags(int pidfd, int 
flags)
+ 
+ int system_vforkfd(int flags, pid_t *ppid, int (*childFn)(void *), void 
*token, int *system)
+ {
+-    __attribute__((aligned(64))) char childStack[4096];
++    __attribute__((aligned(64))) char childStack[8192];
+     pid_t pid;
+     int pidfd;
+     unsigned long cloneflags = CLONE_PIDFD | CLONE_VFORK | CLONE_VM | SIGCHLD;

diff --git a/dev-qt/qtbase/qtbase-6.5.3.ebuild 
b/dev-qt/qtbase/qtbase-6.5.3-r1.ebuild
similarity index 99%
rename from dev-qt/qtbase/qtbase-6.5.3.ebuild
rename to dev-qt/qtbase/qtbase-6.5.3-r1.ebuild
index e58d9d0e80e4..b166e0302241 100644
--- a/dev-qt/qtbase/qtbase-6.5.3.ebuild
+++ b/dev-qt/qtbase/qtbase-6.5.3-r1.ebuild
@@ -137,6 +137,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-6.5.2-no-glx.patch
        "${FILESDIR}"/${PN}-6.5.2-no-symlink-check.patch
        "${FILESDIR}"/${PN}-6.5.3-xkbcommon160.patch
+       "${FILESDIR}"/${PN}-6.5.3-forkfd-childstack-size.patch
 )
 
 src_prepare() {

diff --git a/dev-qt/qtbase/qtbase-6.6.0.ebuild 
b/dev-qt/qtbase/qtbase-6.6.0-r1.ebuild
similarity index 99%
rename from dev-qt/qtbase/qtbase-6.6.0.ebuild
rename to dev-qt/qtbase/qtbase-6.6.0-r1.ebuild
index d41f291526d3..044f46b80925 100644
--- a/dev-qt/qtbase/qtbase-6.6.0.ebuild
+++ b/dev-qt/qtbase/qtbase-6.6.0-r1.ebuild
@@ -137,6 +137,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-6.5.2-no-glx.patch
        "${FILESDIR}"/${PN}-6.5.2-no-symlink-check.patch
        "${FILESDIR}"/${PN}-6.5.3-xkbcommon160.patch
+       "${FILESDIR}"/${PN}-6.5.3-forkfd-childstack-size.patch
 )
 
 src_prepare() {

Reply via email to