summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2019-05-16 10:48:34 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-16 16:35:12 +0100
commit11fd8dc6ffb8d403c22644f7f00b761d90e8b20d (patch)
tree42fc0eed0e36a5d549e1d9aea6bf182032ff5d3f
parentf91866aaf13d350431f6ccac3fc941072a4ad80d (diff)
downloadpoky-11fd8dc6ffb8d403c22644f7f00b761d90e8b20d.tar.gz
musl: Add TEMP_FAILURE_RETRY from glibc
Patch it into musl instead of patching all users (currently elfutils and next ofono). (From OE-Core rev: 0c68c621d3b8690e3a346170006f75b032511a8a) Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/musl/musl/0001-unistd.h-Add-TEMP_FAILURE_RETRY.patch36
-rw-r--r--meta/recipes-core/musl/musl_git.bb1
-rw-r--r--meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch30
3 files changed, 38 insertions, 29 deletions
diff --git a/meta/recipes-core/musl/musl/0001-unistd.h-Add-TEMP_FAILURE_RETRY.patch b/meta/recipes-core/musl/musl/0001-unistd.h-Add-TEMP_FAILURE_RETRY.patch
new file mode 100644
index 0000000000..4d48d61651
--- /dev/null
+++ b/meta/recipes-core/musl/musl/0001-unistd.h-Add-TEMP_FAILURE_RETRY.patch
@@ -0,0 +1,36 @@
1From 19cbebc3fa33c6a1a71a6036da4d67c98f859f06 Mon Sep 17 00:00:00 2001
2From: Adrian Bunk <bunk@stusta.de>
3Date: Wed, 15 May 2019 16:08:33 +0300
4Subject: unistd.h: Add TEMP_FAILURE_RETRY
5
6Signed-off-by: Adrian Bunk <bunk@stusta.de>
7Upstream-Status: Inappropriate [oe-specific]
8---
9 include/unistd.h | 11 +++++++++++
10 1 file changed, 11 insertions(+)
11
12diff --git a/include/unistd.h b/include/unistd.h
13index 9485da7a..8a75af57 100644
14--- a/include/unistd.h
15+++ b/include/unistd.h
16@@ -460,6 +460,17 @@ int eaccess(const char *, int);
17 #define _CS_V6_ENV 1148
18 #define _CS_V7_ENV 1149
19
20+#ifdef _GNU_SOURCE
21+#ifndef TEMP_FAILURE_RETRY
22+# define TEMP_FAILURE_RETRY(expression) \
23+ (__extension__ \
24+ ({ long int __result; \
25+ do __result = (long int) (expression); \
26+ while (__result == -1L && errno == EINTR); \
27+ __result; }))
28+#endif
29+#endif
30+
31 #ifdef __cplusplus
32 }
33 #endif
34--
352.20.1
36
diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index 1e324804e1..2b433aed8c 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -15,6 +15,7 @@ PV = "${BASEVER}+git${SRCPV}"
15SRC_URI = "git://git.musl-libc.org/musl \ 15SRC_URI = "git://git.musl-libc.org/musl \
16 file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \ 16 file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \
17 file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \ 17 file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \
18 file://0001-unistd.h-Add-TEMP_FAILURE_RETRY.patch \
18 " 19 "
19 20
20S = "${WORKDIR}/git" 21S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
index a4f301d9da..10cdac646c 100644
--- a/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
+++ b/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
@@ -64,18 +64,10 @@ index 292082b..308a762 100644
64 #include <stddef.h> 64 #include <stddef.h>
65 #include <stdint.h> 65 #include <stdint.h>
66 #include <sys/param.h> 66 #include <sys/param.h>
67@@ -51,6 +51,16 @@ 67@@ -51,6 +51,8 @@
68 #else 68 #else
69 # error "Unknown byte order" 69 # error "Unknown byte order"
70 #endif 70 #endif
71+#ifndef TEMP_FAILURE_RETRY
72+#define TEMP_FAILURE_RETRY(expression) \
73+ (__extension__ \
74+ ({ long int __result; \
75+ do __result = (long int) (expression); \
76+ while (__result == -1L && errno == EINTR); \
77+ __result; }))
78+#endif
79+ 71+
80+#define error(status, errno, ...) err(status, __VA_ARGS__) 72+#define error(status, errno, ...) err(status, __VA_ARGS__)
81 73
@@ -141,26 +133,6 @@ index 56e6105..f4a0649 100644
141 #include "../libdw/libdwP.h" /* DWARF_E_* values are here. */ 133 #include "../libdw/libdwP.h" /* DWARF_E_* values are here. */
142 #include "../libelf/libelfP.h" 134 #include "../libelf/libelfP.h"
143 #include "system.h" 135 #include "system.h"
144diff --git a/libdwfl/libdwfl_crc32_file.c b/libdwfl/libdwfl_crc32_file.c
145index f849128..6f0aca1 100644
146--- a/libdwfl/libdwfl_crc32_file.c
147+++ b/libdwfl/libdwfl_crc32_file.c
148@@ -29,6 +29,15 @@
149 # include <config.h>
150 #endif
151
152+#ifndef TEMP_FAILURE_RETRY
153+#define TEMP_FAILURE_RETRY(expression) \
154+ (__extension__ \
155+ ({ long int __result; \
156+ do __result = (long int) (expression); \
157+ while (__result == -1L && errno == EINTR); \
158+ __result; }))
159+#endif
160+
161 #define crc32_file attribute_hidden __libdwfl_crc32_file
162 #define crc32 __libdwfl_crc32
163 #include <libdwflP.h>
164diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c 136diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
165index 360e4ee..b5aa397 100644 137index 360e4ee..b5aa397 100644
166--- a/libdwfl/linux-kernel-modules.c 138--- a/libdwfl/linux-kernel-modules.c