summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-07-17 10:05:11 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-18 10:18:42 +0100
commitada8a5d9175b141b4fe532f542f5c1f7ffa26d88 (patch)
tree64af2142c781c13ee7669004b615d41cfb787f92 /meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
parent219eed186d32b01a7132233c5110c08055ed6e27 (diff)
downloadpoky-ada8a5d9175b141b4fe532f542f5c1f7ffa26d88.tar.gz
systemd: upgrade to 239
Upgrade systemd to 239. 1. Patch Changes * Rebased Patches 0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch 0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch 0006-Make-root-s-home-directory-configurable.patch 0027-remove-nobody-user-group-checking.patch 0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch 0013-add-fallback-parse_printf_format-implementation.patch 0014-src-basic-missing.h-check-for-missing-strndupa.patch 0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch 0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch 0017-Include-netinet-if_ether.h.patch 0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch 0022-don-t-use-glibc-specific-qsort_r.patch 0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch 0026-Use-uintmax_t-for-handling-rlim_t.patch 0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch 0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch 0001-core-device.c-Change-the-default-device-timeout-to-2.patch 0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch * Dropped Patches and Reasons 0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch This patch is dropped because the problem has been fixed by binutils upstream. And this workaround could be dropped. https://sourceware.org/bugzilla/show_bug.cgi?id=18548 0007-Revert-rules-remove-firmware-loading-rules.patch 0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch These two patches are dropped because they are for kernel < 3.7. But the current minimal requirement of kernel to build systemd is as below. REQUIREMENTS: Linux kernel >= 3.13 Linux kernel >= 4.2 for unified cgroup hierarchy support So these two patches no long make any sense. Also remove non-exist firmware-path option 0009-remove-duplicate-include-uchar.h.patch 0010-check-for-uchar.h-in-meson.build.patch These two patches are dropped because musl has implemented uchar.h. See commit below from musl repo. """ ab9672ae73248f51e30f4553c4b8878525e46383 implement uchar.h (C11 UTF-16/32 conversion) interfaces """ 0018-check-for-missing-canonicalize_file_name.patch The above patch is dropped because current systemd does not need canonicalize_file_name. 0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch The above patch is dropped because utmp makes no sense in musl. Check code below from musl. include/utmp.h:#define _PATH_UTMP "/dev/null/utmp" And utmp PACKAGECONFIG has been explicitly disabled for musl. So we don't need this patch. 0032-memfd.patch 0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch libmount.patch 0034-Fix-format-truncation-compile-failure-by-typecasting.patch The above patches are dropped because they are backported patches. And current systemd has contained these patches. 0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch The above patch is dropped because it has been merged and is now in new version. * Newly Added Patch 0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch This patch is added to fix build for musl. 0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch This patch is added to fix the following error which caused system unable to boot up. systemd-udevd.service: Failed to adjust OOM setting: Invalid argument dbus.service: Failed to adjust OOM setting: Invalid argument 0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch This patch is added to fix segment fault error on musl systems. 0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch This patch is backported to solve a race condition between user-runtime-dir@xxx.service stop and user deletion. 2. PACKAGECONFIG and Dependency Changes * Add a new PACKAGECONFIG item 'gshadow'. Enable it by default for glibc but disable it by default for musl. This is because musl does not provide gshadow.h. * Add a new PACKAGECONFIG item 'portabled'. Default to disable it because it's still experimental, according to the announcement letter. """ Currently, the support is still experimental, but this is expected to change soon. Reflecting this experimental state, the "portablectl" binary is not installed into /usr/bin yet. """ * Change 'kmod' from a hard dependency to a PACKAGECONFIG item. Default to enable it. * Change 'acl' from a hard dependency to a PACKAGECONFIG item. Default to enable it. * Remove 'readline' from DEPENDS. systemd does not need it. * Remove 'libcgroup' from DEPENDS. The dependency on libcgroup has been removed from systemd a long time ago. We now remove this unnecessary dependency from DEPENDS. 3. update-alternatives changes The utilities like shutdown, poweroff, etc. are now created as symlinks at do_install. So there's no need to use update-alternatives mechanism anymore to create the symlinks now. In addtion, I don't think we now support multiple init systems at one running system, so there's really no need to use update-alternatives mechanism here. Also update the FILES_${PN} to include these files to avoid QA issue. (From OE-Core rev: 597f4645faf61486eb1d2ab73f3d974460ab9466) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch183
1 files changed, 183 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
new file mode 100644
index 0000000000..f07211bd8a
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
@@ -0,0 +1,183 @@
1From d43faf6d253db789225b7c454c8f255fbc68857e Mon Sep 17 00:00:00 2001
2From: Emil Renner Berthing <systemd@esmil.dk>
3Date: Thu, 18 Sep 2014 15:24:56 +0200
4Subject: [PATCH 02/19] don't use glibc-specific qsort_r
5
6Upstream-Status: Inappropriate [musl specific]
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 src/basic/format-table.c | 27 ++++++++++++++++-----------
11 src/basic/util.h | 7 -------
12 src/hwdb/hwdb.c | 18 +++++++++++-------
13 src/udev/udevadm-hwdb.c | 16 ++++++++++------
14 4 files changed, 37 insertions(+), 31 deletions(-)
15
16diff --git a/src/basic/format-table.c b/src/basic/format-table.c
17index 94e796d1c..f7b4eade9 100644
18--- a/src/basic/format-table.c
19+++ b/src/basic/format-table.c
20@@ -745,29 +745,29 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t
21 return 0;
22 }
23
24-static int table_data_compare(const void *x, const void *y, void *userdata) {
25+static Table *user_table;
26+static int table_data_compare(const void *x, const void *y) {
27 const size_t *a = x, *b = y;
28- Table *t = userdata;
29 size_t i;
30 int r;
31
32- assert(t);
33- assert(t->sort_map);
34+ assert(user_table);
35+ assert(user_table->sort_map);
36
37 /* Make sure the header stays at the beginning */
38- if (*a < t->n_columns && *b < t->n_columns)
39+ if (*a < user_table->n_columns && *b < user_table->n_columns)
40 return 0;
41- if (*a < t->n_columns)
42+ if (*a < user_table->n_columns)
43 return -1;
44- if (*b < t->n_columns)
45+ if (*b < user_table->n_columns)
46 return 1;
47
48 /* Order other lines by the sorting map */
49- for (i = 0; i < t->n_sort_map; i++) {
50+ for (i = 0; i < user_table->n_sort_map; i++) {
51 TableData *d, *dd;
52
53- d = t->data[*a + t->sort_map[i]];
54- dd = t->data[*b + t->sort_map[i]];
55+ d = user_table->data[*a + user_table->sort_map[i]];
56+ dd = user_table->data[*b + user_table->sort_map[i]];
57
58 r = cell_data_compare(d, *a, dd, *b);
59 if (r != 0)
60@@ -960,7 +960,12 @@ int table_print(Table *t, FILE *f) {
61 for (i = 0; i < n_rows; i++)
62 sorted[i] = i * t->n_columns;
63
64- qsort_r_safe(sorted, n_rows, sizeof(size_t), table_data_compare, t);
65+ if (n_rows <= 1)
66+ return;
67+ assert(sorted);
68+ user_table = t;
69+ qsort(sorted, n_rows, sizeof(size_t), table_data_compare);
70+ user_table = NULL;
71 }
72
73 if (t->display_map)
74diff --git a/src/basic/util.h b/src/basic/util.h
75index 9699d228f..40eaf518c 100644
76--- a/src/basic/util.h
77+++ b/src/basic/util.h
78@@ -105,13 +105,6 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_
79 qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \
80 })
81
82-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void*, const void*, void*), void *userdata) {
83- if (nmemb <= 1)
84- return;
85-
86- assert(base);
87- qsort_r(base, nmemb, size, compar, userdata);
88-}
89
90 /**
91 * Normal memcpy requires src to be nonnull. We do nothing if n is 0.
92diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
93index 317cad8a6..701d59a1e 100644
94--- a/src/hwdb/hwdb.c
95+++ b/src/hwdb/hwdb.c
96@@ -135,13 +135,12 @@ static void trie_free(struct trie *trie) {
97
98 DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
99
100-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
101+static struct trie *trie_node_add_value_trie;
102+static int trie_values_cmp(const void *v1, const void *v2) {
103 const struct trie_value_entry *val1 = v1;
104 const struct trie_value_entry *val2 = v2;
105- struct trie *trie = arg;
106-
107- return strcmp(trie->strings->buf + val1->key_off,
108- trie->strings->buf + val2->key_off);
109+ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
110+ trie_node_add_value_trie->strings->buf + val2->key_off);
111 }
112
113 static int trie_node_add_value(struct trie *trie, struct trie_node *node,
114@@ -166,7 +165,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
115 .value_off = v,
116 };
117
118- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
119+ trie_node_add_value_trie = trie;
120+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
121+ trie_node_add_value_trie = NULL;
122+
123 if (val) {
124 /* At this point we have 2 identical properties on the same match-string.
125 * Since we process files in order, we just replace the previous value.
126@@ -191,7 +193,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
127 node->values[node->values_count].file_priority = file_priority;
128 node->values[node->values_count].line_number = line_number;
129 node->values_count++;
130- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
131+ trie_node_add_value_trie = trie;
132+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
133+ trie_node_add_value_trie = NULL;
134 return 0;
135 }
136
137diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
138index 02408a428..491d367d1 100644
139--- a/src/udev/udevadm-hwdb.c
140+++ b/src/udev/udevadm-hwdb.c
141@@ -114,13 +114,13 @@ static void trie_node_cleanup(struct trie_node *node) {
142 free(node);
143 }
144
145-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
146+static struct trie *trie_node_add_value_trie;
147+static int trie_values_cmp(const void *v1, const void *v2) {
148 const struct trie_value_entry *val1 = v1;
149 const struct trie_value_entry *val2 = v2;
150- struct trie *trie = arg;
151
152- return strcmp(trie->strings->buf + val1->key_off,
153- trie->strings->buf + val2->key_off);
154+ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
155+ trie_node_add_value_trie->strings->buf + val2->key_off);
156 }
157
158 static int trie_node_add_value(struct trie *trie, struct trie_node *node,
159@@ -141,7 +141,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
160 .value_off = v,
161 };
162
163- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
164+ trie_node_add_value_trie = trie;
165+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
166+ trie_node_add_value_trie = NULL;
167 if (val) {
168 /* replace existing earlier key with new value */
169 val->value_off = v;
170@@ -158,7 +160,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
171 node->values[node->values_count].key_off = k;
172 node->values[node->values_count].value_off = v;
173 node->values_count++;
174- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
175+ trie_node_add_value_trie = trie;
176+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
177+ trie_node_add_value_trie = NULL;
178 return 0;
179 }
180
181--
1822.11.0
183