* [meta-oe][PATCH] asio: fix musl compilation (strerror_r)
@ 2016-08-26 12:09 André Draszik
2016-08-26 23:33 ` Khem Raj
2016-08-29 12:13 ` [meta-oe][PATCH v2] " André Draszik
0 siblings, 2 replies; 3+ messages in thread
From: André Draszik @ 2016-08-26 12:09 UTC (permalink / raw)
To: openembedded-devel
Cherry picked github pull request #95
https://github.com/chriskohlhoff/asio/pull/95
https://github.com/chriskohlhoff/asio/pull/95.patch
Signed-off-by: André Draszik <git@andred.net>
---
meta-oe/recipes-support/asio/asio/95.patch | 43 +++++++++++++++++++++++++++++
meta-oe/recipes-support/asio/asio_1.10.6.bb | 2 ++
2 files changed, 45 insertions(+)
create mode 100644 meta-oe/recipes-support/asio/asio/95.patch
diff --git a/meta-oe/recipes-support/asio/asio/95.patch b/meta-oe/recipes-support/asio/asio/95.patch
new file mode 100644
index 0000000..a337ad3
--- /dev/null
+++ b/meta-oe/recipes-support/asio/asio/95.patch
@@ -0,0 +1,43 @@
+From 52d862c4e8af60a31f0067e1070b8625e805cdc3 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 21 Jan 2016 23:37:32 +0100
+Subject: [PATCH] Fix use of strerror_r()
+
+Don't try keep track of all platforms which follows posix standard.
+Instead, make the platform which don't follow standard to an exception
+and fall back to standard implementation for everything else.
+
+This fixes building with musl libc.
+
+Fixes #94
+---
+Upstream-Status: Backport https://github.com/chriskohlhoff/asio/pull/95
+ asio/include/asio/impl/error_code.ipp | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/asio/include/asio/impl/error_code.ipp b/asio/include/asio/impl/error_code.ipp
+index b996773..3a1cff1 100644
+--- a/asio/include/asio/impl/error_code.ipp
++++ b/asio/include/asio/impl/error_code.ipp
+@@ -98,17 +98,14 @@ public:
+ #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__)
+ using namespace std;
+ return strerror(value);
+-#elif defined(__MACH__) && defined(__APPLE__) \
+- || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
+- || defined(_AIX) || defined(__hpux) || defined(__osf__) \
+- || defined(__ANDROID__)
++#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
++ char buf[256] = "";
++ return strerror_r(value, buf, sizeof(buf));
++#else
+ char buf[256] = "";
+ using namespace std;
+ strerror_r(value, buf, sizeof(buf));
+ return buf;
+-#else
+- char buf[256] = "";
+- return strerror_r(value, buf, sizeof(buf));
+ #endif
+ #endif // defined(ASIO_WINDOWS_DESKTOP) || defined(__CYGWIN__)
+ }
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 db4ae80..2a64f1e 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"
SRC_URI[md5sum] = "85d014a356a6e004cd30ccd4c9b6a5c2"
SRC_URI[sha256sum] = "e0d71c40a7b1f6c1334008fb279e7361b32a063e020efd21e40d9d8ff037195e"
+
+SRC_URI += "file://95.patch;pnum=2"
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [meta-oe][PATCH] asio: fix musl compilation (strerror_r)
2016-08-26 12:09 [meta-oe][PATCH] asio: fix musl compilation (strerror_r) André Draszik
@ 2016-08-26 23:33 ` Khem Raj
2016-08-29 12:13 ` [meta-oe][PATCH v2] " André Draszik
1 sibling, 0 replies; 3+ messages in thread
From: Khem Raj @ 2016-08-26 23:33 UTC (permalink / raw)
To: openembedded-devel
On 8/26/16 5:09 AM, André Draszik wrote:
> Cherry picked github pull request #95
> https://github.com/chriskohlhoff/asio/pull/95
> https://github.com/chriskohlhoff/asio/pull/95.patch
>
this is fine
> Signed-off-by: André Draszik <git@andred.net>
> ---
> meta-oe/recipes-support/asio/asio/95.patch | 43 +++++++++++++++++++++++++++++
> meta-oe/recipes-support/asio/asio_1.10.6.bb | 2 ++
> 2 files changed, 45 insertions(+)
> create mode 100644 meta-oe/recipes-support/asio/asio/95.patch
>
> diff --git a/meta-oe/recipes-support/asio/asio/95.patch b/meta-oe/recipes-support/asio/asio/95.patch
> new file mode 100644
> index 0000000..a337ad3
> --- /dev/null
> +++ b/meta-oe/recipes-support/asio/asio/95.patch
> @@ -0,0 +1,43 @@
> +From 52d862c4e8af60a31f0067e1070b8625e805cdc3 Mon Sep 17 00:00:00 2001
> +From: Natanael Copa <ncopa@alpinelinux.org>
> +Date: Thu, 21 Jan 2016 23:37:32 +0100
> +Subject: [PATCH] Fix use of strerror_r()
> +
> +Don't try keep track of all platforms which follows posix standard.
> +Instead, make the platform which don't follow standard to an exception
> +and fall back to standard implementation for everything else.
> +
> +This fixes building with musl libc.
> +
> +Fixes #94
> +---
> +Upstream-Status: Backport https://github.com/chriskohlhoff/asio/pull/95
> + asio/include/asio/impl/error_code.ipp | 11 ++++-------
> + 1 file changed, 4 insertions(+), 7 deletions(-)
> +
> +diff --git a/asio/include/asio/impl/error_code.ipp b/asio/include/asio/impl/error_code.ipp
> +index b996773..3a1cff1 100644
> +--- a/asio/include/asio/impl/error_code.ipp
> ++++ b/asio/include/asio/impl/error_code.ipp
> +@@ -98,17 +98,14 @@ public:
> + #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__)
> + using namespace std;
> + return strerror(value);
> +-#elif defined(__MACH__) && defined(__APPLE__) \
> +- || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
> +- || defined(_AIX) || defined(__hpux) || defined(__osf__) \
> +- || defined(__ANDROID__)
> ++#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
> ++ char buf[256] = "";
> ++ return strerror_r(value, buf, sizeof(buf));
> ++#else
> + char buf[256] = "";
> + using namespace std;
> + strerror_r(value, buf, sizeof(buf));
> + return buf;
> +-#else
> +- char buf[256] = "";
> +- return strerror_r(value, buf, sizeof(buf));
> + #endif
> + #endif // defined(ASIO_WINDOWS_DESKTOP) || defined(__CYGWIN__)
> + }
> 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 db4ae80..2a64f1e 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"
>
> SRC_URI[md5sum] = "85d014a356a6e004cd30ccd4c9b6a5c2"
> SRC_URI[sha256sum] = "e0d71c40a7b1f6c1334008fb279e7361b32a063e020efd21e40d9d8ff037195e"
> +
> +SRC_URI += "file://95.patch;pnum=2"
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [meta-oe][PATCH v2] asio: fix musl compilation (strerror_r)
2016-08-26 12:09 [meta-oe][PATCH] asio: fix musl compilation (strerror_r) André Draszik
2016-08-26 23:33 ` Khem Raj
@ 2016-08-29 12:13 ` André Draszik
1 sibling, 0 replies; 3+ messages in thread
From: André Draszik @ 2016-08-29 12:13 UTC (permalink / raw)
To: openembedded-devel
Cherry picked upstream commit
Signed-off-by: André Draszik <git@andred.net>
---
...ly-handle-glibc-variant-of-strerror_r-wit.patch | 46 ++++++++++++++++++++++
meta-oe/recipes-support/asio/asio_1.10.6.bb | 2 +
2 files changed, 48 insertions(+)
create mode 100644 meta-oe/recipes-support/asio/asio/0001-Automatically-handle-glibc-variant-of-strerror_r-wit.patch
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 0000000..4244b97
--- /dev/null
+++ b/meta-oe/recipes-support/asio/asio/0001-Automatically-handle-glibc-variant-of-strerror_r-wit.patch
@@ -0,0 +1,46 @@
+From 45c855400842fd40f200ae9b7abf9debf4ab5436 Mon Sep 17 00:00:00 2001
+From: Christopher Kohlhoff <chris@kohlhoff.com>
+Date: Sun, 28 Aug 2016 09:21:53 +1000
+Subject: [PATCH] Automatically handle glibc variant of strerror_r without
+ #ifdefs.
+
+---
+Upstream-Status: Backport https://github.com/chriskohlhoff/asio/commit/443bc17d13eb5e37de780ea6e23157493cf7b3b9
+ include/asio/impl/error_code.ipp | 16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/include/asio/impl/error_code.ipp b/include/asio/impl/error_code.ipp
+index ccb70dd..a117658 100644
+--- a/include/asio/impl/error_code.ipp
++++ b/include/asio/impl/error_code.ipp
+@@ -97,20 +97,18 @@ public:
+ #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__)
+ using namespace std;
+ return strerror(value);
+-#elif defined(__MACH__) && defined(__APPLE__) \
+- || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
+- || defined(_AIX) || defined(__hpux) || defined(__osf__) \
+- || defined(__ANDROID__)
+- char buf[256] = "";
+- using namespace std;
+- strerror_r(value, buf, sizeof(buf));
+- return buf;
+ #else
+ char buf[256] = "";
+- return strerror_r(value, buf, sizeof(buf));
++ using namespace std;
++ return strerror_result(strerror_r(value, buf, sizeof(buf)), buf);
+ #endif
+ #endif // defined(ASIO_WINDOWS)
+ }
++
++private:
++ // Helper function to adapt the result from glibc's variant of strerror_r.
++ static const char* strerror_result(int, const char* s) { return s; }
++ static const char* strerror_result(const char* s, const char*) { return s; }
+ };
+
+ } // namespace detail
+--
+2.9.3
+
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 db4ae80..d6f4ddd 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"
SRC_URI[md5sum] = "85d014a356a6e004cd30ccd4c9b6a5c2"
SRC_URI[sha256sum] = "e0d71c40a7b1f6c1334008fb279e7361b32a063e020efd21e40d9d8ff037195e"
+
+SRC_URI += "file://0001-Automatically-handle-glibc-variant-of-strerror_r-wit.patch"
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-29 12:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-26 12:09 [meta-oe][PATCH] asio: fix musl compilation (strerror_r) André Draszik
2016-08-26 23:33 ` Khem Raj
2016-08-29 12:13 ` [meta-oe][PATCH v2] " André Draszik
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.