diff options
Diffstat (limited to 'dev-libs/elfutils')
-rw-r--r-- | dev-libs/elfutils/Manifest | 7 | ||||
-rw-r--r-- | dev-libs/elfutils/elfutils-0.190.ebuild (renamed from dev-libs/elfutils/elfutils-0.188.ebuild) | 43 | ||||
-rw-r--r-- | dev-libs/elfutils/elfutils-0.191.ebuild | 120 | ||||
-rw-r--r-- | dev-libs/elfutils/files/elfutils-0.189-musl-aarch64-regs.patch | 57 | ||||
-rw-r--r-- | dev-libs/elfutils/files/elfutils-0.189-musl-macros.patch | 86 | ||||
-rw-r--r-- | dev-libs/elfutils/files/elfutils-0.191-musl-macros.patch | 14 | ||||
-rw-r--r-- | dev-libs/elfutils/metadata.xml | 2 |
7 files changed, 300 insertions, 29 deletions
diff --git a/dev-libs/elfutils/Manifest b/dev-libs/elfutils/Manifest index 98e41ab11013..c9977594e891 100644 --- a/dev-libs/elfutils/Manifest +++ b/dev-libs/elfutils/Manifest @@ -1,3 +1,4 @@ -DIST elfutils-0.187-patches.tar.xz 2804 BLAKE2B 77cbd0666d8da3d5229baaba6605c84e7990200f39bfb72b2008eb2527e4567abd90c93c291cc0c8f3c10bbf97758ccf5877cbdae823780cf8dc97ff4ff2f932 SHA512 d056fdd6ae0e71471087af472a72384d6e73ff2d7fe1b708b5ec9f091a913c8327197660132b7a6619a0db86534715507ef67ee91691a00a591c1d24c55a99f4 -DIST elfutils-0.188.tar.bz2 9112977 BLAKE2B 6b0474f1436eaf6af73b735b9b2ddd5448ab9c03fbaa0be745a31c89ae8f15b0e21a651409c38643ca125794ce82c19d7b46db4a079f3e72cb919d643560e7a4 SHA512 585551b2d937d19d1becfc2f28935db1dd1a3d25571a62f322b70ac8da98c1a741a55d070327705df6c3e2ee026652e0b9a3c733b050a0b0ec5f2fc75d5b74b5 -DIST elfutils-0.188.tar.bz2.sig 310 BLAKE2B c8d9135cffde3b1dd337b692d5351855cf799915d3ebd553327febaac192bd2f108b3f45a6376d458e179390a1ceaf4809762cdc40ea1e05fed0214ac33ed56e SHA512 4cc8a7417d244e319a1650d71b1831660cfe41afc7c73e9c83d1f076f4013fe15247e8b4f5e12a5396d83c4f1c7663ca4be5ea42bff3dc23263f85331fd9d566 +DIST elfutils-0.190.tar.bz2 9162766 BLAKE2B 9934aff08f1898377708b28595fb52130ef9f80408132ac7d306845b10672ba45cf1ac69783da07b3eea9fd647741d44da45b8b2626c45a768cb2844c6186513 SHA512 9c4f5328097e028286c42f29e39dc3d80914b656cdfbbe05b639e91bc787ae8ae64dd4d69a6e317ce30c01648ded10281b86a51e718295f4c589df1225a48102 +DIST elfutils-0.190.tar.bz2.sig 310 BLAKE2B d6a2d490aa6815ed9a7c3624050716ebf7c50465af9907d471d47aa3b57590faf9b9ee03de127c6b3bdffa6948414aab6aa8c784ce29570f76bb03ee2021c062 SHA512 7cd88c19402a959679204a5b01ddd48720e224b84268d0d7452f0f1433150b97dd02288fac204fbd5e2fd6f227473bfe62205b350d5fe2e17addf45fb452eed6 +DIST elfutils-0.191.tar.bz2 9310088 BLAKE2B 2a7ad251369eca7ba609ab8644181fd479ad8596ee58dc068398ca22be25a978e96b81a10a92a5555d7574fd1b9227c8d54fb41dceb4025aedfc6ae32870bbca SHA512 e22d85f25317a79b36d370347e50284c9120c86f9830f08791b7b6a7b4ad89b9bf4c7c71129133b8d193a0edffb2a2c17987b7e48428b9670aff5ce918777e04 +DIST elfutils-0.191.tar.bz2.sig 310 BLAKE2B 5afee19515a115d4ca6d1e0c4a49eca84bb4b911687492934e939a80ac75b7fcea9b6bf5fc0f2248a4c64ef09bd5af9dfc60c72410cba33b78444c38443ad279 SHA512 ab030739d95d13abb84cf4dc6c5407e51d0bd0bca108e27654a1830371694181a1b6f115fdbb4ae0772390f54f1c4811e5ae26b38fdcfd3275177a3716adfd22 diff --git a/dev-libs/elfutils/elfutils-0.188.ebuild b/dev-libs/elfutils/elfutils-0.190.ebuild index b47d779db744..48128a1d751e 100644 --- a/dev-libs/elfutils/elfutils-0.188.ebuild +++ b/dev-libs/elfutils/elfutils-0.190.ebuild @@ -1,27 +1,33 @@ -# Copyright 2003-2023 Gentoo Authors +# Copyright 2003-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/elfutils.gpg +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/elfutils.gpg inherit flag-o-matic multilib-minimal verify-sig DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)" HOMEPAGE="https://sourceware.org/elfutils/" SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2" -SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-0.187-patches.tar.xz" SRC_URI+=" verify-sig? ( https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2.sig )" LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )" SLOT="0" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux" -IUSE="bzip2 lzma nls static-libs test +utils valgrind zstd" +IUSE="bzip2 debuginfod lzma nls static-libs test +utils zstd" RESTRICT="!test? ( test )" RDEPEND=" !dev-libs/libelf >=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}] bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] ) + debuginfod? ( + app-arch/libarchive:= + dev-db/sqlite:3= + net-libs/libmicrohttpd:= + + net-misc/curl[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? ( @@ -33,35 +39,23 @@ RDEPEND=" " DEPEND=" ${RDEPEND} - valgrind? ( dev-util/valgrind ) " BDEPEND=" - >=sys-devel/flex-2.5.4a + app-alternatives/lex sys-devel/m4 + virtual/pkgconfig nls? ( sys-devel/gettext ) verify-sig? ( sec-keys/openpgp-keys-elfutils ) " PATCHES=( - "${WORKDIR}"/${PN}-0.187-patches/ + "${FILESDIR}"/${PN}-0.189-musl-aarch64-regs.patch + "${FILESDIR}"/${PN}-0.189-musl-macros.patch ) -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${P}.tar.bz2{,.sig} - fi - - default -} - src_prepare() { default - if use elibc_musl; then - eapply "${WORKDIR}"/${PN}-0.187-patches/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 @@ -74,9 +68,8 @@ src_configure() { # bug #407135 use test && append-flags -g - # Symbol aliases are implemented as asm statements. - # Will require porting: https://gcc.gnu.org/PR48200 - filter-flags '-flto*' + # bug 660738 + filter-flags -fno-asynchronous-unwind-tables multilib-minimal_src_configure } @@ -84,8 +77,8 @@ src_configure() { multilib_src_configure() { local myeconfargs=( $(use_enable nls) - --disable-debuginfod - --disable-libdebuginfod + $(multilib_native_use_enable debuginfod) + $(use_enable debuginfod libdebuginfod) # explicitly disable thread safety, it's not recommended by upstream # doesn't build either on musl. diff --git a/dev-libs/elfutils/elfutils-0.191.ebuild b/dev-libs/elfutils/elfutils-0.191.ebuild new file mode 100644 index 000000000000..2825aaf9a27c --- /dev/null +++ b/dev-libs/elfutils/elfutils-0.191.ebuild @@ -0,0 +1,120 @@ +# Copyright 2003-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/elfutils.gpg +inherit flag-o-matic multilib-minimal verify-sig + +DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)" +HOMEPAGE="https://sourceware.org/elfutils/" +SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2" +SRC_URI+=" verify-sig? ( https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2.sig )" + +LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 debuginfod lzma nls static-libs test +utils zstd" +RESTRICT="!test? ( test )" + +RDEPEND=" + !dev-libs/libelf + >=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}] + bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] ) + debuginfod? ( + app-arch/libarchive:= + dev-db/sqlite:3= + net-libs/libmicrohttpd:= + + net-misc/curl[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 + ) +" +DEPEND=" + ${RDEPEND} +" +BDEPEND=" + app-alternatives/lex + sys-devel/m4 + virtual/pkgconfig + nls? ( sys-devel/gettext ) + verify-sig? ( >=sec-keys/openpgp-keys-elfutils-20240301 ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-0.189-musl-aarch64-regs.patch + "${FILESDIR}"/${PN}-0.191-musl-macros.patch +) + +src_prepare() { + default + + 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() { + # bug #407135 + use test && append-flags -g + + # bug 660738 + filter-flags -fno-asynchronous-unwind-tables + + multilib-minimal_src_configure +} + +multilib_src_configure() { + local myeconfargs=( + $(use_enable nls) + $(multilib_native_use_enable debuginfod) + $(use_enable debuginfod libdebuginfod) + + # explicitly disable thread safety, it's not recommended by upstream + # doesn't build either on musl. + --disable-thread-safety + + # Valgrind option is just for running tests under it; dodgy under sandbox + # and indeed even w/ glibc with newer instructions. + --disable-valgrind + --program-prefix="eu-" + --with-zlib + $(use_with bzip2 bzlib) + $(use_with lzma) + $(use_with zstd) + ) + + # Needed because sets alignment macro + is-flagq -fsanitize=address && myeconfargs+=( --enable-sanitize-address ) + is-flagq -fsanitize=undefined && myeconfargs+=( --enable-sanitize-undefined ) + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +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.189-musl-aarch64-regs.patch b/dev-libs/elfutils/files/elfutils-0.189-musl-aarch64-regs.patch new file mode 100644 index 000000000000..222c0527b689 --- /dev/null +++ b/dev-libs/elfutils/files/elfutils-0.189-musl-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/elfutils-0.189-musl-macros.patch b/dev-libs/elfutils/files/elfutils-0.189-musl-macros.patch new file mode 100644 index 000000000000..97c6c1dcd62e --- /dev/null +++ b/dev-libs/elfutils/files/elfutils-0.189-musl-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/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/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 +@@ -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; + +--- a/src/strip.c ++++ b/src/strip.c +@@ -45,6 +45,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/elfutils-0.191-musl-macros.patch b/dev-libs/elfutils/files/elfutils-0.191-musl-macros.patch new file mode 100644 index 000000000000..6e0912c5ce9a --- /dev/null +++ b/dev-libs/elfutils/files/elfutils-0.191-musl-macros.patch @@ -0,0 +1,14 @@ +https://git.alpinelinux.org/aports/plain/main/elfutils/musl-macros.patch +--- a/lib/system.h ++++ b/lib/system.h +@@ -56,6 +56,10 @@ void error(int status, int errnum, const char *format, ...); + #error "err.h or error.h must be available" + #endif + ++#if !defined(FNM_EXTMATCH) ++# define FNM_EXTMATCH 0 ++#endif ++ + /* error (EXIT_FAILURE, ...) should be noreturn but on some systems it + isn't. This may cause warnings about code that should not be reachable. + So have an explicit error_exit wrapper that is noreturn (because it diff --git a/dev-libs/elfutils/metadata.xml b/dev-libs/elfutils/metadata.xml index d91314ed4c10..05def2bfd0b3 100644 --- a/dev-libs/elfutils/metadata.xml +++ b/dev-libs/elfutils/metadata.xml @@ -8,7 +8,7 @@ <use> <flag name="lzma">Support automatic decompression of LZMA-compressed files and kernel images</flag> <flag name="utils">Install command-line utilities (all the eu-* programs)</flag> - <flag name="valgrind">Add support for memory debugging using <pkg>dev-util/valgrind</pkg></flag> + <flag name="debuginfod">Enable debuginfod support, both the debuginfod server and the libdebuginfod client library</flag> </use> <upstream> <remote-id type="cpe">cpe:/a:elfutils_project:elfutils</remote-id> |