1 |
commit: ff57f388b782354cb5f6bca825cc4aa34e23e16b |
2 |
Author: Denis Pronin <dannftk <AT> yandex <DOT> ru> |
3 |
AuthorDate: Mon Mar 9 15:29:58 2020 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 9 21:21:44 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff57f388 |
7 |
|
8 |
sys-apps/systemd: patch to support gnu11 standard for compilation |
9 |
|
10 |
Closes: https://github.com/gentoo/gentoo/pull/14901 |
11 |
Signed-off-by: Denis Pronin <dannftk <AT> yandex.ru> |
12 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
13 |
|
14 |
sys-apps/systemd/files/245-clang-gnu11.patch | 60 ++++++++++++++++++++++++++++ |
15 |
sys-apps/systemd/systemd-243-r2.ebuild | 1 + |
16 |
sys-apps/systemd/systemd-244.3.ebuild | 1 + |
17 |
sys-apps/systemd/systemd-244.ebuild | 1 + |
18 |
sys-apps/systemd/systemd-245.ebuild | 1 + |
19 |
5 files changed, 64 insertions(+) |
20 |
|
21 |
diff --git a/sys-apps/systemd/files/245-clang-gnu11.patch b/sys-apps/systemd/files/245-clang-gnu11.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..9056b56d48e |
24 |
--- /dev/null |
25 |
+++ b/sys-apps/systemd/files/245-clang-gnu11.patch |
26 |
@@ -0,0 +1,60 @@ |
27 |
+From 36e0d89a88c51ba879a2d7e2f90ea9b38333e2c0 Mon Sep 17 00:00:00 2001 |
28 |
+From: Denis Pronin <dannftk@××××××.ru> |
29 |
+Date: Sun, 8 Mar 2020 23:57:07 +0300 |
30 |
+Subject: [PATCH] Support compiling with clang and gnu11 standard |
31 |
+ |
32 |
+Signed-off-by: Denis Pronin <dannftk@××××××.ru> |
33 |
+--- |
34 |
+ src/shared/json-internal.h | 35 ++++++++++++++++++++++++----------- |
35 |
+ 1 file changed, 24 insertions(+), 11 deletions(-) |
36 |
+ |
37 |
+diff --git a/src/shared/json-internal.h b/src/shared/json-internal.h |
38 |
+index bf158bff0d4..fabff0c860e 100644 |
39 |
+--- a/src/shared/json-internal.h |
40 |
++++ b/src/shared/json-internal.h |
41 |
+@@ -26,21 +26,34 @@ assert_cc(sizeof(JsonValue) == 16U); |
42 |
+ /* We use fake JsonVariant objects for some special values, in order to avoid memory allocations for them. Note that |
43 |
+ * effectively this means that there are multiple ways to encode the same objects: via these magic values or as |
44 |
+ * properly allocated JsonVariant. We convert between both on-the-fly as necessary. */ |
45 |
+-#define JSON_VARIANT_MAGIC_TRUE ((JsonVariant*) 1) |
46 |
+-#define JSON_VARIANT_MAGIC_FALSE ((JsonVariant*) 2) |
47 |
+-#define JSON_VARIANT_MAGIC_NULL ((JsonVariant*) 3) |
48 |
+-#define JSON_VARIANT_MAGIC_ZERO_INTEGER ((JsonVariant*) 4) |
49 |
+-#define JSON_VARIANT_MAGIC_ZERO_UNSIGNED ((JsonVariant*) 5) |
50 |
+-#define JSON_VARIANT_MAGIC_ZERO_REAL ((JsonVariant*) 6) |
51 |
+-#define JSON_VARIANT_MAGIC_EMPTY_STRING ((JsonVariant*) 7) |
52 |
+-#define JSON_VARIANT_MAGIC_EMPTY_ARRAY ((JsonVariant*) 8) |
53 |
+-#define JSON_VARIANT_MAGIC_EMPTY_OBJECT ((JsonVariant*) 9) |
54 |
+-#define _JSON_VARIANT_MAGIC_MAX ((JsonVariant*) 10) |
55 |
++enum |
56 |
++{ |
57 |
++ _JSON_VARIANT_MAGIC_TRUE = 1, |
58 |
++#define JSON_VARIANT_MAGIC_TRUE ((JsonVariant*) _JSON_VARIANT_MAGIC_TRUE) |
59 |
++ _JSON_VARIANT_MAGIC_FALSE, |
60 |
++#define JSON_VARIANT_MAGIC_FALSE ((JsonVariant*) _JSON_VARIANT_MAGIC_FALSE) |
61 |
++ _JSON_VARIANT_MAGIC_NULL, |
62 |
++#define JSON_VARIANT_MAGIC_NULL ((JsonVariant*) _JSON_VARIANT_MAGIC_NULL) |
63 |
++ _JSON_VARIANT_MAGIC_ZERO_INTEGER, |
64 |
++#define JSON_VARIANT_MAGIC_ZERO_INTEGER ((JsonVariant*) _JSON_VARIANT_MAGIC_ZERO_INTEGER) |
65 |
++ _JSON_VARIANT_MAGIC_ZERO_UNSIGNED, |
66 |
++#define JSON_VARIANT_MAGIC_ZERO_UNSIGNED ((JsonVariant*) _JSON_VARIANT_MAGIC_ZERO_UNSIGNED) |
67 |
++ _JSON_VARIANT_MAGIC_ZERO_REAL, |
68 |
++#define JSON_VARIANT_MAGIC_ZERO_REAL ((JsonVariant*) _JSON_VARIANT_MAGIC_ZERO_REAL) |
69 |
++ _JSON_VARIANT_MAGIC_EMPTY_STRING, |
70 |
++#define JSON_VARIANT_MAGIC_EMPTY_STRING ((JsonVariant*) _JSON_VARIANT_MAGIC_EMPTY_STRING) |
71 |
++ _JSON_VARIANT_MAGIC_EMPTY_ARRAY, |
72 |
++#define JSON_VARIANT_MAGIC_EMPTY_ARRAY ((JsonVariant*) _JSON_VARIANT_MAGIC_EMPTY_ARRAY) |
73 |
++ _JSON_VARIANT_MAGIC_EMPTY_OBJECT, |
74 |
++#define JSON_VARIANT_MAGIC_EMPTY_OBJECT ((JsonVariant*) _JSON_VARIANT_MAGIC_EMPTY_OBJECT) |
75 |
++ __JSON_VARIANT_MAGIC_MAX |
76 |
++#define _JSON_VARIANT_MAGIC_MAX ((JsonVariant*) __JSON_VARIANT_MAGIC_MAX) |
77 |
++}; |
78 |
+ |
79 |
+ /* This is only safe as long as we don't define more than 4K magic pointers, i.e. the page size of the simplest |
80 |
+ * architectures we support. That's because we rely on the fact that malloc() will never allocate from the first memory |
81 |
+ * page, as it is a faulting page for catching NULL pointer dereferences. */ |
82 |
+-assert_cc((uintptr_t) _JSON_VARIANT_MAGIC_MAX < 4096U); |
83 |
++assert_cc((unsigned) __JSON_VARIANT_MAGIC_MAX < 4096U); |
84 |
+ |
85 |
+ enum { /* JSON tokens */ |
86 |
+ JSON_TOKEN_END, |
87 |
|
88 |
diff --git a/sys-apps/systemd/systemd-243-r2.ebuild b/sys-apps/systemd/systemd-243-r2.ebuild |
89 |
index 5c4c417bc34..a46b5c8519f 100644 |
90 |
--- a/sys-apps/systemd/systemd-243-r2.ebuild |
91 |
+++ b/sys-apps/systemd/systemd-243-r2.ebuild |
92 |
@@ -188,6 +188,7 @@ src_prepare() { |
93 |
# Add local patches here |
94 |
PATCHES+=( |
95 |
"${FILESDIR}/243-seccomp.patch" |
96 |
+ "${FILESDIR}/245-clang-gnu11.patch" |
97 |
) |
98 |
|
99 |
if ! use vanilla; then |
100 |
|
101 |
diff --git a/sys-apps/systemd/systemd-244.3.ebuild b/sys-apps/systemd/systemd-244.3.ebuild |
102 |
index c61aa348281..ee3dfc93eef 100644 |
103 |
--- a/sys-apps/systemd/systemd-244.3.ebuild |
104 |
+++ b/sys-apps/systemd/systemd-244.3.ebuild |
105 |
@@ -192,6 +192,7 @@ src_prepare() { |
106 |
|
107 |
# Add local patches here |
108 |
PATCHES+=( |
109 |
+ "${FILESDIR}/245-clang-gnu11.patch" |
110 |
) |
111 |
|
112 |
if ! use vanilla; then |
113 |
|
114 |
diff --git a/sys-apps/systemd/systemd-244.ebuild b/sys-apps/systemd/systemd-244.ebuild |
115 |
index 49383fe9a6f..3bbbcca5697 100644 |
116 |
--- a/sys-apps/systemd/systemd-244.ebuild |
117 |
+++ b/sys-apps/systemd/systemd-244.ebuild |
118 |
@@ -188,6 +188,7 @@ src_prepare() { |
119 |
# Add local patches here |
120 |
PATCHES+=( |
121 |
"${FILESDIR}"/244-efi-gcc-10.patch |
122 |
+ "${FILESDIR}/245-clang-gnu11.patch" |
123 |
) |
124 |
|
125 |
if ! use vanilla; then |
126 |
|
127 |
diff --git a/sys-apps/systemd/systemd-245.ebuild b/sys-apps/systemd/systemd-245.ebuild |
128 |
index 6454de6e169..0b39a8aceb4 100644 |
129 |
--- a/sys-apps/systemd/systemd-245.ebuild |
130 |
+++ b/sys-apps/systemd/systemd-245.ebuild |
131 |
@@ -194,6 +194,7 @@ src_prepare() { |
132 |
|
133 |
# Add local patches here |
134 |
PATCHES+=( |
135 |
+ "${FILESDIR}/245-clang-gnu11.patch" |
136 |
) |
137 |
|
138 |
if ! use vanilla; then |