commit:     77466dc98168a7edba16360eee1e10bb1f8a1ccb
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Mon Jun 11 17:15:55 2018 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Mon Jun 11 17:15:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=77466dc9

dev-libs/elfutils: version bump to 0.171

cleanup

 dev-libs/elfutils/Manifest                         |   5 +-
 dev-libs/elfutils/elfutils-0.166.ebuild            |  82 --------
 dev-libs/elfutils/elfutils-0.170-r1.ebuild         |   4 +-
 ...utils-0.169-r1.ebuild => elfutils-0.171.ebuild} |  14 +-
 .../elfutils/files/elfutils-0.166-musl-libs.patch  | 218 ---------------------
 .../files/elfutils-0.166-musl-obstack-fts.patch    | 124 ------------
 .../elfutils/files/elfutils-0.166-musl-utils.patch | 183 -----------------
 .../files/elfutils-0.168-musl-obstack-fts.patch    | 102 ----------
 .../elfutils/files/elfutils-0.168-musl-utils.patch | 122 ------------
 .../elfutils/files/elfutils-0.171-musl-libs.patch  |  86 ++++++++
 10 files changed, 97 insertions(+), 843 deletions(-)

diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest
index d672ecd..625bc52 100644
--- a/dev-libs/elfutils/Manifest
+++ b/dev-libs/elfutils/Manifest
@@ -1,3 +1,2 @@
-DIST elfutils-0.166.tar.bz2 6496225 SHA256 
3c056914c8a438b210be0d790463b960fc79d234c3f05ce707cbff80e94cba30 SHA512 
543e8f9fbebbef86c40b1d6dc93da04a8431071aad636b70e7a1b9536450990b237d100d354c29fd0c3605074b7a0621f5bdaab4c2664be42b2912ad283bc614
 WHIRLPOOL 
4de083bbb397235dd46c2ba6e0cbb615825c13d7e8413015d5ff08d72deae1d9a508c0f6e5f90e27cc709870064bc53a51b2a681f2a9b80e1f658bb7dc475f8d
-DIST elfutils-0.169.tar.bz2 8067758 SHA256 
9412fac7b30872b738bc1ed1ebcaed54493c26ef9a67887913498c17b10f3bc2 SHA512 
0a81a20bb2aff533d035d6b76f1403437b2e11bce390db57e34b8c26e4b9b3150346d83dddcbfbbdc58063f046ca3223508dba35c6ce88e375d201e7a777a8b9
 WHIRLPOOL 
dc4f689b403160272dccb1e306ee3584f6d06156d3318d745bba46f9b4a31a477795223233ffb420b096b1c196aba09492e4ab5803f6150326b48e1045f92e06
-DIST elfutils-0.170.tar.bz2 8358001 SHA256 
1f844775576b79bdc9f9c717a50058d08620323c1e935458223a12f249c9e066 SHA512 
aca0b5e271138eaf86e36505ffb101181207b151e833e6cd7c18986ac50678542a5ecd2250f8dd6923ca497142f197c8b08fd225e4130b16b6203c24013d6d28
 WHIRLPOOL 
ebb3069aa52e49b7e137c722ac490b12393e0c54656d6d7476193eaa4253b48209e62e4babd4819a52cf5a9f3a1a6f56945eb776f014df9cbd841aa392e94823
+DIST elfutils-0.170.tar.bz2 8358001 BLAKE2B 
03ea3ba7d3feaac43065312c475f4a3cd9083a6c56c9982fa00c0ed02b28440f6a37bbeca4be18db13749647ea1c8a6f00dae7efcb1c70235110e60ad7d56d06
 SHA512 
aca0b5e271138eaf86e36505ffb101181207b151e833e6cd7c18986ac50678542a5ecd2250f8dd6923ca497142f197c8b08fd225e4130b16b6203c24013d6d28
+DIST elfutils-0.171.tar.bz2 8654558 BLAKE2B 
709b5a4090867ec536563ed31178f7fb820f6b0ca8fb7c379b9081fa0d0027c8c2904cf17e9ee36245dd1fea8d2853ee3e7af457167e007fb7b08eec2e921a30
 SHA512 
777be2d63ca9b11440bf358a33428d9ca974e2612a880934156c9f7194af596ed627c1ed2d48dbd47a3761c94913b8f39565f9dcb6b62c92bf229f04c96d5ee3

diff --git a/dev-libs/elfutils/elfutils-0.166.ebuild 
b/dev-libs/elfutils/elfutils-0.166.ebuild
deleted file mode 100644
index 38a5cc5..0000000
--- a/dev-libs/elfutils/elfutils-0.166.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-inherit autotools eutils flag-o-matic multilib-minimal
-
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement 
for libelf)"
-HOMEPAGE="https://fedorahosted.org/elfutils/";
-SRC_URI="https://fedorahosted.org/releases/e/l/${PN}/${PV}/${P}.tar.bz2";
-
-LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
-SLOT="0"
-KEYWORDS="amd64 arm ia64 ~mips ppc sh sparc x86"
-IUSE="bzip2 lzma nls static-libs test +threads +utils"
-
-# This pkg does not actually seem to compile currently in a uClibc
-# environment (xrealloc errs), but we need to ensure that glibc never
-# gets pulled in as a dep since this package does not respect virtual/libc
-RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
-       bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
-       lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
-       !dev-libs/libelf
-       abi_x86_32? (
-               !<=app-emulation/emul-linux-x86-baselibs-20130224-r11
-               !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
-       )"
-DEPEND="${RDEPEND}
-       nls? ( sys-devel/gettext )
-       >=sys-devel/flex-2.5.4a
-       sys-devel/m4
-       elibc_musl? (
-               sys-libs/argp-standalone
-               sys-libs/fts-standalone
-               sys-libs/obstack-standalone
-       )"
-
-src_prepare() {
-       epatch "${FILESDIR}"/${PN}-0.118-PaX-support.patch
-
-       # Add MUSL patches
-       epatch "${FILESDIR}"/${P}-musl-obstack-fts.patch
-       epatch "${FILESDIR}"/${P}-musl-libs.patch
-       epatch "${FILESDIR}"/${P}-musl-utils.patch
-
-       eautoreconf
-
-       use static-libs || sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e 
'/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in
-       sed -i 's:-Werror::' */Makefile.in
-       # some patches touch both configure and configure.ac
-       find -type f -exec touch -r configure {} +
-}
-
-src_configure() {
-       use test && append-flags -g #407135
-       multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-       ECONF_SOURCE="${S}" econf \
-               $(use_enable nls) \
-               $(use_enable threads thread-safety) \
-               --program-prefix="eu-" \
-               --with-zlib \
-               --disable-symbol-versioning \
-               $(use_with bzip2 bzlib) \
-               $(use_with lzma)
-}
-
-multilib_src_test() {
-       env     
LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm"
 \
-               LC_ALL="C" \
-               emake check || die
-}
-
-multilib_src_install_all() {
-       einstalldocs
-       dodoc NOTES
-       # These build quick, and are needed for most tests, so don't
-       # disable their building when the USE flag is disabled.
-       use utils || rm -rf "${ED}"/usr/bin
-}

