elfutils: Add host build
[openwrt/openwrt.git] / package / libs / elfutils / patches / 100-musl-compat.patch
index 9631ce05d69d43f6e3d56906b0579ac78c8dcbd2..109b7ece0863ef30f63ddd526d89097b0018bd1f 100644 (file)
@@ -44,21 +44,12 @@ https://sourceware.org/bugzilla/show_bug.cgi?id=21002
  }
 --- a/libdwfl/dwfl_error.c
 +++ b/libdwfl/dwfl_error.c
-@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
- const char *
- dwfl_errmsg (int error)
- {
-+  static __thread char s[64] = "";
-   if (error == 0 || error == -1)
-     {
-       int last_error = global_error;
-@@ -154,7 +155,8 @@ dwfl_errmsg (int error)
+@@ -154,7 +154,7 @@ dwfl_errmsg (int error)
    switch (error &~ 0xffff)
      {
      case OTHER_ERROR (ERRNO):
 -      return strerror_r (error & 0xffff, "bad", 0);
-+      strerror_r (error & 0xffff, s, sizeof(s));
-+      return s;
++      return strerror_l (error & 0xffff, LC_GLOBAL_LOCALE);
      case OTHER_ERROR (LIBELF):
        return elf_errmsg (error & 0xffff);
      case OTHER_ERROR (LIBDW):