summaryrefslogtreecommitdiff
path: root/dev-libs/elfutils
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-11-13 13:10:00 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-11-13 13:10:00 +0000
commite9d044d4b9b71200a96adfa280848858c0f468c9 (patch)
tree1bd8ef816043a8cd340f1d774e79553a1a7d31d8 /dev-libs/elfutils
parentfc2f1018fc323ef2c6572734a9b130427cba76a6 (diff)
gentoo resync : 13.11.2021
Diffstat (limited to 'dev-libs/elfutils')
-rw-r--r--dev-libs/elfutils/Manifest9
-rw-r--r--dev-libs/elfutils/elfutils-0.185.ebuild10
-rw-r--r--dev-libs/elfutils/elfutils-0.186.ebuild104
-rw-r--r--dev-libs/elfutils/files/musl/elfutils-0.185-aarch64-regs.patch57
-rw-r--r--dev-libs/elfutils/files/musl/elfutils-0.185-cdefs.patch20
-rw-r--r--dev-libs/elfutils/files/musl/elfutils-0.185-error-h.patch68
-rw-r--r--dev-libs/elfutils/files/musl/elfutils-0.185-macros.patch86
-rw-r--r--dev-libs/elfutils/files/musl/elfutils-0.185-strndupa.patch22
8 files changed, 375 insertions, 1 deletions
diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest
index 52afecc81b74..7c688d7bd3cd 100644
--- a/dev-libs/elfutils/Manifest
+++ b/dev-libs/elfutils/Manifest
@@ -5,6 +5,13 @@ AUX elfutils-0.185-configure.ac-rework-gnu99-ext-check-to-allow-clang.patch 4731
AUX elfutils-0.185-glibc-2.34-test-failure.patch 4265 BLAKE2B 28609f381927f23c8401389b676b1f439be2498ea5bdef17bc64df03fd320b7d1010551ddbf6f0543aae0048344343765135f2fd7dbe180070911b42ccf87e08 SHA512 87fef4211f5005753e051e426e7d6af49f71294a54db3ba044774686e822c4849d99ea46d58e70f8eaf189bff7275a479cca44d1e85698e9a89d8048cee96d05
AUX elfutils-0.185-pull-advance_pc-in-file-scope.patch 2620 BLAKE2B cfa868cd11ede0bb04e401da099e64f6d5134e7b31aa9f27c7ed89ea22eeaaaee1f55d2e58cd6e08f8ba761939fe33b28cb5cc5d962318a56e4b9ff6310bd34d SHA512 db7e2cb5ecd0f4236256f2001b8c9610ce4269dd01cee8d17276fa4e3394265f0bb1e85b1feab79299b899a08be581e3ac12f638bbc21ae14c44785cde3a8751
AUX elfutils-0.185-static-inline.patch 361 BLAKE2B c480f9a4024922252c9917c5e69eb8b4c92c897f7ebb4284445a489b5b28c630ac28e337bff977f67c164abed688aa0ed0dc76a715f6270e1001a7a80d46799f SHA512 8ac89c40aa108b097f18deb82ec3267d987aa16473fb40105aa7f83465cbea4ac1538bf4fc84c957e61250f9b8b6ea1f5694dcd5b404902ce8b73f53eed3308a
+AUX musl/elfutils-0.185-aarch64-regs.patch 1865 BLAKE2B c177254f31b214d39dc18a9591fca672537475bc8318b3dac6fecea11659f75e89c9c1eaa61b605bce5802ab910fe542645d214c825a28182b26d8d7620208bd SHA512 1eb5975bed830dc83e9375f526176276a5254dd9351853dc4c2c4be66246ea74bb65ae5352ea9f3d7fdf70f8af2b9d953e921dbce7cf94a906cd22272db6adab
+AUX musl/elfutils-0.185-cdefs.patch 394 BLAKE2B 5c372ceb3f732ecab7468ef803079c82799c9c4ac562ecf5dcf5eced6c34e478c2b5dd64ad2e4c00a2082d3caff196eb51c26fc9547e116cee8abd6a8ebfa74f SHA512 12d8be301d9fce7461c87f206e56c7b475a2e7ab3577addd19531e57dc93f9d247bc38969c3e3e5c9bd1eacb371a89893b6ce590300a4194092f7565c1327e26
+AUX musl/elfutils-0.185-error-h.patch 1571 BLAKE2B 31a762bf02472a0e4383c7ce4500aecb8a524e4b78a829bc0eb4aaa999c251f32543ed8b1d3c4d378156fbbad4c99bfcfe5d8cab56cb6b9b64cdbeed6c9b8121 SHA512 32bace307afb9425259cfd202afb6d7e58f0608390901bdd0b8f3e78edda5f4dfe780de755db2caa25fae34eb20fc75a050ef265b947e77fb59697acc7a3eabf
+AUX musl/elfutils-0.185-macros.patch 2481 BLAKE2B a512990b0d3222ae27f62102bbeeb315bace2e2dc39b1d77b65b52076c8134be7ef198f8db2fa242f1b0907b284fe7848f3d8e6a343af1a40fffdd5232917f23 SHA512 5f4d3ab97f317719c25a1affe33fbdbb8a8f10a183b17dfaa75fbdd18824a308778e1a4b5d6dae8d6e20c75660f53b80b8f6ccf1d0c13aa2da568b15b26b72e3
+AUX musl/elfutils-0.185-strndupa.patch 802 BLAKE2B 36bbc78224903e12b612d29724619b9174f700c9beb9262704676d5a0f92fb8af5aac724e09fb804985948e112ba6abe92641f9d487dd161dded984911edde9c SHA512 0c57d62b295b1330b947d4bcb74b1e05fcc1b7976d1de24545b1bf832a84a14d95c43940fd243c8b764a4201369ed798f5abc11ddefe2e42944bb471cff4f625
DIST elfutils-0.185.tar.bz2 9187627 BLAKE2B 57cfa7e4060975c4bf6170dbd354687a19a92f7069c060db1ac2fa4da5a9d34e8bddd07c7ce376b5c28b5670ad5b8c1df795164cbcfb600a44cf1db60c20c4af SHA512 34de0de1355b11740e036e0fc64f2fc063587c8eb121b19216ee5548d3f0f268d8fc3995176c47190466b9d881007cfa11a9d01e9a50e38af6119492bf8bb47f
-EBUILD elfutils-0.185.ebuild 2618 BLAKE2B a5477901b1cec3446a91408f70ff4e88f0c2d2c1fcdb5e680c666dcce23d26f1c819e309add745eacd848ac4d8c23362b66977181fd05da3a9a3d87bdd5a445a SHA512 dc56958d6e58d73bf0705ecae7dcfbea2485554c596601377e0b50af55e12585603c87093752d44a9e2a1c6b17da7efd7d95cfd76e24f4824c4d677c9be6c24d
+DIST elfutils-0.186.tar.bz2 9230491 BLAKE2B 49573d0a1f3519eab81d1ba3e94354cbc0935a36a94a3fdb22fe223a47b78cca8fd6e322870b0e335a809529fa6f54180b13c67936dec0242123c54ba20c9fc9 SHA512 c9180b27ec62935f18b9431268d176f6023d1bb938731d2af6e7626ae460af6608a70ba68483aa1ec7e6cb0fa0528b661ca8b68bc4f58ea8e18af527c5950c78
+EBUILD elfutils-0.185.ebuild 2796 BLAKE2B 70244584923c98a3eb2ea4ef3f47a2998302284964bbaffdab84a5a4a26296ac539d06961bfc0c4b8fe284203022c83ab268ff8756a2f898d43bf87e318a359d SHA512 5f17e97b73d797f551aff5e51d1a85aa3dc033eb5e5e56200a7f25968541fa2e64ad43977e1c80b0a5b76904692db8608f73a9c00312a4f3c5298a6f1a852367
+EBUILD elfutils-0.186.ebuild 2775 BLAKE2B 31860c539c00a6e953de013b31322b26c790c81d08e55786bab9185ed1fe0b58711f5bec48dbab773dd7ca617a87e6cd572052771ba27c4f8677aebbacb0c868 SHA512 018d2bb38e93cf0c978de8ad8638b014d297f90dfb8d98f0d507f4a99ef13074d56d1ad182acdaf6331975d217aa8bf81fef3d09358dce65c2f938b51f3baed9
MISC metadata.xml 730 BLAKE2B 94e9585a2d765ee2a7c85a823c389453bcdbc29b90a5542333eef1253d4ebafb7c26e383dfe5c5e0fcccf61f60321e7a46b0ae8c5edf467937485d6c9867712a SHA512 663cb6d587113d21fc0d3c703731f4dcaed55fc1bc7e75e1ac465e21b161ba5c4b4cefe0fd838d28b1f890cc33008878996e1d117fcab6435f8ed49f7eb0bc73
diff --git a/dev-libs/elfutils/elfutils-0.185.ebuild b/dev-libs/elfutils/elfutils-0.185.ebuild
index a73fbfc04925..84df482f3f86 100644
--- a/dev-libs/elfutils/elfutils-0.185.ebuild
+++ b/dev-libs/elfutils/elfutils-0.185.ebuild
@@ -18,6 +18,12 @@ 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}] )
zstd? ( app-arch/zstd:=[static-libs?,${MULTILIB_USEDEP}] )
+ elibc_musl? (
+ dev-libs/libbsd
+ sys-libs/argp-standalone
+ sys-libs/fts-standalone
+ sys-libs/obstack-standalone
+ )
!dev-libs/libelf
"
DEPEND="${RDEPEND}
@@ -42,6 +48,10 @@ PATCHES=(
src_prepare() {
default
+ if use elibc_musl; then
+ eapply "${FILESDIR}"/musl/
+ fi
+
if ! use static-libs; then
sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
fi
diff --git a/dev-libs/elfutils/elfutils-0.186.ebuild b/dev-libs/elfutils/elfutils-0.186.ebuild
new file mode 100644
index 000000000000..d7c479481a35
--- /dev/null
+++ b/dev-libs/elfutils/elfutils-0.186.ebuild
@@ -0,0 +1,104 @@
+# Copyright 2003-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic multilib-minimal
+
+DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
+HOMEPAGE="https://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 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="bzip2 lzma nls static-libs test +threads +utils valgrind zstd"
+
+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}] )
+ zstd? ( app-arch/zstd:=[static-libs?,${MULTILIB_USEDEP}] )
+ elibc_musl? (
+ dev-libs/libbsd
+ sys-libs/argp-standalone
+ sys-libs/fts-standalone
+ sys-libs/obstack-standalone
+ )
+ !dev-libs/libelf
+"
+DEPEND="${RDEPEND}
+ valgrind? ( dev-util/valgrind )
+"
+BDEPEND="nls? ( sys-devel/gettext )
+ >=sys-devel/flex-2.5.4a
+ sys-devel/m4
+"
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
+ "${FILESDIR}"/${PN}-0.177-disable-large.patch
+ "${FILESDIR}"/${PN}-0.180-PaX-support.patch
+)
+
+src_prepare() {
+ default
+
+ if use elibc_musl; then
+ mkdir -p "${T}"/musl || die
+ cp -rv "${FILESDIR}"/musl/*.patch "${T}"/musl || die
+
+ # Delete patches upstreamed in 0.186
+ rm "${T}/musl/${PN}-0.185-error-h.patch" || die
+ rm "${T}/musl/${PN}-0.185-strndupa.patch" || die
+
+ eapply "${T}"/musl/
+ fi
+
+ 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
+
+ # Symbol aliases are implemented as asm statements.
+ # Will require porting: https://gcc.gnu.org/PR48200
+ filter-flags '-flto*'
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ $(use_enable nls) \
+ $(use_enable threads thread-safety) \
+ $(use_enable valgrind) \
+ --disable-debuginfod \
+ --disable-libdebuginfod \
+ --program-prefix="eu-" \
+ --with-zlib \
+ $(use_with bzip2 bzlib) \
+ $(use_with lzma) \
+ $(use_with zstd)
+}
+
+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/musl/elfutils-0.185-aarch64-regs.patch b/dev-libs/elfutils/files/musl/elfutils-0.185-aarch64-regs.patch
new file mode 100644
index 000000000000..222c0527b689
--- /dev/null
+++ b/dev-libs/elfutils/files/musl/elfutils-0.185-aarch64-regs.patch
@@ -0,0 +1,57 @@
+https://www.sourceware.org/bugzilla/show_bug.cgi?id=25832
+https://cgit.openembedded.org/openembedded-core/plain/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch
+https://bugs.gentoo.org/693772
+
+Other variants/links:
+https://git.alpinelinux.org/aports/tree/main/elfutils/fix-aarch64_fregs.patch
+https://github.com/gentoo/musl/blob/6450482b9b4463b57ac249c63b7ed796e9874c40/dev-libs/elfutils/files/0.178/fix-aarch64_fregs.patch
+
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 17:27:30 +0800
+Subject: [PATCH] Fix build on aarch64/musl
+
+Errors
+
+invalid operands to binary & (have 'long double' and 'unsigned int')
+
+error: redefinition
+ of 'struct iovec'
+ struct iovec { void *iov_base; size_t iov_len; };
+ ^
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Rebase to 0.170
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+--- 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;
+--- 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. */
diff --git a/dev-libs/elfutils/files/musl/elfutils-0.185-cdefs.patch b/dev-libs/elfutils/files/musl/elfutils-0.185-cdefs.patch
new file mode 100644
index 000000000000..42fc10945ebe
--- /dev/null
+++ b/dev-libs/elfutils/files/musl/elfutils-0.185-cdefs.patch
@@ -0,0 +1,20 @@
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Thu, 12 Dec 2019 22:38:30 -0600
+Subject: [PATCH 3/3] Fix cdefs.h include for musl
+
+--- a/lib/fixedsizehash.h
++++ b/lib/fixedsizehash.h
+@@ -30,8 +30,11 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
++#if !defined(__GLIBC__)
++#include <bsd/sys/cdefs.h>
++#else
+ #include <sys/cdefs.h>
+-
++#endif
+ #include <system.h>
+
+ #ifdef __CONCAT
+
diff --git a/dev-libs/elfutils/files/musl/elfutils-0.185-error-h.patch b/dev-libs/elfutils/files/musl/elfutils-0.185-error-h.patch
new file mode 100644
index 000000000000..2be63fca48df
--- /dev/null
+++ b/dev-libs/elfutils/files/musl/elfutils-0.185-error-h.patch
@@ -0,0 +1,68 @@
+Should be obsolete with the next release (0.186?).
+
+https://raw.githubusercontent.com/gentoo/musl/master/dev-libs/elfutils/files/0.178/musl-error_h.patch
+https://sourceware.org/bugzilla/show_bug.cgi?id=21008
+
+Date: Thu, 12 Dec 2019 22:00:47 -0600
+Subject: [PATCH 9/9] Add hacked up error header for non GLIBC machines
+
+--- /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_ */
+--- /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/dev-libs/elfutils/files/musl/elfutils-0.185-macros.patch b/dev-libs/elfutils/files/musl/elfutils-0.185-macros.patch
new file mode 100644
index 000000000000..6ab2e96548bd
--- /dev/null
+++ b/dev-libs/elfutils/files/musl/elfutils-0.185-macros.patch
@@ -0,0 +1,86 @@
+May not be required (or at least some hunks) with next release (0.186?)
+
+https://git.alpinelinux.org/aports/plain/main/elfutils/musl-macros.patch
+--- 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;
+--- a/src/elfcompress.c
++++ b/src/elfcompress.c
+@@ -35,6 +35,14 @@
+ #include <gelf.h>
+ #include "system.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. */
+ static void print_version (FILE *stream, struct argp_state *state);
+ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+--- a/lib/libeu.h
++++ b/lib/libeu.h
+@@ -31,6 +31,27 @@
+
+ #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
+
+ extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+ extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
+--- 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/dev-libs/elfutils/files/musl/elfutils-0.185-strndupa.patch b/dev-libs/elfutils/files/musl/elfutils-0.185-strndupa.patch
new file mode 100644
index 000000000000..030bc779c614
--- /dev/null
+++ b/dev-libs/elfutils/files/musl/elfutils-0.185-strndupa.patch
@@ -0,0 +1,22 @@
+Should be fixed in next release (0.186?).
+
+https://sourceware.org/git/?p=elfutils.git;a=commit;h=e7e4c92650892cf67210be5ea89ffba967427cbf
+https://git.alpinelinux.org/aports/plain/main/elfutils/musl-strndupa.patch
+--- 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;
+