diff options
author | André Draszik <git@andred.net> | 2016-08-29 13:13:15 +0100 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-09-05 13:30:52 +0200 |
commit | 2fe1b297615b6ce526870fbf1902c3d0541c26c1 (patch) | |
tree | 3685b73f1dd8e14b9ab1f361ed8abc2d71d992e0 /meta-oe/recipes-support/asio | |
parent | cc9b89f116854af50792e6b7f131b5f5702527b6 (diff) | |
download | meta-openembedded-2fe1b297615b6ce526870fbf1902c3d0541c26c1.tar.gz |
asio: fix musl compilation (strerror_r)
Cherry picked upstream commit
Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/asio')
-rw-r--r-- | meta-oe/recipes-support/asio/asio/0001-Automatically-handle-glibc-variant-of-strerror_r-wit.patch | 46 | ||||
-rw-r--r-- | meta-oe/recipes-support/asio/asio_1.10.6.bb | 2 |
2 files changed, 48 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/asio/asio/0001-Automatically-handle-glibc-variant-of-strerror_r-wit.patch b/meta-oe/recipes-support/asio/asio/0001-Automatically-handle-glibc-variant-of-strerror_r-wit.patch new file mode 100644 index 000000000..4244b97a8 --- /dev/null +++ b/meta-oe/recipes-support/asio/asio/0001-Automatically-handle-glibc-variant-of-strerror_r-wit.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 45c855400842fd40f200ae9b7abf9debf4ab5436 Mon Sep 17 00:00:00 2001 | ||
2 | From: Christopher Kohlhoff <chris@kohlhoff.com> | ||
3 | Date: Sun, 28 Aug 2016 09:21:53 +1000 | ||
4 | Subject: [PATCH] Automatically handle glibc variant of strerror_r without | ||
5 | #ifdefs. | ||
6 | |||
7 | --- | ||
8 | Upstream-Status: Backport https://github.com/chriskohlhoff/asio/commit/443bc17d13eb5e37de780ea6e23157493cf7b3b9 | ||
9 | include/asio/impl/error_code.ipp | 16 +++++++--------- | ||
10 | 1 file changed, 7 insertions(+), 9 deletions(-) | ||
11 | |||
12 | diff --git a/include/asio/impl/error_code.ipp b/include/asio/impl/error_code.ipp | ||
13 | index ccb70dd..a117658 100644 | ||
14 | --- a/include/asio/impl/error_code.ipp | ||
15 | +++ b/include/asio/impl/error_code.ipp | ||
16 | @@ -97,20 +97,18 @@ public: | ||
17 | #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__) | ||
18 | using namespace std; | ||
19 | return strerror(value); | ||
20 | -#elif defined(__MACH__) && defined(__APPLE__) \ | ||
21 | - || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \ | ||
22 | - || defined(_AIX) || defined(__hpux) || defined(__osf__) \ | ||
23 | - || defined(__ANDROID__) | ||
24 | - char buf[256] = ""; | ||
25 | - using namespace std; | ||
26 | - strerror_r(value, buf, sizeof(buf)); | ||
27 | - return buf; | ||
28 | #else | ||
29 | char buf[256] = ""; | ||
30 | - return strerror_r(value, buf, sizeof(buf)); | ||
31 | + using namespace std; | ||
32 | + return strerror_result(strerror_r(value, buf, sizeof(buf)), buf); | ||
33 | #endif | ||
34 | #endif // defined(ASIO_WINDOWS) | ||
35 | } | ||
36 | + | ||
37 | +private: | ||
38 | + // Helper function to adapt the result from glibc's variant of strerror_r. | ||
39 | + static const char* strerror_result(int, const char* s) { return s; } | ||
40 | + static const char* strerror_result(const char* s, const char*) { return s; } | ||
41 | }; | ||
42 | |||
43 | } // namespace detail | ||
44 | -- | ||
45 | 2.9.3 | ||
46 | |||
diff --git a/meta-oe/recipes-support/asio/asio_1.10.6.bb b/meta-oe/recipes-support/asio/asio_1.10.6.bb index db4ae80a2..d6f4dddc0 100644 --- a/meta-oe/recipes-support/asio/asio_1.10.6.bb +++ b/meta-oe/recipes-support/asio/asio_1.10.6.bb | |||
@@ -4,3 +4,5 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=fede5286a78559dd646e355ab0cc8f04" | |||
4 | 4 | ||
5 | SRC_URI[md5sum] = "85d014a356a6e004cd30ccd4c9b6a5c2" | 5 | SRC_URI[md5sum] = "85d014a356a6e004cd30ccd4c9b6a5c2" |
6 | SRC_URI[sha256sum] = "e0d71c40a7b1f6c1334008fb279e7361b32a063e020efd21e40d9d8ff037195e" | 6 | SRC_URI[sha256sum] = "e0d71c40a7b1f6c1334008fb279e7361b32a063e020efd21e40d9d8ff037195e" |
7 | |||
8 | SRC_URI += "file://0001-Automatically-handle-glibc-variant-of-strerror_r-wit.patch" | ||