diff --git a/dev-libs/elfutils/elfutils-0.170-r1.ebuild 
b/dev-libs/elfutils/elfutils-0.170-r1.ebuild
index fabb12e..dc4dc87 100644
--- a/dev-libs/elfutils/elfutils-0.170-r1.ebuild
+++ b/dev-libs/elfutils/elfutils-0.170-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -11,7 +11,7 @@ 
SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2";
 
 LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
 SLOT="0"
-KEYWORDS="~amd64 ~arm ~ia64 ~mips ~ppc ~sh ~sparc ~x86"
+KEYWORDS="amd64 arm ia64 ~mips ppc sh sparc x86"
 IUSE="bzip2 lzma nls static-libs test +threads +utils"
 
 RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]

diff --git a/dev-libs/elfutils/elfutils-0.169-r1.ebuild 
b/dev-libs/elfutils/elfutils-0.171.ebuild
similarity index 86%
rename from dev-libs/elfutils/elfutils-0.169-r1.ebuild
rename to dev-libs/elfutils/elfutils-0.171.ebuild
index 359a04e..874fd07 100644
--- a/dev-libs/elfutils/elfutils-0.169-r1.ebuild
+++ b/dev-libs/elfutils/elfutils-0.171.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -11,7 +11,7 @@ 
SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2";
 
 LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
 SLOT="0"
-KEYWORDS="amd64 arm ia64 ~mips ~ppc ~sh ~sparc ~x86"
+KEYWORDS="~amd64 ~arm ~ia64 ~mips ~ppc ~sh ~sparc ~x86"
 IUSE="bzip2 lzma nls static-libs test +threads +utils"
 
 RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
@@ -28,18 +28,18 @@ DEPEND="${RDEPEND}
                sys-libs/obstack-standalone
        )"
 
