1 |
commit: a322f1dc93f32dcf4af8441f7bc7214e8694290c |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 1 16:16:49 2021 +0000 |
4 |
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 1 16:16:49 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=a322f1dc |
7 |
|
8 |
Add patch to make clone3 optional |
9 |
|
10 |
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> |
11 |
|
12 |
9999/0020-make-clone3-syscall-optional.patch | 48 ++++++++++++++++++++++++++++ |
13 |
1 file changed, 48 insertions(+) |
14 |
|
15 |
diff --git a/9999/0020-make-clone3-syscall-optional.patch b/9999/0020-make-clone3-syscall-optional.patch |
16 |
new file mode 100644 |
17 |
index 0000000..33aa08f |
18 |
--- /dev/null |
19 |
+++ b/9999/0020-make-clone3-syscall-optional.patch |
20 |
@@ -0,0 +1,48 @@ |
21 |
+From 1f714c474eb248b3fa2c84f3b0f22cc509c0e6c9 Mon Sep 17 00:00:00 2001 |
22 |
+From: Sam James <sam@g.o> |
23 |
+Date: Wed, 1 Dec 2021 14:58:40 +0000 |
24 |
+Subject: [PATCH] clone-internal.c: make clone3 syscall optional |
25 |
+ |
26 |
+We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow |
27 |
+compatibility with applications using older Electron. |
28 |
+ |
29 |
+Use -DGENTOO_USE_CLONE3 to enable clone3 for now. In future, we will |
30 |
+revert back to always using clone3. |
31 |
+ |
32 |
+This was impacting e.g. Discord and Skype. This patch stops glibc from using |
33 |
+clone3 internally (which is the only real use of it) and falls back to the old |
34 |
+behaviour. |
35 |
+ |
36 |
+Specifically, we want https://github.com/electron/electron/pull/31091 |
37 |
+to work its way downstream to various Electron applications. |
38 |
+ |
39 |
+https://bugs.gentoo.org/819045 |
40 |
+https://bugs.gentoo.org/827386 |
41 |
+ |
42 |
+https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/plain/debian/patches/ubuntu/disable-clone3.patch |
43 |
+ |
44 |
+This is the same as the patch that was considered but ultimately rejected |
45 |
+for 2.34 because Docker got sorted out in time: |
46 |
+https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@××××××××××××××××××××.com/. |
47 |
+ |
48 |
+Signed-off-by: Sam James <sam@g.o> |
49 |
+--- |
50 |
+ sysdeps/unix/sysv/linux/clone-internal.c | 2 +- |
51 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
52 |
+ |
53 |
+diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c |
54 |
+index 979f7880be..c5566daf73 100644 |
55 |
+--- a/sysdeps/unix/sysv/linux/clone-internal.c |
56 |
++++ b/sysdeps/unix/sysv/linux/clone-internal.c |
57 |
+@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args, |
58 |
+ int (*func) (void *arg), void *arg) |
59 |
+ { |
60 |
+ int ret; |
61 |
+-#ifdef HAVE_CLONE3_WRAPPER |
62 |
++#if defined(HAVE_CLONE3_WRAPPER) && defined(GENTOO_USE_CLONE3) |
63 |
+ /* Try clone3 first. */ |
64 |
+ int saved_errno = errno; |
65 |
+ ret = __clone3 (cl_args, sizeof (*cl_args), func, arg); |
66 |
+-- |
67 |
+2.32.0 |
68 |
+ |