From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/files/, sys-libs/glibc/
Date: Wed, 1 Dec 2021 15:09:43 +0000 (UTC) [thread overview]
Message-ID: <1638371372.6c160db5f224ffa6d45c54ffb2636047d567f804.sam@gentoo> (raw)
commit: 6c160db5f224ffa6d45c54ffb2636047d567f804
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 1 15:07:42 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 1 15:09:32 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c160db5
sys-libs/glibc: make non-functional changes to clone3 patch
Making it conditional based on a #define so that we can
easily unconditionally apply it.
Signed-off-by: Sam James <sam <AT> gentoo.org>
... glibc-2.34-make-clone3-syscall-optional.patch} | 38 ++++++++++++++--------
sys-libs/glibc/glibc-2.34-r3.ebuild | 10 ++++--
2 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/sys-libs/glibc/files/glibc-2.34-disable-clone3-syscall.patch b/sys-libs/glibc/files/glibc-2.34-make-clone3-syscall-optional.patch
similarity index 53%
rename from sys-libs/glibc/files/glibc-2.34-disable-clone3-syscall.patch
rename to sys-libs/glibc/files/glibc-2.34-make-clone3-syscall-optional.patch
index 3c65a125c3b4..bbc6cabb463d 100644
--- a/sys-libs/glibc/files/glibc-2.34-disable-clone3-syscall.patch
+++ b/sys-libs/glibc/files/glibc-2.34-make-clone3-syscall-optional.patch
@@ -1,6 +1,14 @@
+From 22afb7abbfa0e2d4d168dcd2844aa9935a71cb37 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 1 Dec 2021 14:58:40 +0000
+Subject: [PATCH] clone-internal.c: disable use of clone3 conditinally
+
We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow
compatibility with applications using older Electron.
+Use -DGENTOO_USE_CLONE3 to enable clone3 for now. In future, we will
+revert back to always using clone3.
+
This was impacting e.g. Discord and Skype. This patch stops glibc from using
clone3 internally (which is the only real use of it) and falls back to the old
behaviour.
@@ -16,23 +24,25 @@ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/plain/debian/pat
This is the same as the patch that was considered but ultimately rejected
for 2.34 because Docker got sorted out in time:
https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@oldenburg.str.redhat.com/.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ sysdeps/unix/sysv/linux/clone-internal.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
+index 979f7880be..c5566daf73 100644
--- a/sysdeps/unix/sysv/linux/clone-internal.c
+++ b/sysdeps/unix/sysv/linux/clone-internal.c
-@@ -48,17 +48,6 @@
+@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args,
int (*func) (void *arg), void *arg)
{
int ret;
-#ifdef HAVE_CLONE3_WRAPPER
-- /* Try clone3 first. */
-- int saved_errno = errno;
-- ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
-- if (ret != -1 || errno != ENOSYS)
-- return ret;
--
-- /* NB: Restore errno since errno may be checked against non-zero
-- return value. */
-- __set_errno (saved_errno);
--#endif
-
- /* Map clone3 arguments to clone arguments. NB: No need to check
- invalid clone3 specific bits in flags nor exit_signal since this
++#if defined(HAVE_CLONE3_WRAPPER) && defined(GENTOO_USE_CLONE3)
+ /* Try clone3 first. */
+ int saved_errno = errno;
+ ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
+--
+2.34.1
+
diff --git a/sys-libs/glibc/glibc-2.34-r3.ebuild b/sys-libs/glibc/glibc-2.34-r3.ebuild
index d98d8a72fba5..7053b85282f1 100644
--- a/sys-libs/glibc/glibc-2.34-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.34-r3.ebuild
@@ -791,11 +791,15 @@ src_prepare() {
einfo "Done."
fi
- if ! use clone3 ; then
+ # Apply patch to allow conditional disabling of clone3
+ eapply "${FILESDIR}"/${PN}-2.34-make-clone3-syscall-optional.patch
+
+ if use clone3 ; then
+ append-cppflags -DGENTOO_USE_CLONE3
+ else
+ # See e.g. bug #827386, bug #819045.
elog "Disabling the clone3 syscall for compatibility with older Electron apps."
elog "Please re-enable this flag before filing bugs!"
- # See e.g. bug #827386, bug #819045.
- eapply "${FILESDIR}"/${P}-disable-clone3-syscall.patch
fi
default
next reply other threads:[~2021-12-01 15:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-01 15:09 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-05-12 20:44 [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/files/, sys-libs/glibc/ Andreas K. Hüttel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1638371372.6c160db5f224ffa6d45c54ffb2636047d567f804.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox