-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0008-clone-internal.c-make-clone3-syscall-optional.patch
59 lines (45 loc) · 2.14 KB
/
0008-clone-internal.c-make-clone3-syscall-optional.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From e7f3aaf5c95e45735498c1a6b8f1a3b2c5134c8c Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Wed, 1 Dec 2021 14:58:40 +0000
Subject: [PATCH 8/9] clone-internal.c: make clone3 syscall optional
This patch was originally carried in Gentoo to make clone3
optional to avoid breakage for CEF/steam/zoom, and others.
Gentoo made clone3 mandatory but ChromeOS is not there yet,
so we carry this trivial patch to allow us to keep clone3
disabled for a while longer.
See b:288928916 which is tracking the clone3 migration.
Original commit message:
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.
Specifically, we want https://github.com/electron/electron/pull/31091
to work its way downstream to various Electron applications.
https://bugs.gentoo.org/819045
https://bugs.gentoo.org/827386
https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/plain/debian/patches/ubuntu/disable-clone3.patch
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 a8611772a2..4a57d289b2 100644
--- a/sysdeps/unix/sysv/linux/clone-internal.c
+++ b/sysdeps/unix/sysv/linux/clone-internal.c
@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args,
int (*func) (void *arg), void *arg)
{
int ret;
-#ifdef HAVE_CLONE3_WRAPPER
+#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.41.0