* [gentoo-commits] proj/musl:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2017-01-21 20:08 Aric Belsito
0 siblings, 0 replies; 6+ messages in thread
From: Aric Belsito @ 2017-01-21 20:08 UTC (permalink / raw
To: gentoo-commits
commit: 92b34c99e4c36d2328ffbd66e485fb7d433aa7c9
Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Sat Jan 21 20:07:04 2017 +0000
Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Sat Jan 21 20:07:47 2017 +0000
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=92b34c99
dev-libs/elfutils: Add stable and unstable
A long time coming because of the numerous breakout packages necessary.
Needs to be unmasked in order to build.
dev-libs/elfutils/Manifest | 12 ++
dev-libs/elfutils/elfutils-0.166.ebuild | 83 ++++++++
dev-libs/elfutils/elfutils-0.168.ebuild | 73 +++++++
.../files/elfutils-0.118-PaX-support.patch | 26 +++
.../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 +++++++++++++++++
.../elfutils/files/elfutils-0.168-musl-libs.patch | 173 ++++++++++++++++
.../files/elfutils-0.168-musl-obstack-fts.patch | 102 ++++++++++
.../elfutils/files/elfutils-0.168-musl-utils.patch | 122 ++++++++++++
dev-libs/elfutils/metadata.xml | 13 ++
11 files changed, 1129 insertions(+)
diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest
new file mode 100644
index 0000000..1a5b6bb
--- /dev/null
+++ b/dev-libs/elfutils/Manifest
@@ -0,0 +1,12 @@
+AUX elfutils-0.118-PaX-support.patch 954 SHA256 e769e1168dc645ce99655f984f5c19a54d765210cacd098556b6b68743b877fa SHA512 d2b27b1715908ebc68c304a32b29e5bdebede5d4c9819b552617b3e3fd00f21570fa2346ec0e01b9b8028e9139eea629e0e70bee2f509ebfdacd31bbcd3bea0d WHIRLPOOL 47b537a5a01b9a1240b0e922eeef7e5e0e00b04cb474dbb0728849deba4a50c13e6a56b9b5476121771dab25a61641091deefd2cf94bb7cdcf4858f1b6222670
+AUX elfutils-0.166-musl-libs.patch 7954 SHA256 733db8f0d362910fa83fb32df6ee0ca6f460c4050c2d53a197c31d468bb71531 SHA512 e3ea9335fbc42e849aec80b4249effe9303066a7d569c999adb03436ec2b78c5a4fff61abba422da7f4c73967956c403d16c359f7ca9da6df64c3bce6eeff2ac WHIRLPOOL 0fb81171ae6102b85ba7bea3c876e0bcc09cc9f2a4ee3ee7ccfa7c35d0745b89cf423730da59d1eef45c885fa44626dfd68faadb12156b41d9902104c0dfd61f
+AUX elfutils-0.166-musl-obstack-fts.patch 5276 SHA256 e6cd808c69c26907d13ad3e53f67a47f0a4e6a73a419421f021334338d64f5fc SHA512 7715375677001efc89c18cd11804fa21423331c831a10d24ebf1d591e9c66de56d965b244ea9fbc45cd7bf5236bd59bfcd8e684683871235153f1f2ef11e4d3d WHIRLPOOL d1d8aeb391d9eb7a5c967274606fe85d59fbeb5af9c5de7504bf901972634e5835d5056115c8eb6e59b6971b0db9f5d9456b26f13512a3783a869cf459c59406
+AUX elfutils-0.166-musl-utils.patch 5703 SHA256 a8d7e456abe29e5ade35832d872eb56eaf29de0571ab0c38bc4cc7d5212b47ce SHA512 df0bafd47c46e2da7cd60e2063823a531c5ec5507207ca14d02f3f7cd1ee2bb21a77daf01b6f63decc9b55db25424375b05d04495a347c6c17f6ec32d8d62824 WHIRLPOOL d2a7809ef296ab9b83a4bf45aefb2ae8f916eab6c5276aef8bbe5f99af59c2f1cea847713d22be2f2c674f0e53fa36564a705121c512a51cc6cca2ac31933391
+AUX elfutils-0.168-musl-libs.patch 5959 SHA256 b61b43897db3f1a76d1f2721c13a888dbeafcbc6ed4f469ffb520d2ac38a0ef0 SHA512 bdaeb3962cfec49d33078bc9f02e0cf48c7459e4c4bd3efa5a899a2a4e40cbc4cbc530b53738a97a633c4852edd5377d95ae80619fa2642f182ba6b7f696fce9 WHIRLPOOL c4677fde127b01c4e6aee7124fdf984fa5b181e9ab6e9f8ee71668c03a62eb16904847ef015ed963feffee21db70be51632343e4eb3a5397d76cdd09907fe499
+AUX elfutils-0.168-musl-obstack-fts.patch 3866 SHA256 f3f0993948744f4d18f2618b221edfb1bdb5e44afb25d84fb8017115acd7970d SHA512 a93faea92bcdc9bff7fffabc35626213b8efa7003b893753480250fab7295aabd415fbf947f09ebd9e0ab8037582e4fe5a689e2910845223b2f00eabb2f529c1 WHIRLPOOL ee8745e65281f9cd2aae1bfee9d6e9f9e20677ac4f013f79436f8749f43ed897a98744d78e090de6561737b2af26063743e93d8b7686fef02cc5792fdc3754bd
+AUX elfutils-0.168-musl-utils.patch 3833 SHA256 5f939b8e9c19ed84239ca30715c5117e42a8a0b46e854311440dcad5508bfb46 SHA512 b3ab2c6f8e04507580feedddaf7c0a260c70d96550d7befb4e060f1b7619c69ceddff43dae407fd677be939c48556bfd253d5bedd619e85fd8418a6fdcab0b01 WHIRLPOOL 22751e586c78479bc087a16668fcd4f0bb37c019795fbfd4eb52fb7cc5784259868252a48b70429339a659e97815050717ed34cf7dee61661b0cb26925efdd4b
+DIST elfutils-0.166.tar.bz2 6496225 SHA256 3c056914c8a438b210be0d790463b960fc79d234c3f05ce707cbff80e94cba30 SHA512 543e8f9fbebbef86c40b1d6dc93da04a8431071aad636b70e7a1b9536450990b237d100d354c29fd0c3605074b7a0621f5bdaab4c2664be42b2912ad283bc614 WHIRLPOOL 4de083bbb397235dd46c2ba6e0cbb615825c13d7e8413015d5ff08d72deae1d9a508c0f6e5f90e27cc709870064bc53a51b2a681f2a9b80e1f658bb7dc475f8d
+DIST elfutils-0.168.tar.bz2 6840399 SHA256 b88d07893ba1373c7dd69a7855974706d05377766568a7d9002706d5de72c276 SHA512 c8f2077ffe6877ad9e9d2f553bf0576361799c601d246f53e1d99a6f7046794c5916e1087b97ad1d1e5f59f9debc20384f864d507ef6c4c75a8e767d15d6eb91 WHIRLPOOL 281e6917ad243c4f28dad48801d43c29b503da0198f1cd882b6e378b9016e0843088185a39909db75295484f28b963b711f68b80dc6cc810b3027a2ea5cce556
+EBUILD elfutils-0.166.ebuild 2541 SHA256 67c6a8b7aa2de1a7a03f6171e5608bcca22dfd9aff155dfc14a1797a6fbb5d0e SHA512 9cdf98e10533991996301355b4a9a03bb09b1afd0be5a0454a3a3ae09d559adb38d780db0d9ed8f29a8eab3dba01e5ba432a626084be0f30931fa9130cfbd8f1 WHIRLPOOL a4e427fb15611427e6b431f52d1f6324db97cd890553d87ac8a93c75c2740bc79db60860315ba0f6c25f7119f649dd452aca00c61cb585e75d3501a8f74a6528
+EBUILD elfutils-0.168.ebuild 2077 SHA256 c9cfc5b872bc5bfde37f0149d5129515eb9171925e08107218dfef4fd86e2f87 SHA512 baf7deed876788a7d21d126b1058c605612437b7114d517e39053e9c4ca1f3600fb41a73f991099b0d0b957213b81a84fc27471efdace9abd3e3a2ce6fde24f5 WHIRLPOOL 3754e1aa43f02c5e90b798c9ac97868c47c8b9e68e9e7133a49a24abf9f3279e29dac3c479deca76e10b029a4bc7b495c67dd8d111699ae0c630f0b5c286776b
+MISC metadata.xml 536 SHA256 c3a1800d65f3a779757015fa973588785610daa943a0f5781faf854792ef6993 SHA512 ad625d13a4e5411db4423030760ac51dd44e8da599409bff3e5607c02ed158421e90d7cec8c0b4c0228049b975d3c65a7dbebef78eedd7aca700d38612873cac WHIRLPOOL 4f06288344e8654c048b3ed2aaee8353e0f76a1623eb6936564f65954d52247db57903bdc70f50cd7465681887279024bad5ddd6c9d9c4297a17ef758bd1cf43
diff --git a/dev-libs/elfutils/elfutils-0.166.ebuild b/dev-libs/elfutils/elfutils-0.166.ebuild
new file mode 100644
index 0000000..9ed5b3f
--- /dev/null
+++ b/dev-libs/elfutils/elfutils-0.166.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+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.168.ebuild b/dev-libs/elfutils/elfutils-0.168.ebuild
new file mode 100644
index 0000000..37e1f9c
--- /dev/null
+++ b/dev-libs/elfutils/elfutils-0.168.ebuild
@@ -0,0 +1,73 @@
+# 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="http://elfutils.org/"
+SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
+
+LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="bzip2 lzma nls static-libs test +threads +utils"
+
+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"
+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
+}
+
+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
+}
+
+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/files/elfutils-0.118-PaX-support.patch b/dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch
new file mode 100644
index 0000000..083f32f
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch
@@ -0,0 +1,26 @@
+Add support for PaX ELF markings
+
+Patch by Kevin F. Quinn <kevquinn@gentoo.org>
+
+http://bugs.gentoo.org/115100
+
+--- libelf/elf.h
++++ libelf/elf.h
+@@ -568,6 +568,7 @@
+ #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
+ #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
+ #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
++#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
+ #define PT_LOSUNW 0x6ffffffa
+ #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
+ #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
+--- src/elflint.c
++++ src/elflint.c
+@@ -3187,6 +3187,7 @@
+
+ if (phdr->p_type >= PT_NUM && phdr->p_type != PT_GNU_EH_FRAME
+ && phdr->p_type != PT_GNU_STACK && phdr->p_type != PT_GNU_RELRO
++ && phdr->p_type != PT_PAX_FLAGS
+ /* Check for a known machine-specific type. */
+ && ebl_segment_type_name (ebl, phdr->p_type, NULL, 0) == NULL)
+ ERROR (gettext ("\
diff --git a/dev-libs/elfutils/files/elfutils-0.166-musl-libs.patch b/dev-libs/elfutils/files/elfutils-0.166-musl-libs.patch
new file mode 100644
index 0000000..645ebdd
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.166-musl-libs.patch
@@ -0,0 +1,218 @@
+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 <drepper@redhat.com>, 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
new file mode 100644
index 0000000..0d0a468
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.166-musl-obstack-fts.patch
@@ -0,0 +1,124 @@
+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
new file mode 100644
index 0000000..c65ee7b
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.166-musl-utils.patch
@@ -0,0 +1,183 @@
+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-libs.patch b/dev-libs/elfutils/files/elfutils-0.168-musl-libs.patch
new file mode 100644
index 0000000..047cb99
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.168-musl-libs.patch
@@ -0,0 +1,173 @@
+diff -Naur elfutils-0.168.orig/lib/error.h elfutils-0.168/lib/error.h
+--- elfutils-0.168.orig/lib/error.h 1969-12-31 16:00:00.000000000 -0800
++++ elfutils-0.168/lib/error.h 2016-12-28 11:32:13.814801412 -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.168.orig/lib/fixedsizehash.h elfutils-0.168/lib/fixedsizehash.h
+--- elfutils-0.168.orig/lib/fixedsizehash.h 2016-12-28 10:56:21.563727556 -0800
++++ elfutils-0.168/lib/fixedsizehash.h 2016-12-28 11:32:13.815801422 -0800
+@@ -30,7 +30,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+
+ #include <system.h>
+
+diff -Naur elfutils-0.168.orig/lib/libeu.h elfutils-0.168/lib/libeu.h
+--- elfutils-0.168.orig/lib/libeu.h 2016-12-28 10:56:21.562727546 -0800
++++ elfutils-0.168/lib/libeu.h 2016-12-28 11:32:13.816801431 -0800
+@@ -29,6 +29,7 @@
+ #ifndef LIBEU_H
+ #define LIBEU_H
+
++#include "system.h"
+ #include <stddef.h>
+ #include <stdint.h>
+
+diff -Naur elfutils-0.168.orig/lib/system.h elfutils-0.168/lib/system.h
+--- elfutils-0.168.orig/lib/system.h 2016-12-28 10:56:21.564727565 -0800
++++ elfutils-0.168/lib/system.h 2016-12-28 11:32:13.816801431 -0800
+@@ -81,7 +81,7 @@
+ do \
+ __res = expression; \
+ while (__res == -1 && errno == EINTR); \
+- __res; });
++ __res; })
+ #endif
+
+ static inline ssize_t __attribute__ ((unused))
+diff -Naur elfutils-0.168.orig/libdwfl/dwfl_build_id_find_elf.c elfutils-0.168/libdwfl/dwfl_build_id_find_elf.c
+--- elfutils-0.168.orig/libdwfl/dwfl_build_id_find_elf.c 2016-12-28 10:56:21.720729030 -0800
++++ elfutils-0.168/libdwfl/dwfl_build_id_find_elf.c 2016-12-28 11:32:13.816801431 -0800
+@@ -30,6 +30,7 @@
+ #include <inttypes.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include "system.h"
+
+
+ int
+@@ -94,7 +95,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.168.orig/libdwfl/dwfl_error.c elfutils-0.168/libdwfl/dwfl_error.c
+--- elfutils-0.168.orig/libdwfl/dwfl_error.c 2016-12-28 10:56:21.714728974 -0800
++++ elfutils-0.168/libdwfl/dwfl_error.c 2016-12-28 11:34:41.712239116 -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 (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.168.orig/libdwfl/dwfl_module_getdwarf.c elfutils-0.168/libdwfl/dwfl_module_getdwarf.c
+--- elfutils-0.168.orig/libdwfl/dwfl_module_getdwarf.c 2016-12-28 10:56:21.710728936 -0800
++++ elfutils-0.168/libdwfl/dwfl_module_getdwarf.c 2016-12-28 11:32:13.817801441 -0800
+@@ -33,6 +33,7 @@
+ #include <unistd.h>
+ #include "../libdw/libdwP.h" /* DWARF_E_* values are here. */
+ #include "../libelf/libelfP.h"
++#include "system.h"
+
+ static inline Dwfl_Error
+ open_elf_file (Elf **elf, int *fd, char **name)
+diff -Naur elfutils-0.168.orig/libdwfl/find-debuginfo.c elfutils-0.168/libdwfl/find-debuginfo.c
+--- elfutils-0.168.orig/libdwfl/find-debuginfo.c 2016-12-28 10:56:21.716728992 -0800
++++ elfutils-0.168/libdwfl/find-debuginfo.c 2016-12-28 11:32:13.817801441 -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.168.orig/libdwfl/libdwfl_crc32_file.c elfutils-0.168/libdwfl/libdwfl_crc32_file.c
+--- elfutils-0.168.orig/libdwfl/libdwfl_crc32_file.c 2016-12-28 10:56:21.710728936 -0800
++++ elfutils-0.168/libdwfl/libdwfl_crc32_file.c 2016-12-28 11:32:13.817801441 -0800
+@@ -31,6 +31,5 @@
+
+ #define crc32_file attribute_hidden __libdwfl_crc32_file
+ #define crc32 __libdwfl_crc32
+-#define LIB_SYSTEM_H 1
+ #include <libdwflP.h>
+ #include "../lib/crc32_file.c"
+diff -Naur elfutils-0.168.orig/libdwfl/linux-kernel-modules.c elfutils-0.168/libdwfl/linux-kernel-modules.c
+--- elfutils-0.168.orig/libdwfl/linux-kernel-modules.c 2016-12-28 10:56:21.717729002 -0800
++++ elfutils-0.168/libdwfl/linux-kernel-modules.c 2016-12-28 11:32:13.818801450 -0800
+@@ -45,6 +45,7 @@
+ #include <sys/utsname.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include "system.h"
+
+ /* If fts.h is included before config.h, its indirect inclusions may not
+ give us the right LFS aliases of these functions, so map them manually. */
+diff -Naur elfutils-0.168.orig/libelf/elf.h elfutils-0.168/libelf/elf.h
+--- elfutils-0.168.orig/libelf/elf.h 2016-12-28 10:56:21.585727762 -0800
++++ elfutils-0.168/libelf/elf.h 2016-12-28 11:32:13.819801460 -0800
+@@ -21,7 +21,9 @@
+
+ #include <features.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Standard ELF types. */
+
+@@ -3682,6 +3684,7 @@
+ #define R_BPF_NONE 0 /* No reloc */
+ #define R_BPF_MAP_FD 1 /* Map fd to pointer */
+
+-__END_DECLS
+-
++#ifdef __cplusplus
++}
++#endif
+ #endif /* elf.h */
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
new file mode 100644
index 0000000..22c668e
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.168-musl-obstack-fts.patch
@@ -0,0 +1,102 @@
+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
new file mode 100644
index 0000000..486f6e3
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.168-musl-utils.patch
@@ -0,0 +1,122 @@
+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/metadata.xml b/dev-libs/elfutils/metadata.xml
new file mode 100644
index 0000000..14c09d8
--- /dev/null
+++ b/dev-libs/elfutils/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <use>
+ <flag name="lzma">Support automatic decompression of LZMA-compressed files and kernel images</flag>
+ <flag name="threads">Build the libraries with thread safe support</flag>
+ <flag name="utils">Install command-line utilities (all the eu-* programs)</flag>
+ </use>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/musl:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2017-08-08 20:09 Aric Belsito
0 siblings, 0 replies; 6+ messages in thread
From: Aric Belsito @ 2017-08-08 20:09 UTC (permalink / raw
To: gentoo-commits
commit: 5699f85057604a6493d5ffa346beb5776301d776
Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Tue Aug 8 20:08:41 2017 +0000
Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Tue Aug 8 20:08:41 2017 +0000
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=5699f850
dev-libs/elfutils: version bump to 0.170
dev-libs/elfutils/Manifest | 5 +-
dev-libs/elfutils/elfutils-0.169-r1.ebuild | 2 +-
...utils-0.169-r1.ebuild => elfutils-0.170.ebuild} | 10 +-
.../files/elfutils-0.170-musl-obstack-fts.patch | 102 +++++++++++++++++++++
4 files changed, 112 insertions(+), 7 deletions(-)
diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest
index 7a54609..3c67364 100644
--- a/dev-libs/elfutils/Manifest
+++ b/dev-libs/elfutils/Manifest
@@ -5,8 +5,11 @@ AUX elfutils-0.166-musl-utils.patch 5703 SHA256 a8d7e456abe29e5ade35832d872eb56e
AUX elfutils-0.168-musl-obstack-fts.patch 3866 SHA256 f3f0993948744f4d18f2618b221edfb1bdb5e44afb25d84fb8017115acd7970d SHA512 a93faea92bcdc9bff7fffabc35626213b8efa7003b893753480250fab7295aabd415fbf947f09ebd9e0ab8037582e4fe5a689e2910845223b2f00eabb2f529c1 WHIRLPOOL ee8745e65281f9cd2aae1bfee9d6e9f9e20677ac4f013f79436f8749f43ed897a98744d78e090de6561737b2af26063743e93d8b7686fef02cc5792fdc3754bd
AUX elfutils-0.168-musl-utils.patch 3833 SHA256 5f939b8e9c19ed84239ca30715c5117e42a8a0b46e854311440dcad5508bfb46 SHA512 b3ab2c6f8e04507580feedddaf7c0a260c70d96550d7befb4e060f1b7619c69ceddff43dae407fd677be939c48556bfd253d5bedd619e85fd8418a6fdcab0b01 WHIRLPOOL 22751e586c78479bc087a16668fcd4f0bb37c019795fbfd4eb52fb7cc5784259868252a48b70429339a659e97815050717ed34cf7dee61661b0cb26925efdd4b
AUX elfutils-0.169-musl-libs.patch 3579 SHA256 05de076b4bbf8b0db103b943841825868e25b28fdd057d1d534d50180ec22bdd SHA512 401df45eea61a9acea175676d184983758915ab68dc37d72332c73b9ae2fab69094bb24bd9db9d79ad4f7b60f67cbac518f79cbb33cad9a6d55289728116bad3 WHIRLPOOL 71ae07ea3e4206881e16e0da51a82285ea51efecafa6897df175b0a8aa777e7479d1a2c0b130d0a1f3c95c8f5aec34e6a046f0a85c94b21cd2296c4a89763025
+AUX elfutils-0.170-musl-obstack-fts.patch 3919 SHA256 165841d5e340c8b5c1afcda2e5a97e75e3e84e5a51b0c9339a5dfe7f030df6ec SHA512 13ca0d13c314a39789d4c8946f351b0ab7efe365637baab370fd5edc7e6f902c88f8d4fe70b8185ee0c33e2d7e6b583b90b1549c83921d895af1cd629932a851 WHIRLPOOL 4eb213b4212eb35ba3ebc3fed75ab1b47c028d2d7f07c93427cd0eef547c470b2938177d734eb3cf4f81e2416b8ac1416d9ca7114a1952f93829b53b5d4587a4
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
EBUILD elfutils-0.166.ebuild 2534 SHA256 871895d2063eb8de76d8a53097d44744d5a648b2a11b04e930f08a37dc4b0b4e SHA512 57f011f6758371eb072a0592d51e89e9ced73d795466a2c5158ebde65cc1d55ebe5f2e1e1bb2faec1f9891d1234d7ff5229fab82505d317678b01b204e3c4e17 WHIRLPOOL 4ea30b8d36cb3f50e997316312f41b916e3b2a34c6d5e91e350de34e61933b0bae2e7e930d6e012528d779b46f169625a5528cf6e210c113dab32f6543ad6483
-EBUILD elfutils-0.169-r1.ebuild 2145 SHA256 b17f29458eacd12384c1d92a415505c89efa20b84ffc51ee6b7c95b533e0f14c SHA512 eded3a14e0f4459759b26b13d2160439f56a546c86f0ad7df2e458ff93d2bc4c4ae98363dfc0347ac1565b9b8c1d517b7ed5f072d7e891b11f22280b58f63c17 WHIRLPOOL 6e323d896321d57d2fb6078685d65a489456f5a8db06155a80d3f706e658252430c1240daf8cc175ac0b90825fe568673855d761b128c55d61682ec6e456623f
+EBUILD elfutils-0.169-r1.ebuild 2141 SHA256 5e4413bf86725d52069aa4e5cd1917f74736cca8a16fe3c70f1f6b20146d5003 SHA512 97782c1788311ec49db7802c80a85d37b17701a7902e4849d98df8071c91b263c748db76e13bde98ea988aba7d963389831fcda2f0c038d576b8f45bbaff48e3 WHIRLPOOL a65d1cb70b0e08b3588e38a3d4c8e3ff45b02f7eb79bed64f587b3416a5f1c3cf1a3a289206507018661dfead07ad8769d0c86fb9c22d39b2f6aed436d708a7c
+EBUILD elfutils-0.170.ebuild 2146 SHA256 0ea284cdabb64dffbb57c66e907a837a650f4bacc0d087bb6572e9564b6d3ada SHA512 e364190e2361b7d1f202ac9cbff7bd456040f96120d1bfa3bc4e26e5c99d7415363db3ca739b144c35aa0ab7df587e98a51d5f6908c92f99fb1107f9f5f09222 WHIRLPOOL 1375bf0546e0f174d13fd027b0d66922f511d5cb23f6fcd22df8a1880020418d7640f0e33a3e70ce92b6609ee07887c8c1949152384ffce705cee81e4fbcb151
MISC metadata.xml 536 SHA256 c3a1800d65f3a779757015fa973588785610daa943a0f5781faf854792ef6993 SHA512 ad625d13a4e5411db4423030760ac51dd44e8da599409bff3e5607c02ed158421e90d7cec8c0b4c0228049b975d3c65a7dbebef78eedd7aca700d38612873cac WHIRLPOOL 4f06288344e8654c048b3ed2aaee8353e0f76a1623eb6936564f65954d52247db57903bdc70f50cd7465681887279024bad5ddd6c9d9c4297a17ef758bd1cf43
diff --git a/dev-libs/elfutils/elfutils-0.169-r1.ebuild b/dev-libs/elfutils/elfutils-0.169-r1.ebuild
index 6ab86d2..c170f0a 100644
--- a/dev-libs/elfutils/elfutils-0.169-r1.ebuild
+++ b/dev-libs/elfutils/elfutils-0.169-r1.ebuild
@@ -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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
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.170.ebuild
similarity index 86%
copy from dev-libs/elfutils/elfutils-0.169-r1.ebuild
copy to dev-libs/elfutils/elfutils-0.170.ebuild
index 6ab86d2..01dd7ff 100644
--- a/dev-libs/elfutils/elfutils-0.169-r1.ebuild
+++ b/dev-libs/elfutils/elfutils-0.170.ebuild
@@ -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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
IUSE="bzip2 lzma nls static-libs test +threads +utils"
RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
@@ -28,13 +28,13 @@ 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}"/${P}-musl-libs.patch
+ epatch "${FILESDIR}"/${P}-musl-obstack-fts.patch
+ epatch "${FILESDIR}"/${PN}-0.169-musl-libs.patch
epatch "${FILESDIR}"/${PN}-0.168-musl-utils.patch
eautoreconf
diff --git a/dev-libs/elfutils/files/elfutils-0.170-musl-obstack-fts.patch b/dev-libs/elfutils/files/elfutils-0.170-musl-obstack-fts.patch
new file mode 100644
index 0000000..e2ba29a
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.170-musl-obstack-fts.patch
@@ -0,0 +1,102 @@
+diff -Naur elfutils-0.170.orig/configure.ac elfutils-0.170/configure.ac
+--- elfutils-0.170.orig/configure.ac 2017-08-08 12:51:02.675540308 -0700
++++ elfutils-0.170/configure.ac 2017-08-08 13:00:47.322520736 -0700
+@@ -385,6 +385,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.170.orig/libdw/Makefile.am elfutils-0.170/libdw/Makefile.am
+--- elfutils-0.170.orig/libdw/Makefile.am 2017-08-08 12:51:02.725540814 -0700
++++ elfutils-0.170/libdw/Makefile.am 2017-08-08 13:01:23.933848087 -0700
+@@ -105,7 +105,7 @@
+ libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
+ libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(zip_LIBS)
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
+ # The rpath is necessary for libebl because its $ORIGIN use will
+diff -Naur elfutils-0.170.orig/src/Makefile.am elfutils-0.170/src/Makefile.am
+--- elfutils-0.170.orig/src/Makefile.am 2017-08-08 12:51:02.768541249 -0700
++++ elfutils-0.170/src/Makefile.am 2017-08-08 13:02:47.304579123 -0700
+@@ -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)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/musl:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2018-06-11 17:24 Aric Belsito
0 siblings, 0 replies; 6+ messages in thread
From: Aric Belsito @ 2018-06-11 17:24 UTC (permalink / raw
To: gentoo-commits
commit: 6996199dda78dc093e6ff2aeb0f80f5f3c23bdfd
Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Mon Jun 11 17:24:00 2018 +0000
Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Mon Jun 11 17:24:00 2018 +0000
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=6996199d
dev-libs/elfutils: bump patch
dev-libs/elfutils/elfutils-0.171.ebuild | 2 +-
.../elfutils/files/elfutils-0.171-musl-utils.patch | 134 +++++++++++++++++++++
2 files changed, 135 insertions(+), 1 deletion(-)
diff --git a/dev-libs/elfutils/elfutils-0.171.ebuild b/dev-libs/elfutils/elfutils-0.171.ebuild
index 874fd07..b42dcab 100644
--- a/dev-libs/elfutils/elfutils-0.171.ebuild
+++ b/dev-libs/elfutils/elfutils-0.171.ebuild
@@ -35,7 +35,7 @@ src_prepare() {
# Add MUSL patches
epatch "${FILESDIR}"/${PN}-0.170-musl-obstack-fts.patch
epatch "${FILESDIR}"/${P}-musl-libs.patch
- epatch "${FILESDIR}"/${PN}-0.170-musl-utils.patch
+ epatch "${FILESDIR}"/${P}-musl-utils.patch
eautoreconf
diff --git a/dev-libs/elfutils/files/elfutils-0.171-musl-utils.patch b/dev-libs/elfutils/files/elfutils-0.171-musl-utils.patch
new file mode 100644
index 0000000..a6b9684
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.171-musl-utils.patch
@@ -0,0 +1,134 @@
+diff -Naur elfutils-0.171.orig/src/arlib.h elfutils-0.171/src/arlib.h
+--- elfutils-0.171.orig/src/arlib.h 2018-06-11 10:11:02.221181359 -0700
++++ elfutils-0.171/src/arlib.h 2018-06-11 10:21:30.810170102 -0700
+@@ -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.171.orig/src/elfcompress.c elfutils-0.171/src/elfcompress.c
+--- elfutils-0.171.orig/src/elfcompress.c 2018-06-11 10:11:02.221181359 -0700
++++ elfutils-0.171/src/elfcompress.c 2018-06-11 10:21:30.813170102 -0700
+@@ -37,6 +37,13 @@
+ #include "libeu.h"
+ #include "printversion.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.171.orig/src/readelf.c elfutils-0.171/src/readelf.c
+--- elfutils-0.171.orig/src/readelf.c 2018-06-11 10:11:02.221181359 -0700
++++ elfutils-0.171/src/readelf.c 2018-06-11 10:21:43.630169873 -0700
+@@ -4771,10 +4771,11 @@
+ return cudie_base (&cu);
+ }
+
++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;
+
+@@ -4790,21 +4791,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);
+ }
+ if (p1->attr != p2 ->attr)
+ {
+@@ -4812,7 +4813,7 @@
+ error (0, 0,
+ gettext ("%s %#" PRIx64
+ " used with different attribute %s and %s"),
+- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
++ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
+ dwarf_attr_name (p2->attr));
+ }
+ }
+@@ -4884,8 +4885,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.171.orig/src/strip.c elfutils-0.171/src/strip.c
+--- elfutils-0.171.orig/src/strip.c 2018-06-11 10:11:02.221181359 -0700
++++ elfutils-0.171/src/strip.c 2018-06-11 10:21:30.818170102 -0700
+@@ -47,6 +47,13 @@
+ #include <system.h>
+ #include <printversion.h>
+
++#if !defined(ACCESSPERMS)
++# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
++#endif
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH ( 1 << 5)
++#endif
++
+ typedef uint8_t GElf_Byte;
+
+ /* Name and version of program. */
+diff -Naur elfutils-0.171.orig/src/unstrip.c elfutils-0.171/src/unstrip.c
+--- elfutils-0.171.orig/src/unstrip.c 2018-06-11 10:11:02.221181359 -0700
++++ elfutils-0.171/src/unstrip.c 2018-06-11 10:21:30.819170102 -0700
+@@ -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;
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/musl:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2019-04-12 4:14 Jory Pratt
0 siblings, 0 replies; 6+ messages in thread
From: Jory Pratt @ 2019-04-12 4:14 UTC (permalink / raw
To: gentoo-commits
commit: 606fc6607c242f1fe91b655f4525b6b5c3cbf794
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 12 04:12:30 2019 +0000
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Fri Apr 12 04:12:30 2019 +0000
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=606fc660
dev-libs/elfutils: 0.176 with portability fixes from voidlinux
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
dev-libs/elfutils/Manifest | 1 +
dev-libs/elfutils/elfutils-0.176.ebuild | 78 ++++
.../files/elfutils-0.176-portability-fixes.patch | 414 +++++++++++++++++++++
3 files changed, 493 insertions(+)
diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest
index 3fdccde..37dfc30 100644
--- a/dev-libs/elfutils/Manifest
+++ b/dev-libs/elfutils/Manifest
@@ -1,3 +1,4 @@
DIST elfutils-0.170.tar.bz2 8358001 BLAKE2B 03ea3ba7d3feaac43065312c475f4a3cd9083a6c56c9982fa00c0ed02b28440f6a37bbeca4be18db13749647ea1c8a6f00dae7efcb1c70235110e60ad7d56d06 SHA512 aca0b5e271138eaf86e36505ffb101181207b151e833e6cd7c18986ac50678542a5ecd2250f8dd6923ca497142f197c8b08fd225e4130b16b6203c24013d6d28
DIST elfutils-0.172.tar.bz2 8601066 BLAKE2B 7d4cb9944bfc258ba46312e8a4dde491f9d8fb4fa27837f6df0993107256f76e79ce02ea5872475a70ff9ebe9093e39bddf1c807be2af4bf0f6f5429f446a1ce SHA512 b2f491e976ef3067fe33ad22b3ef1952c47557571747899e94aee601bfeb95e8e1a91daad80a7950bee7feb42192769663db32eb65734ea5ffbc0b87cdad76b2
DIST elfutils-0.173.tar.bz2 8684782 BLAKE2B c5905bb864059bdfb2699a0681a0ec576b6b8da444b0641e8184f58735084588910930bcca14583db6be75b24a0e374413911ded5ba2ca893798404fbe7374eb SHA512 7f38e4ce2098b685f15030bf01f0a66a74aa32fbfcead0304c1d0e0a929b348a72f99e685cd4605465f4337393382112f64b8847e6c2f7cc1a57a4fd03d03eb3
+DIST elfutils-0.176.tar.bz2 8646075 BLAKE2B 7f23d59b7f5d74946fea928a7fada7764c1f96a5eefefc4a3a382090eb7cad07c80419218300d853ccbef8f4e2288eb443ff06b3e64bf4511d9fa7aa84f5b794 SHA512 7f032913be363a43229ded85d495dcf7542b3c85974aaaba0d984228dc9ac1721da3dc388d3fa02325a80940161db7e9ad2c9e4521a424ad8a7d050c0902915b
diff --git a/dev-libs/elfutils/elfutils-0.176.ebuild b/dev-libs/elfutils/elfutils-0.176.ebuild
new file mode 100644
index 0000000..e80e341
--- /dev/null
+++ b/dev-libs/elfutils/elfutils-0.176.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic multilib-minimal
+
+DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
+HOMEPAGE="http://elfutils.org/"
+SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
+
+LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="bzip2 lzma nls static-libs test +threads +utils"
+
+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"
+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
+ )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.118-PaX-support.patch
+ "${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
+ "${FILESDIR}"/${PN}-0.176-portability-fixes.patch
+)
+
+src_prepare() {
+ default
+
+ eautoreconf
+
+ if ! use static-libs; then
+ sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
+ fi
+ # https://sourceware.org/PR23914
+ sed -i 's:-Werror::' */Makefile.in || die
+}
+
+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 \
+ $(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 VERBOSE=1
+}
+
+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.
+ if ! use utils; then
+ rm -rf "${ED}"/usr/bin || die
+ fi
+}
diff --git a/dev-libs/elfutils/files/elfutils-0.176-portability-fixes.patch b/dev-libs/elfutils/files/elfutils-0.176-portability-fixes.patch
new file mode 100644
index 0000000..f573f76
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.176-portability-fixes.patch
@@ -0,0 +1,414 @@
+From de94a67137e483db97efd40e7d13f0148e43e95c Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Thu, 11 Apr 2019 22:58:38 -0500
+Subject: [PATCH] portability fixes
+
+---
+ configure.ac | 56 ++++++++++++++++++++++++++++++++++++++++++++
+ lib/error.h | 27 +++++++++++++++++++++
+ lib/fixedsizehash.h | 1 -
+ libdw/Makefile.am | 2 +-
+ libdwfl/dwfl_error.c | 9 +++++++
+ libelf/elf.h | 11 +++++++++
+ src/Makefile.am | 28 +++++++++++-----------
+ src/arlib.h | 10 ++++++++
+ src/elfcompress.c | 8 +++++++
+ src/error.h | 27 +++++++++++++++++++++
+ src/readelf.c | 21 ++++++++++-------
+ src/strip.c | 8 +++++++
+ src/unstrip.c | 9 +++++++
+ 13 files changed, 192 insertions(+), 25 deletions(-)
+ create mode 100644 lib/error.h
+ create mode 100644 src/error.h
+
+diff --git a/configure.ac b/configure.ac
+index b4e012d..27e6152 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -494,6 +494,62 @@ else
+ 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 The directories with content.
+
+ dnl Documentation.
+diff --git a/lib/error.h b/lib/error.h
+new file mode 100644
+index 0000000..ef06827
+--- /dev/null
++++ b/lib/error.h
+@@ -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 --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
+index dac2a5f..43016fc 100644
+--- a/lib/fixedsizehash.h
++++ b/lib/fixedsizehash.h
+@@ -30,7 +30,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+
+ #include <system.h>
+
+diff --git a/libdw/Makefile.am b/libdw/Makefile.am
+index 7a3d532..646fbd0 100644
+--- a/libdw/Makefile.am
++++ b/libdw/Makefile.am
+@@ -108,7 +108,7 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+ libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
+ libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(zip_LIBS)
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
+ # The rpath is necessary for libebl because its $ORIGIN use will
+diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c
+index 7bcf61c..ff25ebb 100644
+--- a/libdwfl/dwfl_error.c
++++ b/libdwfl/dwfl_error.c
+@@ -154,7 +154,16 @@ dwfl_errmsg (int error)
+ 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 --git a/libelf/elf.h b/libelf/elf.h
+index 75043bc..da1598a 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -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 --git a/src/Makefile.am b/src/Makefile.am
+index 2b1c0dc..ad05977 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -67,22 +67,22 @@ ranlib_no_Wstack_usage = yes
+ 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) $(libdw) $(libeu) $(argp_LDADD) -ldl
+-elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
+-findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+-addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
+-elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
++size_LDADD = $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
++strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) -ldl
++elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) -ldl
++findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
++addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(demanglelib)
++elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_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)
++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)
+
+ installcheck-binPROGRAMS: $(bin_PROGRAMS)
+ bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
+diff --git a/src/arlib.h b/src/arlib.h
+index e117166..c66a5c9 100644
+--- a/src/arlib.h
++++ b/src/arlib.h
+@@ -29,6 +29,16 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+
++#if !defined(ACCESSPERMS)
++# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
++#endif
++#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 --git a/src/elfcompress.c b/src/elfcompress.c
+index 6ba6af4..f7d032b 100644
+--- a/src/elfcompress.c
++++ b/src/elfcompress.c
+@@ -37,6 +37,14 @@
+ #include "libeu.h"
+ #include "printversion.h"
+
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH 0
++#endif
++
++#if !defined(ALLPERMS)
++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
++#endif
++
+ /* Name and version of program. */
+ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+
+diff --git a/src/error.h b/src/error.h
+new file mode 100644
+index 0000000..ef06827
+--- /dev/null
++++ b/src/error.h
+@@ -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 --git a/src/readelf.c b/src/readelf.c
+index 33706bd..da6624b 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -4792,10 +4792,11 @@ listptr_base (struct listptr *p)
+ return cudie_base (&cu);
+ }
+
++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;
+
+@@ -4811,21 +4812,21 @@ compare_listptr (const void *a, const void *b, void *arg)
+ 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);
+ }
+ if (p1->attr != p2 ->attr)
+ {
+@@ -4833,7 +4834,7 @@ compare_listptr (const void *a, const void *b, void *arg)
+ error (0, 0,
+ gettext ("%s %#" PRIx64
+ " used with different attribute %s and %s"),
+- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
++ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
+ dwarf_attr_name (p2->attr));
+ }
+ }
+@@ -4904,9 +4905,11 @@ notice_listptr (enum section_e section, struct listptr_table *table,
+ 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 --git a/src/strip.c b/src/strip.c
+index a73009d..c6ed590 100644
+--- a/src/strip.c
++++ b/src/strip.c
+@@ -46,6 +46,14 @@
+ #include <system.h>
+ #include <printversion.h>
+
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH 0
++#endif
++
++#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/src/unstrip.c b/src/unstrip.c
+index 3495b1d..0754717 100644
+--- a/src/unstrip.c
++++ b/src/unstrip.c
+@@ -56,6 +56,15 @@
+ # define _(str) gettext (str)
+ #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
++
+ /* Name and version of program. */
+ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+
+--
+2.21.0
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/musl:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2019-08-21 22:42 Jory Pratt
0 siblings, 0 replies; 6+ messages in thread
From: Jory Pratt @ 2019-08-21 22:42 UTC (permalink / raw
To: gentoo-commits
commit: 4b5e40fed4ed28c0abb3fc7d1c6cdeb98298b76c
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 21 22:42:03 2019 +0000
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Wed Aug 21 22:42:03 2019 +0000
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=4b5e40fe
dev-libs/elfutils: 0.177 update, 0.176 sync with changes from tree
Package-Manager: Portage-2.3.72, Repoman-2.3.17
RepoMan-Options: --force
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
dev-libs/elfutils/Manifest | 4 +-
dev-libs/elfutils/elfutils-0.170-r1.ebuild | 78 ----
dev-libs/elfutils/elfutils-0.172.ebuild | 78 ----
...utils-0.176.ebuild => elfutils-0.176-r1.ebuild} | 4 +-
...elfutils-0.173.ebuild => elfutils-0.177.ebuild} | 22 +-
.../elfutils/files/elfutils-0.169-musl-libs.patch | 110 ------
.../files/elfutils-0.170-musl-obstack-fts.patch | 102 -----
.../elfutils/files/elfutils-0.170-musl-utils.patch | 125 -------
.../elfutils/files/elfutils-0.171-musl-libs.patch | 86 -----
.../elfutils/files/elfutils-0.171-musl-utils.patch | 134 -------
.../elfutils/files/elfutils-0.173-reorder.patch | 37 ++
.../files/elfutils-0.177-disable-large.patch | 14 +
.../files/elfutils-0.177-portability-fixes.patch | 416 +++++++++++++++++++++
13 files changed, 481 insertions(+), 729 deletions(-)
diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest
index 37dfc30..1e9d789 100644
--- a/dev-libs/elfutils/Manifest
+++ b/dev-libs/elfutils/Manifest
@@ -1,4 +1,2 @@
-DIST elfutils-0.170.tar.bz2 8358001 BLAKE2B 03ea3ba7d3feaac43065312c475f4a3cd9083a6c56c9982fa00c0ed02b28440f6a37bbeca4be18db13749647ea1c8a6f00dae7efcb1c70235110e60ad7d56d06 SHA512 aca0b5e271138eaf86e36505ffb101181207b151e833e6cd7c18986ac50678542a5ecd2250f8dd6923ca497142f197c8b08fd225e4130b16b6203c24013d6d28
-DIST elfutils-0.172.tar.bz2 8601066 BLAKE2B 7d4cb9944bfc258ba46312e8a4dde491f9d8fb4fa27837f6df0993107256f76e79ce02ea5872475a70ff9ebe9093e39bddf1c807be2af4bf0f6f5429f446a1ce SHA512 b2f491e976ef3067fe33ad22b3ef1952c47557571747899e94aee601bfeb95e8e1a91daad80a7950bee7feb42192769663db32eb65734ea5ffbc0b87cdad76b2
-DIST elfutils-0.173.tar.bz2 8684782 BLAKE2B c5905bb864059bdfb2699a0681a0ec576b6b8da444b0641e8184f58735084588910930bcca14583db6be75b24a0e374413911ded5ba2ca893798404fbe7374eb SHA512 7f38e4ce2098b685f15030bf01f0a66a74aa32fbfcead0304c1d0e0a929b348a72f99e685cd4605465f4337393382112f64b8847e6c2f7cc1a57a4fd03d03eb3
DIST elfutils-0.176.tar.bz2 8646075 BLAKE2B 7f23d59b7f5d74946fea928a7fada7764c1f96a5eefefc4a3a382090eb7cad07c80419218300d853ccbef8f4e2288eb443ff06b3e64bf4511d9fa7aa84f5b794 SHA512 7f032913be363a43229ded85d495dcf7542b3c85974aaaba0d984228dc9ac1721da3dc388d3fa02325a80940161db7e9ad2c9e4521a424ad8a7d050c0902915b
+DIST elfutils-0.177.tar.bz2 8852413 BLAKE2B 03f432342651f7646d73b7847325bd14b722ce34d85df01b1ad072b916af9b9da2d0d119cd24e952073bd584ec76b027ba9b6c7d45fb057372b3e700b1f5741a SHA512 2779987463a22ed220759e25a09c9a1eb84c0f36db37675136e59aa55c7f8f90b7a7d34ffc4e6a4291d7fa73692a1bd1a303a74270b11d1623b4f9868d19498f
diff --git a/dev-libs/elfutils/elfutils-0.170-r1.ebuild b/dev-libs/elfutils/elfutils-0.170-r1.ebuild
deleted file mode 100644
index 732ee27..0000000
--- a/dev-libs/elfutils/elfutils-0.170-r1.ebuild
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit autotools eutils flag-o-matic multilib-minimal
-
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
-HOMEPAGE="http://elfutils.org/"
-SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
-
-LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 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}]
- bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
- lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
- !dev-libs/libelf"
-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
- )"
-
-PATCHES=("${FILESDIR}"/${PN}-0.118-PaX-support.patch)
-
-src_prepare() {
- default
- # Add MUSL patches
- epatch "${FILESDIR}"/${P}-musl-obstack-fts.patch
- epatch "${FILESDIR}"/${PN}-0.169-musl-libs.patch
- epatch "${FILESDIR}"/${P}-musl-utils.patch
-
- eautoreconf
-
- 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
-}
-
-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
-}
-
-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.
- if ! use utils; then
- rm -rf "${ED}"/usr/bin || die
- fi
-}
diff --git a/dev-libs/elfutils/elfutils-0.172.ebuild b/dev-libs/elfutils/elfutils-0.172.ebuild
deleted file mode 100644
index 01620ca..0000000
--- a/dev-libs/elfutils/elfutils-0.172.ebuild
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit autotools eutils flag-o-matic multilib-minimal
-
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
-HOMEPAGE="http://elfutils.org/"
-SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
-
-LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~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}]
- bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
- lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
- !dev-libs/libelf"
-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
- )"
-
-PATCHES=("${FILESDIR}"/${PN}-0.118-PaX-support.patch)
-
-src_prepare() {
- default
- # Add MUSL patches
- epatch "${FILESDIR}"/${PN}-0.170-musl-obstack-fts.patch
- epatch "${FILESDIR}"/${PN}-0.171-musl-libs.patch
- epatch "${FILESDIR}"/${PN}-0.171-musl-utils.patch
-
- eautoreconf
-
- 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
-}
-
-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
-}
-
-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.
- if ! use utils; then
- rm -rf "${ED}"/usr/bin || die
- fi
-}
diff --git a/dev-libs/elfutils/elfutils-0.176.ebuild b/dev-libs/elfutils/elfutils-0.176-r1.ebuild
similarity index 92%
rename from dev-libs/elfutils/elfutils-0.176.ebuild
rename to dev-libs/elfutils/elfutils-0.176-r1.ebuild
index e80e341..7d8ad79 100644
--- a/dev-libs/elfutils/elfutils-0.176.ebuild
+++ b/dev-libs/elfutils/elfutils-0.176-r1.ebuild
@@ -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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sh sparc x86 ~amd64-linux ~x86-linux"
IUSE="bzip2 lzma nls static-libs test +threads +utils"
RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
@@ -21,7 +21,6 @@ RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
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
@@ -31,6 +30,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}"/${PN}-0.118-PaX-support.patch
"${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
+ "${FILESDIR}"/${PN}-0.173-reorder.patch
"${FILESDIR}"/${PN}-0.176-portability-fixes.patch
)
diff --git a/dev-libs/elfutils/elfutils-0.173.ebuild b/dev-libs/elfutils/elfutils-0.177.ebuild
similarity index 77%
rename from dev-libs/elfutils/elfutils-0.173.ebuild
rename to dev-libs/elfutils/elfutils-0.177.ebuild
index 97189fc..72a5084 100644
--- a/dev-libs/elfutils/elfutils-0.173.ebuild
+++ b/dev-libs/elfutils/elfutils-0.177.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=7
-inherit autotools eutils flag-o-matic multilib-minimal
+inherit autotools flag-o-matic multilib-minimal
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
HOMEPAGE="http://elfutils.org/"
@@ -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 ~arm64 ~ia64 ~mips ~ppc ~sh ~sparc ~x86"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="bzip2 lzma nls static-libs test +threads +utils"
RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
@@ -21,27 +21,28 @@ RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
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
)"
-PATCHES=("${FILESDIR}"/${PN}-0.118-PaX-support.patch)
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.118-PaX-support.patch
+ "${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
+ "${FILESDIR}"/${PN}-0.177-disable-large.patch
+ "${FILESDIR}"/${PN}-0.177-portability-fixes.patch
+)
src_prepare() {
default
- # Add MUSL patches
- epatch "${FILESDIR}"/${PN}-0.170-musl-obstack-fts.patch
- epatch "${FILESDIR}"/${PN}-0.171-musl-libs.patch
- epatch "${FILESDIR}"/${PN}-0.171-musl-utils.patch
eautoreconf
if ! use static-libs; then
sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
fi
+ # https://sourceware.org/PR23914
sed -i 's:-Werror::' */Makefile.in || die
}
@@ -56,7 +57,6 @@ multilib_src_configure() {
$(use_enable threads thread-safety) \
--program-prefix="eu-" \
--with-zlib \
- --disable-symbol-versioning \
$(use_with bzip2 bzlib) \
$(use_with lzma)
}
diff --git a/dev-libs/elfutils/files/elfutils-0.169-musl-libs.patch b/dev-libs/elfutils/files/elfutils-0.169-musl-libs.patch
deleted file mode 100644
index 0fcf72d..0000000
--- a/dev-libs/elfutils/files/elfutils-0.169-musl-libs.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-diff -Naur elfutils-0.169.orig/lib/error.h elfutils-0.169/lib/error.h
---- elfutils-0.169.orig/lib/error.h 1969-12-31 16:00:00.000000000 -0800
-+++ elfutils-0.169/lib/error.h 2017-05-22 11:46:56.303656762 -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.169.orig/lib/fixedsizehash.h elfutils-0.169/lib/fixedsizehash.h
---- elfutils-0.169.orig/lib/fixedsizehash.h 2017-05-22 11:45:32.228023470 -0700
-+++ elfutils-0.169/lib/fixedsizehash.h 2017-05-22 11:47:08.380737748 -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.169.orig/libdwfl/dwfl_build_id_find_elf.c elfutils-0.169/libdwfl/dwfl_build_id_find_elf.c
---- elfutils-0.169.orig/libdwfl/dwfl_build_id_find_elf.c 2017-05-22 11:45:32.397025345 -0700
-+++ elfutils-0.169/libdwfl/dwfl_build_id_find_elf.c 2017-05-22 11:48:25.398377146 -0700
-@@ -99,7 +99,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.169.orig/libdwfl/dwfl_error.c elfutils-0.169/libdwfl/dwfl_error.c
---- elfutils-0.169.orig/libdwfl/dwfl_error.c 2017-05-22 11:45:32.391025278 -0700
-+++ elfutils-0.169/libdwfl/dwfl_error.c 2017-05-22 11:48:49.678619010 -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.169.orig/libdwfl/find-debuginfo.c elfutils-0.169/libdwfl/find-debuginfo.c
---- elfutils-0.169.orig/libdwfl/find-debuginfo.c 2017-05-22 11:45:32.393025301 -0700
-+++ elfutils-0.169/libdwfl/find-debuginfo.c 2017-05-22 11:49:16.492886117 -0700
-@@ -389,7 +389,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.169.orig/libelf/elf.h elfutils-0.169/libelf/elf.h
---- elfutils-0.169.orig/libelf/elf.h 2017-05-22 11:45:32.267023903 -0700
-+++ elfutils-0.169/libelf/elf.h 2017-05-22 11:50:20.851532624 -0700
-@@ -21,7 +21,9 @@
-
- #include <features.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* Standard ELF types. */
-
-@@ -3683,6 +3685,8 @@
- #define R_BPF_NONE 0 /* No reloc */
- #define R_BPF_MAP_FD 1 /* Map fd to pointer */
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* elf.h */
diff --git a/dev-libs/elfutils/files/elfutils-0.170-musl-obstack-fts.patch b/dev-libs/elfutils/files/elfutils-0.170-musl-obstack-fts.patch
deleted file mode 100644
index e2ba29a..0000000
--- a/dev-libs/elfutils/files/elfutils-0.170-musl-obstack-fts.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-diff -Naur elfutils-0.170.orig/configure.ac elfutils-0.170/configure.ac
---- elfutils-0.170.orig/configure.ac 2017-08-08 12:51:02.675540308 -0700
-+++ elfutils-0.170/configure.ac 2017-08-08 13:00:47.322520736 -0700
-@@ -385,6 +385,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.170.orig/libdw/Makefile.am elfutils-0.170/libdw/Makefile.am
---- elfutils-0.170.orig/libdw/Makefile.am 2017-08-08 12:51:02.725540814 -0700
-+++ elfutils-0.170/libdw/Makefile.am 2017-08-08 13:01:23.933848087 -0700
-@@ -105,7 +105,7 @@
- libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
- ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
- libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
--libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
-+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(zip_LIBS)
- libdw_so_SOURCES =
- libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
- # The rpath is necessary for libebl because its $ORIGIN use will
-diff -Naur elfutils-0.170.orig/src/Makefile.am elfutils-0.170/src/Makefile.am
---- elfutils-0.170.orig/src/Makefile.am 2017-08-08 12:51:02.768541249 -0700
-+++ elfutils-0.170/src/Makefile.am 2017-08-08 13:02:47.304579123 -0700
-@@ -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.170-musl-utils.patch b/dev-libs/elfutils/files/elfutils-0.170-musl-utils.patch
deleted file mode 100644
index 5e00561..0000000
--- a/dev-libs/elfutils/files/elfutils-0.170-musl-utils.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-diff -Naur elfutils-0.170.orig/src/arlib.h elfutils-0.170/src/arlib.h
---- elfutils-0.170.orig/src/arlib.h 2017-08-08 13:18:49.812978045 -0700
-+++ elfutils-0.170/src/arlib.h 2017-08-08 13:19:51.749654704 -0700
-@@ -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.170.orig/src/elfcompress.c elfutils-0.170/src/elfcompress.c
---- elfutils-0.170.orig/src/elfcompress.c 2017-08-08 13:18:49.810978023 -0700
-+++ elfutils-0.170/src/elfcompress.c 2017-08-08 13:19:51.752654737 -0700
-@@ -37,6 +37,13 @@
- #include "libeu.h"
- #include "printversion.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.170.orig/src/readelf.c elfutils-0.170/src/readelf.c
---- elfutils-0.170.orig/src/readelf.c 2017-08-08 13:18:49.811978034 -0700
-+++ elfutils-0.170/src/readelf.c 2017-08-08 13:19:51.760654824 -0700
-@@ -4517,10 +4517,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;
-
-@@ -4536,21 +4537,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);
- }
- }
-
-@@ -4616,8 +4617,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.170.orig/src/strip.c elfutils-0.170/src/strip.c
---- elfutils-0.170.orig/src/strip.c 2017-08-08 13:18:49.812978045 -0700
-+++ elfutils-0.170/src/strip.c 2017-08-08 13:20:17.107931743 -0700
-@@ -47,6 +47,13 @@
- #include <system.h>
- #include <printversion.h>
-
-+#if !defined(ACCESSPERMS)
-+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
-+#endif
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH ( 1 << 5)
-+#endif
-+
- typedef uint8_t GElf_Byte;
-
- /* Name and version of program. */
-diff -Naur elfutils-0.170.orig/src/unstrip.c elfutils-0.170/src/unstrip.c
---- elfutils-0.170.orig/src/unstrip.c 2017-08-08 13:18:49.812978045 -0700
-+++ elfutils-0.170/src/unstrip.c 2017-08-08 13:19:51.765654879 -0700
-@@ -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
deleted file mode 100644
index 80a5adb..0000000
--- a/dev-libs/elfutils/files/elfutils-0.171-musl-libs.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-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 */
diff --git a/dev-libs/elfutils/files/elfutils-0.171-musl-utils.patch b/dev-libs/elfutils/files/elfutils-0.171-musl-utils.patch
deleted file mode 100644
index a6b9684..0000000
--- a/dev-libs/elfutils/files/elfutils-0.171-musl-utils.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-diff -Naur elfutils-0.171.orig/src/arlib.h elfutils-0.171/src/arlib.h
---- elfutils-0.171.orig/src/arlib.h 2018-06-11 10:11:02.221181359 -0700
-+++ elfutils-0.171/src/arlib.h 2018-06-11 10:21:30.810170102 -0700
-@@ -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.171.orig/src/elfcompress.c elfutils-0.171/src/elfcompress.c
---- elfutils-0.171.orig/src/elfcompress.c 2018-06-11 10:11:02.221181359 -0700
-+++ elfutils-0.171/src/elfcompress.c 2018-06-11 10:21:30.813170102 -0700
-@@ -37,6 +37,13 @@
- #include "libeu.h"
- #include "printversion.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.171.orig/src/readelf.c elfutils-0.171/src/readelf.c
---- elfutils-0.171.orig/src/readelf.c 2018-06-11 10:11:02.221181359 -0700
-+++ elfutils-0.171/src/readelf.c 2018-06-11 10:21:43.630169873 -0700
-@@ -4771,10 +4771,11 @@
- return cudie_base (&cu);
- }
-
-+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;
-
-@@ -4790,21 +4791,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);
- }
- if (p1->attr != p2 ->attr)
- {
-@@ -4812,7 +4813,7 @@
- error (0, 0,
- gettext ("%s %#" PRIx64
- " used with different attribute %s and %s"),
-- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
-+ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
- dwarf_attr_name (p2->attr));
- }
- }
-@@ -4884,8 +4885,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.171.orig/src/strip.c elfutils-0.171/src/strip.c
---- elfutils-0.171.orig/src/strip.c 2018-06-11 10:11:02.221181359 -0700
-+++ elfutils-0.171/src/strip.c 2018-06-11 10:21:30.818170102 -0700
-@@ -47,6 +47,13 @@
- #include <system.h>
- #include <printversion.h>
-
-+#if !defined(ACCESSPERMS)
-+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
-+#endif
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH ( 1 << 5)
-+#endif
-+
- typedef uint8_t GElf_Byte;
-
- /* Name and version of program. */
-diff -Naur elfutils-0.171.orig/src/unstrip.c elfutils-0.171/src/unstrip.c
---- elfutils-0.171.orig/src/unstrip.c 2018-06-11 10:11:02.221181359 -0700
-+++ elfutils-0.171/src/unstrip.c 2018-06-11 10:21:30.819170102 -0700
-@@ -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.173-reorder.patch b/dev-libs/elfutils/files/elfutils-0.173-reorder.patch
new file mode 100644
index 0000000..fd3dede
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.173-reorder.patch
@@ -0,0 +1,37 @@
+https://bugs.gentoo.org/666954
+https://github.com/rpm-software-management/rpm/issues/423
+https://sourceware.org/ml/elfutils-devel/2019-q2/msg00077.html
+
+From: Mark Wielaard <mark at klomp dot org>
+Subject: [PATCH] libelf: Mark shdr_flags dirty if offset or size changes during update.
+Date: Mon, 13 May 2019 00:13:42 +0200
+Message-Id: <20190512221342.23383-1-mark@klomp.org>
+
+We forgot to mark the shdr_flags dirty when only the sh_size or
+sh_offset changed during elf_update (). This meant that if there were
+no other shdr changes we only wrote out the section data, but didn't
+write out the shdr table to the file.
+
+Signed-off-by: Mark Wielaard <mark@klomp.org>
+---
+ libelf/elf32_updatenull.c | 5 +-
+
+--- a/libelf/elf32_updatenull.c
++++ b/libelf/elf32_updatenull.c
+@@ -366,12 +366,15 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
+ }
+
+ /* See whether the section size is correct. */
++ int size_changed = 0;
+ update_if_changed (shdr->sh_size, (GElf_Word) offset,
+- changed);
++ size_changed);
++ changed |= size_changed;
+
+ if (shdr->sh_type != SHT_NOBITS)
+ size += offset;
+
++ scn->shdr_flags |= (offset_changed | size_changed);
+ scn->flags |= changed;
+ }
+
diff --git a/dev-libs/elfutils/files/elfutils-0.177-disable-large.patch b/dev-libs/elfutils/files/elfutils-0.177-disable-large.patch
new file mode 100644
index 0000000..7829585
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.177-disable-large.patch
@@ -0,0 +1,14 @@
+getconf does not disable test on 64-kernel with CFLAGS=-m32
+--- a/tests/run-large-elf-file.sh
++++ b/tests/run-large-elf-file.sh
+@@ -19,6 +19,10 @@
+
+ # Only run on 64bit systems, 32bit systems don't support > 4GB
+ # ELF files.
++
++# this detection fails for 64-bit systems with -m32
++exit 77
++
+ long_bit=$(getconf LONG_BIT)
+ echo "long_bit: $long_bit"
+ if test $long_bit -ne 64; then
diff --git a/dev-libs/elfutils/files/elfutils-0.177-portability-fixes.patch b/dev-libs/elfutils/files/elfutils-0.177-portability-fixes.patch
new file mode 100644
index 0000000..e903c62
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.177-portability-fixes.patch
@@ -0,0 +1,416 @@
+From 5da3662ec16c0df64bbf8ffcf7e1d09c0782714c Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Wed, 21 Aug 2019 17:02:59 -0500
+Subject: [PATCH] Portability fixes for musl
+
+---
+ configure.ac | 56 ++++++++++++++++++++++++++++++++++++++++++++
+ lib/error.h | 27 +++++++++++++++++++++
+ lib/fixedsizehash.h | 1 -
+ libdw/Makefile.am | 2 +-
+ libdwfl/dwfl_error.c | 9 +++++++
+ libelf/elf.h | 11 +++++++++
+ src/Makefile.am | 30 ++++++++++++------------
+ src/arlib.h | 10 ++++++++
+ src/elfcompress.c | 8 +++++++
+ src/error.h | 27 +++++++++++++++++++++
+ src/readelf.c | 21 ++++++++++-------
+ src/strip.c | 8 +++++++
+ src/unstrip.c | 9 +++++++
+ 13 files changed, 193 insertions(+), 26 deletions(-)
+ create mode 100644 lib/error.h
+ create mode 100644 src/error.h
+
+diff --git a/configure.ac b/configure.ac
+index c443fa3..1e54c54 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -494,6 +494,62 @@ else
+ 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 The directories with content.
+
+ dnl Documentation.
+diff --git a/lib/error.h b/lib/error.h
+new file mode 100644
+index 0000000..ef06827
+--- /dev/null
++++ b/lib/error.h
+@@ -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 --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
+index dac2a5f..43016fc 100644
+--- a/lib/fixedsizehash.h
++++ b/lib/fixedsizehash.h
+@@ -30,7 +30,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+
+ #include <system.h>
+
+diff --git a/libdw/Makefile.am b/libdw/Makefile.am
+index 7a3d532..646fbd0 100644
+--- a/libdw/Makefile.am
++++ b/libdw/Makefile.am
+@@ -108,7 +108,7 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+ libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
+ libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(zip_LIBS)
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
+ # The rpath is necessary for libebl because its $ORIGIN use will
+diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c
+index 7bcf61c..ff25ebb 100644
+--- a/libdwfl/dwfl_error.c
++++ b/libdwfl/dwfl_error.c
+@@ -154,7 +154,16 @@ dwfl_errmsg (int error)
+ 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 --git a/libelf/elf.h b/libelf/elf.h
+index 01648bd..9ab66f1 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -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 --git a/src/Makefile.am b/src/Makefile.am
+index 69ac4db..9ab822e 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -68,23 +68,23 @@ ranlib_no_Wstack_usage = yes
+ 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) $(libdw) $(libeu) $(argp_LDADD) -ldl
+-elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
+-findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+-addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
+-elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
++size_LDADD = $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
++strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) -ldl
++elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) -ldl
++findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
++addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(demanglelib)
++elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_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)
+-elfclassify_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD)
++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)
++elfclassify_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
+
+ installcheck-binPROGRAMS: $(bin_PROGRAMS)
+ bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
+diff --git a/src/arlib.h b/src/arlib.h
+index e117166..c66a5c9 100644
+--- a/src/arlib.h
++++ b/src/arlib.h
+@@ -29,6 +29,16 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+
++#if !defined(ACCESSPERMS)
++# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
++#endif
++#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 --git a/src/elfcompress.c b/src/elfcompress.c
+index 6ba6af4..f7d032b 100644
+--- a/src/elfcompress.c
++++ b/src/elfcompress.c
+@@ -37,6 +37,14 @@
+ #include "libeu.h"
+ #include "printversion.h"
+
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH 0
++#endif
++
++#if !defined(ALLPERMS)
++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
++#endif
++
+ /* Name and version of program. */
+ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+
+diff --git a/src/error.h b/src/error.h
+new file mode 100644
+index 0000000..ef06827
+--- /dev/null
++++ b/src/error.h
+@@ -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 --git a/src/readelf.c b/src/readelf.c
+index 2084fb1..af72bce 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -4813,10 +4813,11 @@ listptr_base (struct listptr *p)
+ return cudie_base (&cu);
+ }
+
++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;
+
+@@ -4832,21 +4833,21 @@ compare_listptr (const void *a, const void *b, void *arg)
+ 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);
+ }
+ if (p1->attr != p2 ->attr)
+ {
+@@ -4854,7 +4855,7 @@ compare_listptr (const void *a, const void *b, void *arg)
+ error (0, 0,
+ gettext ("%s %#" PRIx64
+ " used with different attribute %s and %s"),
+- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
++ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
+ dwarf_attr_name (p2->attr));
+ }
+ }
+@@ -4925,9 +4926,11 @@ notice_listptr (enum section_e section, struct listptr_table *table,
+ 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 --git a/src/strip.c b/src/strip.c
+index 48792a7..d2f0c60 100644
+--- a/src/strip.c
++++ b/src/strip.c
+@@ -46,6 +46,14 @@
+ #include <system.h>
+ #include <printversion.h>
+
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH 0
++#endif
++
++#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/src/unstrip.c b/src/unstrip.c
+index fc87832..aab7caf 100644
+--- a/src/unstrip.c
++++ b/src/unstrip.c
+@@ -56,6 +56,15 @@
+ # define _(str) gettext (str)
+ #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
++
+ /* Name and version of program. */
+ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+
+--
+2.23.0
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/musl:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
@ 2020-09-07 14:20 Jory Pratt
0 siblings, 0 replies; 6+ messages in thread
From: Jory Pratt @ 2020-09-07 14:20 UTC (permalink / raw
To: gentoo-commits
commit: f94fed4c98ad99c6c064929872ec4cf2766b1efb
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 7 14:18:52 2020 +0000
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Mon Sep 7 14:18:52 2020 +0000
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=f94fed4c
dev-libs/elfutils: Sync with ::gentoo
Closes: https://github.com/gentoo/musl/issues/340
Package-Manager: Portage-3.0.5, Repoman-3.0.1
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
dev-libs/elfutils/Manifest | 4 +-
dev-libs/elfutils/elfutils-0.176-r1.ebuild | 80 ----
dev-libs/elfutils/elfutils-0.177.ebuild | 80 ----
...elfutils-0.178.ebuild => elfutils-0.180.ebuild} | 55 ++-
.../elfutils/files/elfutils-0.173-reorder.patch | 37 --
.../files/elfutils-0.176-dwarf_fregs.patch | 36 --
.../files/elfutils-0.176-portability-fixes.patch | 415 --------------------
.../files/elfutils-0.177-portability-fixes.patch | 416 ---------------------
.../files/elfutils-0.179-CC-in-tests.patch | 45 +++
...port.patch => elfutils-0.180-PaX-support.patch} | 10 +-
.../elfutils/files/elfutils-0.180-readelf.patch | 23 ++
11 files changed, 111 insertions(+), 1090 deletions(-)
diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest
index 0e02e5c..f8c5896 100644
--- a/dev-libs/elfutils/Manifest
+++ b/dev-libs/elfutils/Manifest
@@ -1,3 +1 @@
-DIST elfutils-0.176.tar.bz2 8646075 BLAKE2B 7f23d59b7f5d74946fea928a7fada7764c1f96a5eefefc4a3a382090eb7cad07c80419218300d853ccbef8f4e2288eb443ff06b3e64bf4511d9fa7aa84f5b794 SHA512 7f032913be363a43229ded85d495dcf7542b3c85974aaaba0d984228dc9ac1721da3dc388d3fa02325a80940161db7e9ad2c9e4521a424ad8a7d050c0902915b
-DIST elfutils-0.177.tar.bz2 8852413 BLAKE2B 03f432342651f7646d73b7847325bd14b722ce34d85df01b1ad072b916af9b9da2d0d119cd24e952073bd584ec76b027ba9b6c7d45fb057372b3e700b1f5741a SHA512 2779987463a22ed220759e25a09c9a1eb84c0f36db37675136e59aa55c7f8f90b7a7d34ffc4e6a4291d7fa73692a1bd1a303a74270b11d1623b4f9868d19498f
-DIST elfutils-0.178.tar.bz2 9007557 BLAKE2B 241b611dbfac37f35a670fbe80096c21b870e4b26fcddc8af26fba0373c9cd72eae42aabae2803b7b16c3bf649aeda036b1ea1b40952b43c4021ed23fcb51e80 SHA512 356656ad0db8f6877b461de1a11280de16a9cc5d8dde4381a938a212e828e32755135e5e3171d311c4c9297b728fbd98123048e2e8fbf7fe7de68976a2daabe5
+DIST elfutils-0.180.tar.bz2 9079640 BLAKE2B bd7863b82a71d2932a23c9d125d5eb6485977a3256a8a0b25980183d33f7345c3d9fae78277de5c955eb0ceeb955f8fa71d209f4f39bcf6dd49e46a8bbd7efcf SHA512 62e96035ccfe8928baca2285decbe8b8703a2daa956df81ece18fecf643272fb68955806b3e807a514141a7a9bf44520bf09461672aa580bd6807485fb604d25
diff --git a/dev-libs/elfutils/elfutils-0.176-r1.ebuild b/dev-libs/elfutils/elfutils-0.176-r1.ebuild
deleted file mode 100644
index b057018..0000000
--- a/dev-libs/elfutils/elfutils-0.176-r1.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic multilib-minimal
-
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
-HOMEPAGE="http://elfutils.org/"
-SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
-
-LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 x86"
-IUSE="bzip2 lzma nls static-libs test +threads +utils"
-RESTRICT="!test? ( test )"
-
-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
- elibc_musl? (
- sys-libs/argp-standalone
- sys-libs/fts-standalone
- sys-libs/obstack-standalone
- )"
-DEPEND="${RDEPEND}
- nls? ( sys-devel/gettext )
- >=sys-devel/flex-2.5.4a"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-0.118-PaX-support.patch
- "${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
- "${FILESDIR}"/${PN}-0.173-reorder.patch
- "${FILESDIR}"/${PN}-0.176-portability-fixes.patch
- "${FILESDIR}"/${PN}-0.176-dwarf_fregs.patch
-)
-
-src_prepare() {
- default
-
- eautoreconf
-
- if ! use static-libs; then
- sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
- fi
- # https://sourceware.org/PR23914
- sed -i 's:-Werror::' */Makefile.in || die
-}
-
-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 \
- $(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 VERBOSE=1
-}
-
-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.
- if ! use utils; then
- rm -rf "${ED}"/usr/bin || die
- fi
-}
diff --git a/dev-libs/elfutils/elfutils-0.177.ebuild b/dev-libs/elfutils/elfutils-0.177.ebuild
deleted file mode 100644
index e5e911f..0000000
--- a/dev-libs/elfutils/elfutils-0.177.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic multilib-minimal
-
-DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
-HOMEPAGE="http://elfutils.org/"
-SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
-
-LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~mips ppc x86"
-IUSE="bzip2 lzma nls static-libs test +threads +utils"
-RESTRICT="!test? ( test )"
-
-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
- elibc_musl? (
- sys-libs/argp-standalone
- sys-libs/fts-standalone
- sys-libs/obstack-standalone
- )"
-DEPEND="${RDEPEND}
- nls? ( sys-devel/gettext )
- >=sys-devel/flex-2.5.4a"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-0.118-PaX-support.patch
- "${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
- "${FILESDIR}"/${PN}-0.176-dwarf_fregs.patch
- "${FILESDIR}"/${PN}-0.177-disable-large.patch
- "${FILESDIR}"/${PN}-0.177-portability-fixes.patch
-)
-
-src_prepare() {
- default
-
- eautoreconf
-
- if ! use static-libs; then
- sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
- fi
- # https://sourceware.org/PR23914
- sed -i 's:-Werror::' */Makefile.in || die
-}
-
-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 \
- $(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 VERBOSE=1
-}
-
-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.
- if ! use utils; then
- rm -rf "${ED}"/usr/bin || die
- fi
-}
diff --git a/dev-libs/elfutils/elfutils-0.178.ebuild b/dev-libs/elfutils/elfutils-0.180.ebuild
similarity index 58%
rename from dev-libs/elfutils/elfutils-0.178.ebuild
rename to dev-libs/elfutils/elfutils-0.180.ebuild
index 5de6511..a4da76a 100644
--- a/dev-libs/elfutils/elfutils-0.178.ebuild
+++ b/dev-libs/elfutils/elfutils-0.180.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 2003-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-inherit autotools flag-o-matic multilib-minimal
+inherit autotools flag-o-matic multilib-minimal toolchain-funcs
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
HOMEPAGE="http://elfutils.org/"
@@ -11,12 +11,12 @@ SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86"
+KEYWORDS="~alpha amd64 arm arm64 ~mips ppc ppc64"
IUSE="bzip2 lzma nls static-libs test +threads +utils valgrind"
-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}] )
+RDEPEND=">=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
+ bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1[static-libs?,${MULTILIB_USEDEP}] )
elibc_musl? (
sys-libs/argp-standalone
sys-libs/fts-standalone
@@ -28,24 +28,27 @@ DEPEND="${RDEPEND}
"
BDEPEND="nls? ( sys-devel/gettext )
>=sys-devel/flex-2.5.4a
- sys-devel/m4
- elibc_musl? ( dev-libs/libbsd )"
+ sys-devel/m4"
RESTRICT="!test? ( test )"
PATCHES=(
- "${FILESDIR}"/${PN}-0.118-PaX-support.patch
"${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
"${FILESDIR}"/${PN}-0.177-disable-large.patch
- "${FILESDIR}"/${PV}/fix-aarch64_fregs.patch
- "${FILESDIR}"/${PV}/musl-asm_ptrace_h.patch
- "${FILESDIR}"/${PV}/musl-cdefs.patch
- "${FILESDIR}"/${PV}/musl-macros.patch
- "${FILESDIR}"/${PV}/musl-fts-obstack.patch
- "${FILESDIR}"/${PV}/musl-qsort_r.patch
- "${FILESDIR}"/${PV}/musl-strerror_r.patch
- "${FILESDIR}"/${PV}/musl-strndupa.patch
- "${FILESDIR}"/${PV}/musl-error_h.patch
+ "${FILESDIR}"/${PN}-0.180-PaX-support.patch
+ "${FILESDIR}"/${PN}-0.179-CC-in-tests.patch
+ "${FILESDIR}"/${PN}-0.180-readelf.patch
+
+ # Musl Patches
+ "${FILESDIR}"/0.178/fix-aarch64_fregs.patch
+ "${FILESDIR}"/0.178/musl-asm_ptrace_h.patch
+ "${FILESDIR}"/0.178/musl-cdefs.patch
+ "${FILESDIR}"/0.178/musl-macros.patch
+ "${FILESDIR}"/0.178/musl-fts-obstack.patch
+ "${FILESDIR}"/0.178/musl-qsort_r.patch
+ "${FILESDIR}"/0.178/musl-strerror_r.patch
+ "${FILESDIR}"/0.178/musl-strndupa.patch
+ "${FILESDIR}"/0.178/musl-error_h.patch
)
src_prepare() {
@@ -58,10 +61,24 @@ src_prepare() {
fi
# https://sourceware.org/PR23914
sed -i 's:-Werror::' */Makefile.in || die
+
+ if use elibc_musl; then
+ cat > lib/libintl.h <<-EOF
+ #ifndef LIBINTL_H
+ #define LIBINTL_H
+ #define _(x) (x)
+ #endif
+ EOF
+ fi
}
src_configure() {
use test && append-flags -g #407135
+
+ # Symbol aliases are implemented as asm statements.
+ # Will require porting: https://gcc.gnu.org/PR48200
+ filter-flags '-flto*'
+
multilib-minimal_src_configure
}
@@ -78,8 +95,10 @@ multilib_src_configure() {
}
multilib_src_test() {
+ # CC is a workaround for tests using ${CC-gcc}
env LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm" \
LC_ALL="C" \
+ CC="$(tc-getCC)" \
emake check VERBOSE=1
}
diff --git a/dev-libs/elfutils/files/elfutils-0.173-reorder.patch b/dev-libs/elfutils/files/elfutils-0.173-reorder.patch
deleted file mode 100644
index fd3dede..0000000
--- a/dev-libs/elfutils/files/elfutils-0.173-reorder.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-https://bugs.gentoo.org/666954
-https://github.com/rpm-software-management/rpm/issues/423
-https://sourceware.org/ml/elfutils-devel/2019-q2/msg00077.html
-
-From: Mark Wielaard <mark at klomp dot org>
-Subject: [PATCH] libelf: Mark shdr_flags dirty if offset or size changes during update.
-Date: Mon, 13 May 2019 00:13:42 +0200
-Message-Id: <20190512221342.23383-1-mark@klomp.org>
-
-We forgot to mark the shdr_flags dirty when only the sh_size or
-sh_offset changed during elf_update (). This meant that if there were
-no other shdr changes we only wrote out the section data, but didn't
-write out the shdr table to the file.
-
-Signed-off-by: Mark Wielaard <mark@klomp.org>
----
- libelf/elf32_updatenull.c | 5 +-
-
---- a/libelf/elf32_updatenull.c
-+++ b/libelf/elf32_updatenull.c
-@@ -366,12 +366,15 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
- }
-
- /* See whether the section size is correct. */
-+ int size_changed = 0;
- update_if_changed (shdr->sh_size, (GElf_Word) offset,
-- changed);
-+ size_changed);
-+ changed |= size_changed;
-
- if (shdr->sh_type != SHT_NOBITS)
- size += offset;
-
-+ scn->shdr_flags |= (offset_changed | size_changed);
- scn->flags |= changed;
- }
-
diff --git a/dev-libs/elfutils/files/elfutils-0.176-dwarf_fregs.patch b/dev-libs/elfutils/files/elfutils-0.176-dwarf_fregs.patch
deleted file mode 100644
index 3a4204c..0000000
--- a/dev-libs/elfutils/files/elfutils-0.176-dwarf_fregs.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/backends/aarch64_initreg.c b/backends/aarch64_initreg.c
-index daf6f37..6445276 100644
---- a/backends/aarch64_initreg.c
-+++ b/backends/aarch64_initreg.c
-@@ -33,7 +33,7 @@
- #include "system.h"
- #include <assert.h>
- #if defined(__aarch64__) && defined(__linux__)
--# include <linux/uio.h>
-+# include <sys/uio.h>
- # include <sys/user.h>
- # include <sys/ptrace.h>
- /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
-@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
-
- Dwarf_Word dwarf_fregs[32];
- for (int r = 0; r < 32; r++)
-- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
-+ dwarf_fregs[r] = (unsigned int)fregs.vregs[r] & 0xFFFFFFFF;
-
- if (! setfunc (64, 32, dwarf_fregs, arg))
- return false;
-diff --git a/backends/arm_initreg.c b/backends/arm_initreg.c
-index efcabaf..062bb9e 100644
---- a/backends/arm_initreg.c
-+++ b/backends/arm_initreg.c
-@@ -38,7 +38,7 @@
- #endif
-
- #ifdef __aarch64__
--# include <linux/uio.h>
-+# include <sys/uio.h>
- # include <sys/user.h>
- # include <sys/ptrace.h>
- /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
-
\ No newline at end of file
diff --git a/dev-libs/elfutils/files/elfutils-0.176-portability-fixes.patch b/dev-libs/elfutils/files/elfutils-0.176-portability-fixes.patch
deleted file mode 100644
index 9aecf57..0000000
--- a/dev-libs/elfutils/files/elfutils-0.176-portability-fixes.patch
+++ /dev/null
@@ -1,415 +0,0 @@
-From de94a67137e483db97efd40e7d13f0148e43e95c Mon Sep 17 00:00:00 2001
-From:
-Date: Thu, 11 Apr 2019 22:58:38 -0500
-Subject: [PATCH] portability fixes
-
-Voidlinux fixes combined and modified for use in gentoo.
----
- configure.ac | 56 ++++++++++++++++++++++++++++++++++++++++++++
- lib/error.h | 27 +++++++++++++++++++++
- lib/fixedsizehash.h | 1 -
- libdw/Makefile.am | 2 +-
- libdwfl/dwfl_error.c | 9 +++++++
- libelf/elf.h | 11 +++++++++
- src/Makefile.am | 28 +++++++++++-----------
- src/arlib.h | 10 ++++++++
- src/elfcompress.c | 8 +++++++
- src/error.h | 27 +++++++++++++++++++++
- src/readelf.c | 21 ++++++++++-------
- src/strip.c | 8 +++++++
- src/unstrip.c | 9 +++++++
- 13 files changed, 192 insertions(+), 25 deletions(-)
- create mode 100644 lib/error.h
- create mode 100644 src/error.h
-
-diff --git a/configure.ac b/configure.ac
-index b4e012d..27e6152 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -494,6 +494,62 @@ else
- 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 The directories with content.
-
- dnl Documentation.
-diff --git a/lib/error.h b/lib/error.h
-new file mode 100644
-index 0000000..ef06827
---- /dev/null
-+++ b/lib/error.h
-@@ -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 --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
-index dac2a5f..43016fc 100644
---- a/lib/fixedsizehash.h
-+++ b/lib/fixedsizehash.h
-@@ -30,7 +30,6 @@
- #include <errno.h>
- #include <stdlib.h>
- #include <string.h>
--#include <sys/cdefs.h>
-
- #include <system.h>
-
-diff --git a/libdw/Makefile.am b/libdw/Makefile.am
-index 7a3d532..646fbd0 100644
---- a/libdw/Makefile.am
-+++ b/libdw/Makefile.am
-@@ -108,7 +108,7 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
- libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
- ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
- libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
--libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
-+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(zip_LIBS)
- libdw_so_SOURCES =
- libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
- # The rpath is necessary for libebl because its $ORIGIN use will
-diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c
-index 7bcf61c..ff25ebb 100644
---- a/libdwfl/dwfl_error.c
-+++ b/libdwfl/dwfl_error.c
-@@ -154,7 +154,16 @@ dwfl_errmsg (int error)
- 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 --git a/libelf/elf.h b/libelf/elf.h
-index 75043bc..da1598a 100644
---- a/libelf/elf.h
-+++ b/libelf/elf.h
-@@ -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 --git a/src/Makefile.am b/src/Makefile.am
-index 2b1c0dc..ad05977 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -67,22 +67,22 @@ ranlib_no_Wstack_usage = yes
- 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) $(libdw) $(libeu) $(argp_LDADD) -ldl
--elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
--findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
--addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
--elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
-+size_LDADD = $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
-+strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) -ldl
-+elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) -ldl
-+findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
-+addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(demanglelib)
-+elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_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)
-+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)
-
- installcheck-binPROGRAMS: $(bin_PROGRAMS)
- bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
-diff --git a/src/arlib.h b/src/arlib.h
-index e117166..c66a5c9 100644
---- a/src/arlib.h
-+++ b/src/arlib.h
-@@ -29,6 +29,16 @@
- #include <stdint.h>
- #include <sys/types.h>
-
-+#if !defined(ACCESSPERMS)
-+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
-+#endif
-+#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 --git a/src/elfcompress.c b/src/elfcompress.c
-index 6ba6af4..f7d032b 100644
---- a/src/elfcompress.c
-+++ b/src/elfcompress.c
-@@ -37,6 +37,14 @@
- #include "libeu.h"
- #include "printversion.h"
-
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH 0
-+#endif
-+
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
-+#endif
-+
- /* Name and version of program. */
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
-
-diff --git a/src/error.h b/src/error.h
-new file mode 100644
-index 0000000..ef06827
---- /dev/null
-+++ b/src/error.h
-@@ -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 --git a/src/readelf.c b/src/readelf.c
-index 33706bd..da6624b 100644
---- a/src/readelf.c
-+++ b/src/readelf.c
-@@ -4792,10 +4792,11 @@ listptr_base (struct listptr *p)
- return cudie_base (&cu);
- }
-
-+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;
-
-@@ -4811,21 +4812,21 @@ compare_listptr (const void *a, const void *b, void *arg)
- 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);
- }
- if (p1->attr != p2 ->attr)
- {
-@@ -4833,7 +4834,7 @@ compare_listptr (const void *a, const void *b, void *arg)
- error (0, 0,
- gettext ("%s %#" PRIx64
- " used with different attribute %s and %s"),
-- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
-+ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
- dwarf_attr_name (p2->attr));
- }
- }
-@@ -4904,9 +4905,11 @@ notice_listptr (enum section_e section, struct listptr_table *table,
- 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 --git a/src/strip.c b/src/strip.c
-index a73009d..c6ed590 100644
---- a/src/strip.c
-+++ b/src/strip.c
-@@ -46,6 +46,14 @@
- #include <system.h>
- #include <printversion.h>
-
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH 0
-+#endif
-+
-+#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/src/unstrip.c b/src/unstrip.c
-index 3495b1d..0754717 100644
---- a/src/unstrip.c
-+++ b/src/unstrip.c
-@@ -56,6 +56,15 @@
- # define _(str) gettext (str)
- #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
-+
- /* Name and version of program. */
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
-
---
-2.21.0
-
diff --git a/dev-libs/elfutils/files/elfutils-0.177-portability-fixes.patch b/dev-libs/elfutils/files/elfutils-0.177-portability-fixes.patch
deleted file mode 100644
index e903c62..0000000
--- a/dev-libs/elfutils/files/elfutils-0.177-portability-fixes.patch
+++ /dev/null
@@ -1,416 +0,0 @@
-From 5da3662ec16c0df64bbf8ffcf7e1d09c0782714c Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Wed, 21 Aug 2019 17:02:59 -0500
-Subject: [PATCH] Portability fixes for musl
-
----
- configure.ac | 56 ++++++++++++++++++++++++++++++++++++++++++++
- lib/error.h | 27 +++++++++++++++++++++
- lib/fixedsizehash.h | 1 -
- libdw/Makefile.am | 2 +-
- libdwfl/dwfl_error.c | 9 +++++++
- libelf/elf.h | 11 +++++++++
- src/Makefile.am | 30 ++++++++++++------------
- src/arlib.h | 10 ++++++++
- src/elfcompress.c | 8 +++++++
- src/error.h | 27 +++++++++++++++++++++
- src/readelf.c | 21 ++++++++++-------
- src/strip.c | 8 +++++++
- src/unstrip.c | 9 +++++++
- 13 files changed, 193 insertions(+), 26 deletions(-)
- create mode 100644 lib/error.h
- create mode 100644 src/error.h
-
-diff --git a/configure.ac b/configure.ac
-index c443fa3..1e54c54 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -494,6 +494,62 @@ else
- 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 The directories with content.
-
- dnl Documentation.
-diff --git a/lib/error.h b/lib/error.h
-new file mode 100644
-index 0000000..ef06827
---- /dev/null
-+++ b/lib/error.h
-@@ -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 --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
-index dac2a5f..43016fc 100644
---- a/lib/fixedsizehash.h
-+++ b/lib/fixedsizehash.h
-@@ -30,7 +30,6 @@
- #include <errno.h>
- #include <stdlib.h>
- #include <string.h>
--#include <sys/cdefs.h>
-
- #include <system.h>
-
-diff --git a/libdw/Makefile.am b/libdw/Makefile.am
-index 7a3d532..646fbd0 100644
---- a/libdw/Makefile.am
-+++ b/libdw/Makefile.am
-@@ -108,7 +108,7 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
- libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
- ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
- libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
--libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
-+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(zip_LIBS)
- libdw_so_SOURCES =
- libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
- # The rpath is necessary for libebl because its $ORIGIN use will
-diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c
-index 7bcf61c..ff25ebb 100644
---- a/libdwfl/dwfl_error.c
-+++ b/libdwfl/dwfl_error.c
-@@ -154,7 +154,16 @@ dwfl_errmsg (int error)
- 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 --git a/libelf/elf.h b/libelf/elf.h
-index 01648bd..9ab66f1 100644
---- a/libelf/elf.h
-+++ b/libelf/elf.h
-@@ -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 --git a/src/Makefile.am b/src/Makefile.am
-index 69ac4db..9ab822e 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -68,23 +68,23 @@ ranlib_no_Wstack_usage = yes
- 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) $(libdw) $(libeu) $(argp_LDADD) -ldl
--elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
--findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
--addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
--elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
-+size_LDADD = $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
-+strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) -ldl
-+elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) -ldl
-+findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
-+addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(demanglelib)
-+elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_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)
--elfclassify_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD)
-+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)
-+elfclassify_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD)
-
- installcheck-binPROGRAMS: $(bin_PROGRAMS)
- bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
-diff --git a/src/arlib.h b/src/arlib.h
-index e117166..c66a5c9 100644
---- a/src/arlib.h
-+++ b/src/arlib.h
-@@ -29,6 +29,16 @@
- #include <stdint.h>
- #include <sys/types.h>
-
-+#if !defined(ACCESSPERMS)
-+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
-+#endif
-+#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 --git a/src/elfcompress.c b/src/elfcompress.c
-index 6ba6af4..f7d032b 100644
---- a/src/elfcompress.c
-+++ b/src/elfcompress.c
-@@ -37,6 +37,14 @@
- #include "libeu.h"
- #include "printversion.h"
-
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH 0
-+#endif
-+
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
-+#endif
-+
- /* Name and version of program. */
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
-
-diff --git a/src/error.h b/src/error.h
-new file mode 100644
-index 0000000..ef06827
---- /dev/null
-+++ b/src/error.h
-@@ -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 --git a/src/readelf.c b/src/readelf.c
-index 2084fb1..af72bce 100644
---- a/src/readelf.c
-+++ b/src/readelf.c
-@@ -4813,10 +4813,11 @@ listptr_base (struct listptr *p)
- return cudie_base (&cu);
- }
-
-+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;
-
-@@ -4832,21 +4833,21 @@ compare_listptr (const void *a, const void *b, void *arg)
- 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);
- }
- if (p1->attr != p2 ->attr)
- {
-@@ -4854,7 +4855,7 @@ compare_listptr (const void *a, const void *b, void *arg)
- error (0, 0,
- gettext ("%s %#" PRIx64
- " used with different attribute %s and %s"),
-- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
-+ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
- dwarf_attr_name (p2->attr));
- }
- }
-@@ -4925,9 +4926,11 @@ notice_listptr (enum section_e section, struct listptr_table *table,
- 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 --git a/src/strip.c b/src/strip.c
-index 48792a7..d2f0c60 100644
---- a/src/strip.c
-+++ b/src/strip.c
-@@ -46,6 +46,14 @@
- #include <system.h>
- #include <printversion.h>
-
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH 0
-+#endif
-+
-+#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/src/unstrip.c b/src/unstrip.c
-index fc87832..aab7caf 100644
---- a/src/unstrip.c
-+++ b/src/unstrip.c
-@@ -56,6 +56,15 @@
- # define _(str) gettext (str)
- #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
-+
- /* Name and version of program. */
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
-
---
-2.23.0
-
diff --git a/dev-libs/elfutils/files/elfutils-0.179-CC-in-tests.patch b/dev-libs/elfutils/files/elfutils-0.179-CC-in-tests.patch
new file mode 100644
index 0000000..aa58862
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.179-CC-in-tests.patch
@@ -0,0 +1,45 @@
+https://bugs.gentoo.org/718872
+--- a/tests/run-disasm-x86-64.sh
++++ b/tests/run-disasm-x86-64.sh
+@@ -22,7 +22,7 @@ case "`uname -m`" in
+ x86_64)
+ tempfiles testfile45.o
+ testfiles testfile45.S testfile45.expect
+- gcc -m64 -c -o testfile45.o testfile45.S
++ ${CC-gcc} -m64 -c -o testfile45.o testfile45.S
+ testrun_compare ${abs_top_builddir}/src/objdump -d testfile45.o < testfile45.expect
+ ;;
+ esac
+--- a/tests/run-disasm-x86.sh
++++ b/tests/run-disasm-x86.sh
+@@ -22,7 +22,7 @@ case "`uname -m`" in
+ x86_64 | i?86 )
+ tempfiles testfile44.o
+ testfiles testfile44.S testfile44.expect
+- gcc -m32 -c -o testfile44.o testfile44.S
++ ${CC-gcc} -m32 -c -o testfile44.o testfile44.S
+ testrun_compare ${abs_top_builddir}/src/objdump -d testfile44.o < testfile44.expect
+ ;;
+ esac
+--- a/tests/run-strip-g.sh
++++ b/tests/run-strip-g.sh
+@@ -25,7 +25,7 @@
+ tempfiles a.out strip.out debug.out readelf.out
+
+ echo Create debug a.out.
+-echo "int main() { return 1; }" | gcc -g -xc -
++echo "int main() { return 1; }" | ${CC-gcc} -g -xc -
+
+ echo strip -g to file with debug file
+ testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out ||
+--- a/tests/run-strip-nothing.sh
++++ b/tests/run-strip-nothing.sh
+@@ -23,7 +23,7 @@
+ tempfiles a.out strip.out debug.out
+
+ # Create no-debug a.out.
+-echo "int main() { return 1; }" | gcc -s -xc -
++echo "int main() { return 1; }" | ${CC-gcc} -s -xc -
+
+ # strip to file
+ testrun ${abs_top_builddir}/src/strip -g -o strip.out ||
diff --git a/dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch b/dev-libs/elfutils/files/elfutils-0.180-PaX-support.patch
similarity index 71%
rename from dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch
rename to dev-libs/elfutils/files/elfutils-0.180-PaX-support.patch
index 0ae359f..2d44c75 100644
--- a/dev-libs/elfutils/files/elfutils-0.118-PaX-support.patch
+++ b/dev-libs/elfutils/files/elfutils-0.180-PaX-support.patch
@@ -6,21 +6,21 @@ http://bugs.gentoo.org/115100
--- a/libelf/elf.h
+++ b/libelf/elf.h
-@@ -568,6 +568,7 @@
- #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
+@@ -722,6 +722,7 @@ typedef struct
#define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
-+#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
+ #define PT_GNU_PROPERTY 0x6474e553 /* GNU property */
++#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
#define PT_LOSUNW 0x6ffffffa
#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
--- a/src/elflint.c
+++ b/src/elflint.c
-@@ -3187,6 +3187,7 @@
+@@ -4493,6 +4493,7 @@ only executables, shared objects, and core files can have program headers\n"));
if (phdr->p_type >= PT_NUM && phdr->p_type != PT_GNU_EH_FRAME
&& phdr->p_type != PT_GNU_STACK && phdr->p_type != PT_GNU_RELRO
+ && phdr->p_type != PT_PAX_FLAGS
+ && phdr->p_type != PT_GNU_PROPERTY
/* Check for a known machine-specific type. */
&& ebl_segment_type_name (ebl, phdr->p_type, NULL, 0) == NULL)
- ERROR (gettext ("\
diff --git a/dev-libs/elfutils/files/elfutils-0.180-readelf.patch b/dev-libs/elfutils/files/elfutils-0.180-readelf.patch
new file mode 100644
index 0000000..a347d03
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.180-readelf.patch
@@ -0,0 +1,23 @@
+Use tool-prefixed readelf.
+--- a/configure.ac
++++ b/configure.ac
+@@ -200,7 +200,7 @@ fi
+ # We really want build-ids. Warn and force generating them if gcc was
+ # configure without --enable-linker-build-id
+ AC_CACHE_CHECK([whether the compiler generates build-ids], ac_cv_buildid, [dnl
+-AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; readelf -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))])
++AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))])
+ if test "$ac_cv_buildid" = "no"; then
+ AC_MSG_WARN([compiler doesn't generate build-id by default])
+ LDFLAGS="$LDFLAGS -Wl,--build-id"
+--- a/configure
++++ b/configure
+@@ -5343,7 +5343,7 @@ main ()
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- ac_cv_buildid=yes; readelf -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no
++ ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-09-07 14:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-21 22:42 [gentoo-commits] proj/musl:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/ Jory Pratt
-- strict thread matches above, loose matches on Subject: below --
2020-09-07 14:20 Jory Pratt
2019-04-12 4:14 Jory Pratt
2018-06-11 17:24 Aric Belsito
2017-08-08 20:09 Aric Belsito
2017-01-21 20:08 Aric Belsito
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox