elfutils: update to 0.186
[openwrt/staging/wigyori.git] / package / libs / elfutils / patches / 100-musl-compat.patch
index 508ff9e946f47499d159b2ec05e58e5ce077ef0f..52b9f2c43b7ecc6472fae16be9e127ebf8326cea 100644 (file)
@@ -1,27 +1,3 @@
-https://sourceware.org/bugzilla/show_bug.cgi?id=21002
-
---- a/lib/system.h
-+++ b/lib/system.h
-@@ -30,7 +30,18 @@
- #define LIB_SYSTEM_H  1
- #include <errno.h>
--#include <error.h>
-+#ifdef HAVE_ERROR_H
-+#include "error.h"
-+#else
-+#include "err.h"
-+#include <stdio.h>
-+#define error(status, errno, ...)             \
-+      do {                                    \
-+              fflush(stdout);                 \
-+              warn(__VA_ARGS__);              \
-+              if (status) exit(status);       \
-+       } while(0)
-+#endif
- #include <stddef.h>
- #include <stdint.h>
- #include <sys/param.h>
 --- a/libdw/libdw_alloc.c
 +++ b/libdw/libdw_alloc.c
 @@ -152,5 +152,5 @@ __attribute ((noreturn)) attribute_hidde
@@ -33,15 +9,21 @@ https://sourceware.org/bugzilla/show_bug.cgi?id=21002
  }
 --- a/libdwfl/dwfl_error.c
 +++ b/libdwfl/dwfl_error.c
-@@ -154,7 +154,11 @@ dwfl_errmsg (int error)
-   switch (error &~ 0xffff)
-     {
-     case OTHER_ERROR (ERRNO):
+@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
+ static const char *
+ errnomsg(int error)
+ {
 +#if defined(__GLIBC__) && !defined(__UCLIBC__)
-       return strerror_r (error & 0xffff, "bad", 0);
+   /* Won't be changed by strerror_r, but not const so compiler doesn't throw warning */
+   static char unknown[] = "unknown error";
+@@ -150,6 +151,9 @@ errnomsg(int error)
+   static __thread char msg[128];
+   return strerror_r (error, msg, sizeof (msg)) ? unknown : msg;
+ #endif
 +#else
-+      return strerror (error & 0xffff);
++  return strerror (error & 0xffff);
 +#endif
-     case OTHER_ERROR (LIBELF):
-       return elf_errmsg (error & 0xffff);
-     case OTHER_ERROR (LIBDW):
+ }
+ const char *