+PATCHES=("${FILESDIR}"/${PN}-0.118-PaX-support.patch)
+
 src_prepare() {
        default
-       epatch "${FILESDIR}"/${PN}-0.118-PaX-support.patch
-
        # Add MUSL patches
-       epatch "${FILESDIR}"/${PN}-0.168-musl-obstack-fts.patch
+       epatch "${FILESDIR}"/${PN}-0.170-musl-obstack-fts.patch
        epatch "${FILESDIR}"/${P}-musl-libs.patch
-       epatch "${FILESDIR}"/${PN}-0.168-musl-utils.patch
+       epatch "${FILESDIR}"/${PN}-0.170-musl-utils.patch
 
        eautoreconf
 
-       if use static-libs; then
+       if ! use static-libs; then
                sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' 
lib{asm,dw,elf}/Makefile.in || die
        fi
        sed -i 's:-Werror::' */Makefile.in || die

diff --git a/dev-libs/elfutils/files/elfutils-0.166-musl-libs.patch 
b/dev-libs/elfutils/files/elfutils-0.166-musl-libs.patch
deleted file mode 100644
index 645ebdd..0000000
--- a/dev-libs/elfutils/files/elfutils-0.166-musl-libs.patch
+++ /dev/null
@@ -1,218 +0,0 @@
-diff -Naur elfutils-0.166.orig/lib/error.h elfutils-0.166/lib/error.h
---- elfutils-0.166.orig/lib/error.h    1969-12-31 16:00:00.000000000 -0800
-+++ elfutils-0.166/lib/error.h 2016-11-15 12:26:59.352320431 -0800
-@@ -0,0 +1,27 @@
-+#ifndef _ERROR_H_
-+#define _ERROR_H_
-+
-+#include <stdarg.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+
-+static unsigned int error_message_count = 0;
-+
-+static inline void error(int status, int errnum, const char* format, ...)
-+{
-+      va_list ap;
-+      fprintf(stderr, "%s: ", program_invocation_name);
-+      va_start(ap, format);
-+      vfprintf(stderr, format, ap);
-+      va_end(ap);
-+      if (errnum)
-+              fprintf(stderr, ": %s", strerror(errnum));
-+      fprintf(stderr, "\n");
-+      error_message_count++;
-+      if (status)
-+              exit(status);
-+}
-+
-+#endif        /* _ERROR_H_ */
-diff -Naur elfutils-0.166.orig/lib/fixedsizehash.h 
elfutils-0.166/lib/fixedsizehash.h
---- elfutils-0.166.orig/lib/fixedsizehash.h    2016-11-15 12:19:07.101952241 
-0800
-+++ elfutils-0.166/lib/fixedsizehash.h 2016-11-15 12:26:59.355320459 -0800
-@@ -30,12 +30,12 @@
- #include <errno.h>
- #include <stdlib.h>
- #include <string.h>
--#include <sys/cdefs.h>
- #include <sys/param.h>
- 
- #include <system.h>
- 
--#define CONCAT(t1,t2) __CONCAT (t1,t2)
-+#define CONCAT1(x,y) x##y
-+#define CONCAT(x,y) CONCAT1(x,y)
- 
- /* Before including this file the following macros must be defined:
- 
-diff -Naur elfutils-0.166.orig/lib/system.h elfutils-0.166/lib/system.h
---- elfutils-0.166.orig/lib/system.h   2016-11-15 12:19:07.100952231 -0800
-+++ elfutils-0.166/lib/system.h        2016-11-15 12:26:59.356320468 -0800
-@@ -35,6 +35,7 @@
- #include <endian.h>
- #include <byteswap.h>
- #include <unistd.h>
-+#include <fcntl.h>
- 
- #if __BYTE_ORDER == __LITTLE_ENDIAN
- # define LE32(n)      (n)
-@@ -50,6 +51,20 @@
- # error "Unknown byte order"
- #endif
- 
-+#if !defined(__GLIBC__)
-+
-+/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno'
-+   set to EINTR.  */
-+
-+# define TEMP_FAILURE_RETRY(expression) \
-+  (__extension__                                                              
\
-+    ({ long int __result;                                                     
\
-+       do __result = (long int) (expression);                                 
\
-+       while (__result == -1L && errno == EINTR);                             
\
-+       __result; }))
-+
-+#endif
-+
- extern void *xmalloc (size_t) __attribute__ ((__malloc__));
- extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
- extern void *xrealloc (void *, size_t) __attribute__ ((__malloc__));
-diff -Naur elfutils-0.166.orig/libcpu/i386_disasm.c 
elfutils-0.166/libcpu/i386_disasm.c
---- elfutils-0.166.orig/libcpu/i386_disasm.c   2016-11-15 12:19:07.098952213 
-0800
-+++ elfutils-0.166/libcpu/i386_disasm.c        2016-11-15 12:26:59.357320477 
-0800
-@@ -1,4 +1,4 @@
--/* Disassembler for x86.
-+/* Disassembler for x86.
-    Copyright (C) 2007, 2008, 2009, 2011 Red Hat, Inc.
-    This file is part of elfutils.
-    Written by Ulrich Drepper <[email protected]>, 2007.
-@@ -710,6 +710,7 @@
- 
-               case 'm':
-                 /* Mnemonic.  */
-+                str = mnebuf;
- 
-                 if (unlikely (instrtab[cnt].mnemonic == MNE_INVALID))
-                   {
-diff -Naur elfutils-0.166.orig/libdw/libdw.h elfutils-0.166/libdw/libdw.h
---- elfutils-0.166.orig/libdw/libdw.h  2016-11-15 12:19:07.142952620 -0800
-+++ elfutils-0.166/libdw/libdw.h       2016-11-15 12:26:59.357320477 -0800
-@@ -33,7 +33,27 @@
- #include <stdbool.h>
- #include <stddef.h>
- #include <stdint.h>
-+#include <unistd.h>
-+#include <alloca.h>
-+#include <string.h>
- 
-+#ifndef TEMP_FAILURE_RETRY
-+#define TEMP_FAILURE_RETRY(expression) \
-+  (__extension__                                                              
\
-+    ({ long int __result;                                                     
\
-+       do __result = (long int) (expression);                                 
\
-+       while (__result == -1L && errno == EINTR);                             
\
-+       __result; }))
-+#endif
-+
-+#ifndef strndupa
-+#define strndupa(s, n) \
-+       (__extension__ ({const char *__in = (s); \
-+                        size_t __len = strnlen (__in, (n)) + 1; \
-+                        char *__out = (char *) alloca (__len); \
-+                        __out[__len-1] = '\0'; \
-+                        (char *) memcpy (__out, __in, __len-1);}))
-+#endif
- 
- #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
- # define __nonnull_attribute__(...) __attribute__ ((__nonnull__ 
(__VA_ARGS__)))
-diff -Naur elfutils-0.166.orig/libdwfl/dwfl_build_id_find_elf.c 
elfutils-0.166/libdwfl/dwfl_build_id_find_elf.c
---- elfutils-0.166.orig/libdwfl/dwfl_build_id_find_elf.c       2016-11-15 
12:19:07.125952463 -0800
-+++ elfutils-0.166/libdwfl/dwfl_build_id_find_elf.c    2016-11-15 
12:26:59.358320487 -0800
-@@ -94,7 +94,7 @@
-       {
-         if (*file_name != NULL)
-           free (*file_name);
--        *file_name = canonicalize_file_name (name);
-+        *file_name = realpath (name, NULL);
-         if (*file_name == NULL)
-           {
-             *file_name = name;
-diff -Naur elfutils-0.166.orig/libdwfl/dwfl_error.c 
elfutils-0.166/libdwfl/dwfl_error.c
---- elfutils-0.166.orig/libdwfl/dwfl_error.c   2016-11-15 12:19:07.119952407 
-0800
-+++ elfutils-0.166/libdwfl/dwfl_error.c        2016-11-15 12:26:59.358320487 
-0800
-@@ -154,7 +154,16 @@
-   switch (error &~ 0xffff)
-     {
-     case OTHER_ERROR (ERRNO):
-+#if defined(__GLIBC__)
-       return strerror_r (error & 0xffff, "bad", 0);
-+#else
-+      {
-+        static __thread char buf[128] = "";
-+        if (0 == strerror_r(error & 0xffff, buf, sizeof(buf)))
-+          return buf;
-+      }
-+      return "strerror_r() failed";
-+#endif
-     case OTHER_ERROR (LIBELF):
-       return elf_errmsg (error & 0xffff);
-     case OTHER_ERROR (LIBDW):
-diff -Naur elfutils-0.166.orig/libdwfl/find-debuginfo.c 
elfutils-0.166/libdwfl/find-debuginfo.c
---- elfutils-0.166.orig/libdwfl/find-debuginfo.c       2016-11-15 
12:19:07.122952435 -0800
-+++ elfutils-0.166/libdwfl/find-debuginfo.c    2016-11-15 12:26:59.358320487 
-0800
-@@ -385,7 +385,7 @@
-       /* If FILE_NAME is a symlink, the debug file might be associated
-        with the symlink target name instead.  */
- 
--      char *canon = canonicalize_file_name (file_name);
-+      char *canon = realpath (file_name, NULL);
-       if (canon != NULL && strcmp (file_name, canon))
-       fd = find_debuginfo_in_path (mod, canon,
-                                    debuglink_file, debuglink_crc,
-diff -Naur elfutils-0.166.orig/libebl/eblwstrtab.c 
elfutils-0.166/libebl/eblwstrtab.c
---- elfutils-0.166.orig/libebl/eblwstrtab.c    2016-11-15 12:19:07.227953406 
-0800
-+++ elfutils-0.166/libebl/eblwstrtab.c 2016-11-15 12:26:59.359320496 -0800
-@@ -305,7 +305,7 @@
- 
-   /* Process the current node.  */
-   nodep->offset = *offsetp;
--  *freep = wmempcpy (*freep, nodep->string, nodep->len);
-+  *freep = wmemcpy (*freep, nodep->string, nodep->len) + nodep->len;
-   *offsetp += nodep->len * sizeof (wchar_t);
- 
-   for (subs = nodep->next; subs != NULL; subs = subs->next)
-diff -Naur elfutils-0.166.orig/libelf/elf.h elfutils-0.166/libelf/elf.h
---- elfutils-0.166.orig/libelf/elf.h   2016-11-15 12:19:07.094952176 -0800
-+++ elfutils-0.166/libelf/elf.h        2016-11-15 12:26:59.361320514 -0800
-@@ -21,6 +21,17 @@
- 
- #include <features.h>
- 
-+#if !defined(__GLIBC__)
-+/* C++ needs to know that types and declarations are C, not C++.  */
-+#ifdef  __cplusplus
-+# define __BEGIN_DECLS  extern "C" {
-+# define __END_DECLS    }
-+#else
-+# define __BEGIN_DECLS
-+# define __END_DECLS
-+#endif
-+#endif
-+
- __BEGIN_DECLS
- 
- /* Standard ELF types.  */
-diff -Naur elfutils-0.166.orig/libelf/elf_getarsym.c 
elfutils-0.166/libelf/elf_getarsym.c
---- elfutils-0.166.orig/libelf/elf_getarsym.c  2016-11-15 12:19:07.089952130 
-0800
-+++ elfutils-0.166/libelf/elf_getarsym.c       2016-11-15 12:26:59.361320514 
-0800
-@@ -297,7 +297,7 @@
-               arsym[cnt].as_off = (*u32)[cnt];
- 
-             arsym[cnt].as_hash = _dl_elf_hash (str_data);
--            str_data = rawmemchr (str_data, '\0') + 1;
-+            str_data = memchr (str_data, '\0', SIZE_MAX) + 1;
-           }
- 
-         /* At the end a special entry.  */

diff --git a/dev-libs/elfutils/files/elfutils-0.166-musl-obstack-fts.patch 
b/dev-libs/elfutils/files/elfutils-0.166-musl-obstack-fts.patch
deleted file mode 100644
index 0d0a468..0000000
--- a/dev-libs/elfutils/files/elfutils-0.166-musl-obstack-fts.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-diff -Naur elfutils-0.166.orig/configure.ac elfutils-0.166/configure.ac
---- elfutils-0.166.orig/configure.ac   2016-11-15 12:19:07.231953443 -0800
-+++ elfutils-0.166/configure.ac        2016-11-15 12:20:59.299990043 -0800
-@@ -361,6 +361,60 @@
- fi
- AC_SUBST([argp_LDADD])
- 
-+dnl Check if we have fts available from our libc
-+AC_LINK_IFELSE(
-+      [AC_LANG_PROGRAM(
-+              [#if !defined(__x86_64__)
-+              #undef  _FILE_OFFSET_BITS
-+              #define _FILE_OFFSET_BITS 32
-+              #endif
-+              #include <fts.h>],
-+              [FTS* fts = 0; return fts_close(fts); return 0;]
-+              )],
-+      [libc_has_fts="true"],
-+      [libc_has_fts="false"]
-+)
-+
-+dnl If our libc doesn't provide fts, then test for libfts
-+if test "$libc_has_fts" = "false" ; then
-+      AC_MSG_WARN("libc does not have fts")
-+      AC_CHECK_LIB([fts], [fts_close], [have_fts="true"], [have_fts="false"])
-+
-+      if test "$have_fts" = "false"; then
-+              AC_MSG_ERROR("no libfts found")
-+      else
-+              fts_LDADD="-lfts"
-+      fi
-+else
-+      fts_LDADD=""
-+fi
-+AC_SUBST([fts_LDADD])
-+
-+dnl Check if we have obstack available from our libc
-+AC_LINK_IFELSE(
-+      [AC_LANG_PROGRAM(
-+              [#include <obstack.h>],
-+              [_obstack_begin(0, 0, 0, NULL, NULL); return 0;]
-+              )],
-+      [libc_has_obstack="true"],
-+      [libc_has_obstack="false"]
-+)
-+
-+dnl If our libc doesn't provide obstack, then test for libobstack
-+if test "$libc_has_obstack" = "false" ; then
-+      AC_MSG_WARN("libc does not have obstack")
-+      AC_CHECK_LIB([obstack], [_obstack_begin], [have_obstack="true"], 
[have_obstack="false"])
-+
-+      if test "$have_obstack" = "false"; then
-+              AC_MSG_ERROR("no libobstack found")
-+      else
-+              obstack_LDADD="-lobstack"
-+      fi
-+else
-+      obstack_LDADD=""
-+fi
-+AC_SUBST([obstack_LDADD])
-+
- dnl The directories with content.
- 
- dnl Documentation.
-diff -Naur elfutils-0.166.orig/libdw/Makefile.am 
elfutils-0.166/libdw/Makefile.am
---- elfutils-0.166.orig/libdw/Makefile.am      2016-11-15 12:19:07.142952620 
-0800
-+++ elfutils-0.166/libdw/Makefile.am   2016-11-15 12:20:59.299990043 -0800
-@@ -112,7 +112,7 @@
-               -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
-               -Wl,--version-script,$<,--no-undefined \
-               -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
--              -ldl -lz $(argp_LDADD) $(zip_LIBS)
-+              -ldl -lz $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(zip_LIBS)
-       @$(textrel_check)
-       $(AM_V_at)ln -fs $@ $@.$(VERSION)
- 
-diff -Naur elfutils-0.166.orig/src/Makefile.am elfutils-0.166/src/Makefile.am
---- elfutils-0.166.orig/src/Makefile.am        2016-11-15 12:19:07.072951972 
-0800
-+++ elfutils-0.166/src/Makefile.am     2016-11-15 12:20:59.299990043 -0800
-@@ -104,28 +104,28 @@
- ar_no_Wstack_usage = yes
- unstrip_no_Wstack_usage = yes
- 
--readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
--nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \
-+readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) 
$(fts_LDADD) $(obstack_LDADD) -ldl
-+nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD) -ldl \
-          $(demanglelib)
--size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
--strip_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
--ld_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
-+size_LDADD = $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
-+strip_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD) -ldl
-+ld_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD) -ldl
- if NATIVE_LD
- # -ldl is always needed for libebl.
- ld_LDADD += libld_elf.a
- endif
- ld_LDFLAGS = -rdynamic
--elflint_LDADD  = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
--findtextrel_LDADD = $(libdw) $(libelf) $(argp_LDADD)
--addr2line_LDADD = $(libdw) $(libelf) $(argp_LDADD) $(demanglelib)
--elfcmp_LDADD = $(libebl) $(libelf) $(argp_LDADD) -ldl
--objdump_LDADD  = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
--ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
--strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
--ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
--unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl
--stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl 
$(demanglelib)
--elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
-+elflint_LDADD  = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD) -ldl
-+findtextrel_LDADD = $(libdw) $(libelf) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD)
-+addr2line_LDADD = $(libdw) $(libelf) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD) $(demanglelib)
-+elfcmp_LDADD = $(libebl) $(libelf) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD) -ldl
-+objdump_LDADD  = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) 
$(fts_LDADD) $(obstack_LDADD) -ldl
-+ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD)
-+strings_LDADD = $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
-+ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) 
$(obstack_LDADD)
-+unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) 
$(fts_LDADD) $(obstack_LDADD) -ldl
-+stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) 
$(fts_LDADD) $(obstack_LDADD) -ldl $(demanglelib)
-+elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) 
$(fts_LDADD) $(obstack_LDADD)
- 
- ldlex.o: ldscript.c
- ldlex_no_Werror = yes

diff --git a/dev-libs/elfutils/files/elfutils-0.166-musl-utils.patch 
b/dev-libs/elfutils/files/elfutils-0.166-musl-utils.patch
deleted file mode 100644
index c65ee7b..0000000
--- a/dev-libs/elfutils/files/elfutils-0.166-musl-utils.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-diff -Naur elfutils-0.166.orig/src/arlib.h elfutils-0.166/src/arlib.h
---- elfutils-0.166.orig/src/arlib.h    2016-11-15 12:44:09.296103178 -0800
-+++ elfutils-0.166/src/arlib.h 2016-11-15 12:44:34.238342067 -0800
-@@ -29,6 +29,12 @@
- #include <stdint.h>
- #include <sys/types.h>
- 
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 
*/
-+#endif
-+#if !defined(DEFFILEMODE)
-+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 
0666*/
-+#endif
- 
- /* State of -D/-U flags.  */
- extern bool arlib_deterministic_output;
-diff -Naur elfutils-0.166.orig/src/elfcompress.c 
elfutils-0.166/src/elfcompress.c
---- elfutils-0.166.orig/src/elfcompress.c      2016-11-15 12:44:09.297103187 
-0800
-+++ elfutils-0.166/src/elfcompress.c   2016-11-15 12:44:34.243342115 -0800
-@@ -35,6 +35,13 @@
- #include <gelf.h>
- #include "system.h"
- 
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 
*/
-+#endif
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH ( 1 << 5)
-+#endif
-+
- /* Name and version of program.  */
- static void print_version (FILE *stream, struct argp_state *state);
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
-diff -Naur elfutils-0.166.orig/src/error.h elfutils-0.166/src/error.h
---- elfutils-0.166.orig/src/error.h    1969-12-31 16:00:00.000000000 -0800
-+++ elfutils-0.166/src/error.h 2016-11-15 12:44:34.243342115 -0800
-@@ -0,0 +1,27 @@
-+#ifndef _ERROR_H_
-+#define _ERROR_H_
-+
-+#include <stdarg.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+
-+static unsigned int error_message_count = 0;
-+
-+static inline void error(int status, int errnum, const char* format, ...)
-+{
-+      va_list ap;
-+      fprintf(stderr, "%s: ", program_invocation_name);
-+      va_start(ap, format);
-+      vfprintf(stderr, format, ap);
-+      va_end(ap);
-+      if (errnum)
-+              fprintf(stderr, ": %s", strerror(errnum));
-+      fprintf(stderr, "\n");
-+      error_message_count++;
-+      if (status)
-+              exit(status);
-+}
-+
-+#endif        /* _ERROR_H_ */
-diff -Naur elfutils-0.166.orig/src/ld.h elfutils-0.166/src/ld.h
---- elfutils-0.166.orig/src/ld.h       2016-11-15 12:44:09.298103197 -0800
-+++ elfutils-0.166/src/ld.h    2016-11-15 12:44:34.244342124 -0800
-@@ -24,6 +24,16 @@
- #include <stdio.h>
- #include "xelf.h"
- 
-+#if !defined(DL_CALL_FCT)
-+# define DL_CALL_FCT(fctp, args) (*fctp) args
-+#endif        /* !defined(DL_CALL_FCT) */
-+
-+#if !defined(ACCESSPERMS)
-+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
-+#endif
-+#if !defined(DEFFILEMODE)
-+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 
0666*/
-+#endif
- 
- /* Recommended size of the buffer passed to ld_strerror.  */
- #define ERRBUFSIZE    (512)
-diff -Naur elfutils-0.166.orig/src/ldgeneric.c elfutils-0.166/src/ldgeneric.c
---- elfutils-0.166.orig/src/ldgeneric.c        2016-11-15 12:44:09.296103178 
-0800
-+++ elfutils-0.166/src/ldgeneric.c     2016-11-15 12:44:34.246342143 -0800
-@@ -2628,12 +2628,12 @@
- }
- 
- 
--/* Callback function registered with on_exit to make sure the temporary
-+/* Callback function registered with atexit to make sure the temporary
-    files gets removed if something goes wrong.  */
- static void
--remove_tempfile (int status, void *arg)
-+remove_tempfile (void)
- {
--  if (status != 0 && ld_state.tempfname != NULL)
-+  if (error_message_count != 0 && ld_state.tempfname != NULL)
-     unlink (ld_state.tempfname);
- }
- 
-@@ -2680,7 +2680,7 @@
- 
-   /* Make sure we remove the temporary file in case something goes
-      wrong.  */
--  on_exit (remove_tempfile, NULL);
-+  atexit (remove_tempfile);
- 
-   /* Create the ELF file data for the output file.  */
-   Elf *elf = ld_state.outelf = elf_begin (fd,
-diff -Naur elfutils-0.166.orig/src/readelf.c elfutils-0.166/src/readelf.c
---- elfutils-0.166.orig/src/readelf.c  2016-11-15 12:44:09.301103225 -0800
-+++ elfutils-0.166/src/readelf.c       2016-11-15 12:44:49.816491269 -0800
-@@ -4487,10 +4487,11 @@
-   return base;
- }
- 
-+static const char *listptr_name;
-+
- static int
--compare_listptr (const void *a, const void *b, void *arg)
-+compare_listptr (const void *a, const void *b)
- {
--  const char *name = arg;
-   struct listptr *p1 = (void *) a;
-   struct listptr *p2 = (void *) b;
- 
-@@ -4506,21 +4507,21 @@
-         p1->warned = p2->warned = true;
-         error (0, 0,
-                gettext ("%s %#" PRIx64 " used with different address sizes"),
--               name, (uint64_t) p1->offset);
-+               listptr_name, (uint64_t) p1->offset);
-       }
-       if (p1->dwarf64 != p2->dwarf64)
-       {
-         p1->warned = p2->warned = true;
-         error (0, 0,
-                gettext ("%s %#" PRIx64 " used with different offset sizes"),
--               name, (uint64_t) p1->offset);
-+               listptr_name, (uint64_t) p1->offset);
-       }
-       if (listptr_base (p1) != listptr_base (p2))
-       {
-         p1->warned = p2->warned = true;
-         error (0, 0,
-                gettext ("%s %#" PRIx64 " used with different base addresses"),
--               name, (uint64_t) p1->offset);
-+               listptr_name, (uint64_t) p1->offset);
-       }
-     }
- 
-@@ -4585,9 +4586,11 @@
- static void
- sort_listptr (struct listptr_table *table, const char *name)
- {
--  if (table->n > 0)
--    qsort_r (table->table, table->n, sizeof table->table[0],
--           &compare_listptr, (void *) name);
-+  if (table->n > 0) {
-+    listptr_name = name;
-+    qsort (table->table, table->n, sizeof table->table[0],
-+        &compare_listptr);
-+  }
- }
- 
- static bool
-diff -Naur elfutils-0.166.orig/src/strip.c elfutils-0.166/src/strip.c
---- elfutils-0.166.orig/src/strip.c    2016-11-15 12:44:09.295103168 -0800
-+++ elfutils-0.166/src/strip.c 2016-11-15 12:44:34.250342182 -0800
-@@ -44,6 +44,10 @@
- #include <libebl.h>
- #include <system.h>
- 
-+#if !defined(ACCESSPERMS)
-+#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
-+#endif
-+
- typedef uint8_t GElf_Byte;
- 
- /* Name and version of program.  */

diff --git a/dev-libs/elfutils/files/elfutils-0.168-musl-obstack-fts.patch 
b/dev-libs/elfutils/files/elfutils-0.168-musl-obstack-fts.patch
deleted file mode 100644
index 22c668e..0000000
--- a/dev-libs/elfutils/files/elfutils-0.168-musl-obstack-fts.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-diff -Naur elfutils-0.168.orig/configure.ac elfutils-0.168/configure.ac
---- elfutils-0.168.orig/configure.ac   2016-12-28 10:56:21.720729030 -0800
-+++ elfutils-0.168/configure.ac        2016-12-28 11:58:40.493268053 -0800
-@@ -355,6 +355,60 @@
- fi
- AC_SUBST([argp_LDADD])
- 
-+dnl Check if we have fts available from our libc
-+AC_LINK_IFELSE(
-+      [AC_LANG_PROGRAM(
-+              [#if !defined(__x86_64__)
-+              #undef  _FILE_OFFSET_BITS
-+              #define _FILE_OFFSET_BITS 32
-+              #endif
-+              #include <fts.h>],
-+              [FTS* fts = 0; return fts_close(fts); return 0;]
-+              )],
-+      [libc_has_fts="true"],
-+      [libc_has_fts="false"]
-+)
-+
-+dnl If our libc doesn't provide fts, then test for libfts
-+if test "$libc_has_fts" = "false" ; then
-+      AC_MSG_WARN("libc does not have fts")
-+      AC_CHECK_LIB([fts], [fts_close], [have_fts="true"], [have_fts="false"])
-+
-+      if test "$have_fts" = "false"; then
-+              AC_MSG_ERROR("no libfts found")
-+      else
-+              fts_LDADD="-lfts"
-+      fi
-+else
-+      fts_LDADD=""
-+fi
-+AC_SUBST([fts_LDADD])
-+
-+dnl Check if we have obstack available from our libc
-+AC_LINK_IFELSE(
-+      [AC_LANG_PROGRAM(
-+              [#include <obstack.h>],
-+              [_obstack_begin(0, 0, 0, NULL, NULL); return 0;]
-+              )],
-+      [libc_has_obstack="true"],
-+      [libc_has_obstack="false"]
-+)
-+
-+dnl If our libc doesn't provide obstack, then test for libobstack
-+if test "$libc_has_obstack" = "false" ; then
-+      AC_MSG_WARN("libc does not have obstack")
-+      AC_CHECK_LIB([obstack], [_obstack_begin], [have_obstack="true"], 
[have_obstack="false"])
-+
-+      if test "$have_obstack" = "false"; then
-+              AC_MSG_ERROR("no libobstack found")
-+      else
-+              obstack_LDADD="-lobstack"
-+      fi
-+else
-+      obstack_LDADD=""
-+fi
-+AC_SUBST([obstack_LDADD])
-+
- dnl Check if we have <linux/bpf.h> for EM_BPF disassembly.
- AC_CHECK_HEADERS(linux/bpf.h)
- AM_CONDITIONAL(HAVE_LINUX_BPF_H, [test "x$ac_cv_header_linux_bpf_h" = "xyes"])
-diff -Naur elfutils-0.168.orig/libdw/Makefile.am 
elfutils-0.168/libdw/Makefile.am
---- elfutils-0.168.orig/libdw/Makefile.am      2016-12-28 10:56:21.700728842 
-0800
-+++ elfutils-0.168/libdw/Makefile.am   2016-12-28 11:58:40.494268063 -0800
-@@ -112,7 +112,7 @@
-               -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
-               -Wl,--version-script,$<,--no-undefined \
-               -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
--              -ldl -lz $(argp_LDADD) $(zip_LIBS)
-+              -ldl -lz $(argp_LDADD) $(fts_LDADD) $(zip_LIBS)
-       @$(textrel_check)
-       $(AM_V_at)ln -fs $@ $@.$(VERSION)
- 
-diff -Naur elfutils-0.168.orig/src/Makefile.am elfutils-0.168/src/Makefile.am
---- elfutils-0.168.orig/src/Makefile.am        2016-12-28 10:56:21.570727621 
-0800
-+++ elfutils-0.168/src/Makefile.am     2016-12-28 12:02:08.066297072 -0800
-@@ -68,8 +68,8 @@
- unstrip_no_Wstack_usage = yes
- 
- readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
--nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \
--         $(demanglelib)
-+nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \
-+         $(obstack_LDADD) -ldl $(demanglelib)
- size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
- strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl
- elflint_LDADD  = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
-@@ -77,9 +77,9 @@
- addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
- elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
- objdump_LDADD  = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
--ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
-+ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD)
- strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
--ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
-+ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD)
- unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl
- stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl 
$(demanglelib)
- elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)

diff --git a/dev-libs/elfutils/files/elfutils-0.168-musl-utils.patch 
b/dev-libs/elfutils/files/elfutils-0.168-musl-utils.patch
deleted file mode 100644
index 486f6e3..0000000
--- a/dev-libs/elfutils/files/elfutils-0.168-musl-utils.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-diff -Naur elfutils-0.168.orig/src/arlib.h elfutils-0.168/src/arlib.h
---- elfutils-0.168.orig/src/arlib.h    2016-12-28 10:56:21.570727621 -0800
-+++ elfutils-0.168/src/arlib.h 2016-12-28 11:51:27.643036959 -0800
-@@ -29,6 +29,12 @@
- #include <stdint.h>
- #include <sys/types.h>
- 
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 
*/
-+#endif
-+#if !defined(DEFFILEMODE)
-+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 
0666*/
-+#endif
- 
- /* State of -D/-U flags.  */
- extern bool arlib_deterministic_output;
-diff -Naur elfutils-0.168.orig/src/elfcompress.c 
elfutils-0.168/src/elfcompress.c
---- elfutils-0.168.orig/src/elfcompress.c      2016-12-28 10:56:21.569727612 
-0800
-+++ elfutils-0.168/src/elfcompress.c   2016-12-28 11:53:53.587463560 -0800
-@@ -37,6 +37,13 @@
- #include "libeu.h"
- #include "system.h"
- 
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 
*/
-+#endif
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH ( 1 << 5)
-+#endif
-+
- /* Name and version of program.  */
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
- 
-diff -Naur elfutils-0.168.orig/src/readelf.c elfutils-0.168/src/readelf.c
---- elfutils-0.168.orig/src/readelf.c  2016-12-28 10:56:21.572727640 -0800
-+++ elfutils-0.168/src/readelf.c       2016-12-28 11:45:38.460680025 -0800
-@@ -4490,10 +4490,11 @@
-   return base;
- }
- 
-+static const char *listptr_name;
-+
- static int
--compare_listptr (const void *a, const void *b, void *arg)
-+compare_listptr (const void *a, const void *b)
- {
--  const char *name = arg;
-   struct listptr *p1 = (void *) a;
-   struct listptr *p2 = (void *) b;
- 
-@@ -4509,21 +4510,21 @@
-         p1->warned = p2->warned = true;
-         error (0, 0,
-                gettext ("%s %#" PRIx64 " used with different address sizes"),
--               name, (uint64_t) p1->offset);
-+               listptr_name, (uint64_t) p1->offset);
-       }
-       if (p1->dwarf64 != p2->dwarf64)
-       {
-         p1->warned = p2->warned = true;
-         error (0, 0,
-                gettext ("%s %#" PRIx64 " used with different offset sizes"),
--               name, (uint64_t) p1->offset);
-+               listptr_name, (uint64_t) p1->offset);
-       }
-       if (listptr_base (p1) != listptr_base (p2))
-       {
-         p1->warned = p2->warned = true;
-         error (0, 0,
-                gettext ("%s %#" PRIx64 " used with different base addresses"),
--               name, (uint64_t) p1->offset);
-+               listptr_name, (uint64_t) p1->offset);
-       }
-     }
- 
-@@ -4589,8 +4590,11 @@
- sort_listptr (struct listptr_table *table, const char *name)
- {
-   if (table->n > 0)
--    qsort_r (table->table, table->n, sizeof table->table[0],
--           &compare_listptr, (void *) name);
-+    {
-+      listptr_name = name;
-+      qsort (table->table, table->n, sizeof table->table[0],
-+          &compare_listptr);
-+    }
- }
- 
- static bool
-diff -Naur elfutils-0.168.orig/src/strip.c elfutils-0.168/src/strip.c
---- elfutils-0.168.orig/src/strip.c    2016-12-28 10:56:21.571727631 -0800
-+++ elfutils-0.168/src/strip.c 2016-12-28 11:46:09.680979303 -0800
-@@ -45,6 +45,10 @@
- #include <libeu.h>
- #include <system.h>
- 
-+#if !defined(ACCESSPERMS)
-+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
-+#endif
-+
- typedef uint8_t GElf_Byte;
- 
- /* Name and version of program.  */
-diff -Naur elfutils-0.168.orig/src/unstrip.c elfutils-0.168/src/unstrip.c
---- elfutils-0.168.orig/src/unstrip.c  2016-12-28 10:56:21.571727631 -0800
-+++ elfutils-0.168/src/unstrip.c       2016-12-28 11:57:40.821684766 -0800
-@@ -56,6 +56,15 @@
- # define _(str) gettext (str)
- #endif
- 
-+#ifndef strndupa
-+#define strndupa(s, n) \
-+       ({const char *__in = (s); \
-+         size_t __len = strnlen (__in, (n)) + 1; \
-+         char *__out = (char *) alloca (__len); \
-+         __out[__len-1] = '\0'; \
-+         (char *) memcpy (__out, __in, __len-1);})
-+#endif
-+ 
- /* Name and version of program.  */
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
- 

diff --git a/dev-libs/elfutils/files/elfutils-0.171-musl-libs.patch 
b/dev-libs/elfutils/files/elfutils-0.171-musl-libs.patch
new file mode 100644
index 0000000..80a5adb
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.171-musl-libs.patch
@@ -0,0 +1,86 @@
+diff -Naur elfutils-0.171.orig/lib/error.h elfutils-0.171/lib/error.h
+--- elfutils-0.171.orig/lib/error.h    1969-12-31 16:00:00.000000000 -0800
++++ elfutils-0.171/lib/error.h 2018-06-11 10:11:15.910181114 -0700
+@@ -0,0 +1,27 @@
++#ifndef _ERROR_H_
++#define _ERROR_H_
++
++#include <stdarg.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++
++static unsigned int error_message_count = 0;
++
++static inline void error(int status, int errnum, const char* format, ...)
++{
++      va_list ap;
++      fprintf(stderr, "%s: ", program_invocation_name);
++      va_start(ap, format);
++      vfprintf(stderr, format, ap);
++      va_end(ap);
++      if (errnum)
++              fprintf(stderr, ": %s", strerror(errnum));
++      fprintf(stderr, "\n");
++      error_message_count++;
++      if (status)
++              exit(status);
++}
++
++#endif        /* _ERROR_H_ */
+diff -Naur elfutils-0.171.orig/lib/fixedsizehash.h 
elfutils-0.171/lib/fixedsizehash.h
+--- elfutils-0.171.orig/lib/fixedsizehash.h    2018-06-11 10:11:02.222181359 
-0700
++++ elfutils-0.171/lib/fixedsizehash.h 2018-06-11 10:11:15.913181114 -0700
+@@ -30,7 +30,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+ 
+ #include <system.h>
+ 
+diff -Naur elfutils-0.171.orig/libdwfl/dwfl_error.c 
elfutils-0.171/libdwfl/dwfl_error.c
+--- elfutils-0.171.orig/libdwfl/dwfl_error.c   2018-06-11 10:11:02.245181359 
-0700
++++ elfutils-0.171/libdwfl/dwfl_error.c        2018-06-11 10:11:18.020181076 
-0700
+@@ -154,7 +154,16 @@
+   switch (error &~ 0xffff)
+     {
+     case OTHER_ERROR (ERRNO):
++#if defined(__GLIBC__)
+       return strerror_r (error & 0xffff, "bad", 0);
++#else
++      {
++        static __thread char buf[128] = "";
++        if (strerror_r (error & 0xffff, buf, sizeof(buf)) == 0)
++          return buf;
++      }
++      return "strerror_r() failed";
++#endif
+     case OTHER_ERROR (LIBELF):
+       return elf_errmsg (error & 0xffff);
+     case OTHER_ERROR (LIBDW):
+diff -Naur elfutils-0.171.orig/libelf/elf.h elfutils-0.171/libelf/elf.h
+--- elfutils-0.171.orig/libelf/elf.h   2018-06-11 10:11:02.225181359 -0700
++++ elfutils-0.171/libelf/elf.h        2018-06-11 10:11:19.036181058 -0700
+@@ -21,7 +21,9 @@
+ 
+ #include <features.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /* Standard ELF types.  */
+ 
+@@ -3912,6 +3914,8 @@
+ #define R_METAG_TLS_LE_HI16   60
+ #define R_METAG_TLS_LE_LO16   61
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif        /* elf.h */

Reply via email to