dev-libs/elfutils: add 0.192

Wires up USE=stacktrace for the new eu-stacktrace tool, which is very
exciting, but still relies on patched sysprof so masked the USE flag
for now.

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2024-10-29 00:28:31 +00:00
parent 9043aa0917
commit 17bf42f78a
10 changed files with 332 additions and 1 deletions

View File

@@ -2,3 +2,5 @@ DIST elfutils-0.190.tar.bz2 9162766 BLAKE2B 9934aff08f1898377708b28595fb52130ef9
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
DIST elfutils-0.192.tar.bz2 11913897 BLAKE2B cf9036a1fca416e0d47c76471093609230545aee63e31e30991dc3c88417d7c621c930bb74809374da3bf142501cee91a2b861a5a89efcb5e1ac184df5defce1 SHA512 543188f5f2cfe5bc7955a878416c5f252edff9926754e5de0c6c57b132f21d9285c9b29e41281e93baad11d4ae7efbbf93580c114579c182103565fe99bd3909
DIST elfutils-0.192.tar.bz2.sig 310 BLAKE2B b34bd17e161c827ce502338388f0f7604fca8478e8e2f05f1ad744b5288f7767466d005d7591ad74098eda53aa3bcde8a3b485983447a434e2cb2e5e64c38063 SHA512 9de0731dd3986a3dde03cfacdc3daa668f0e2cc482adfc31ab97320f85f7d13d3f056154aa16299db3f09e1c89020635012ffdd0e4cb68c1391b0e218721fb22

View File

@@ -0,0 +1,145 @@
# 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 autotools flag-o-matic multilib-minimal
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
HOMEPAGE="https://sourceware.org/elfutils/"
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://sourceware.org/git/elfutils.git"
inherit git-r3
BDEPEND="
sys-devel/bison
sys-devel/flex
"
else
inherit verify-sig
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 )"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-elfutils-20240301 )"
fi
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
SLOT="0"
IUSE="bzip2 debuginfod lzma nls static-libs stacktrace test +utils valgrind 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}] )
stacktrace? ( dev-util/sysprof )
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}
valgrind? ( dev-debug/valgrind )
"
BDEPEND+="
sys-devel/m4
virtual/pkgconfig
nls? ( sys-devel/gettext )
"
PATCHES=(
"${FILESDIR}"/${PN}-0.189-musl-aarch64-regs.patch
"${FILESDIR}"/${PN}-0.191-musl-macros.patch
"${FILESDIR}"/${P}-libelf-static-link-libeu.patch
"${FILESDIR}"/${P}-configure-better-error-message.patch
"${FILESDIR}"/${P}-stacktrace-maybe-uninit.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() {
# bug #407135
use test && append-flags -g
# bug 660738
filter-flags -fno-asynchronous-unwind-tables
multilib-minimal_src_configure
}
multilib_src_configure() {
unset LEX YACC
local myeconfargs=(
$(use_enable nls)
$(multilib_native_use_enable debuginfod)
$(use_enable debuginfod libdebuginfod)
$(multilib_native_use_enable stacktrace)
$(use_enable valgrind valgrind-annotations)
# 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)
)
[[ ${PV} == 9999 ]] && myeconfargs+=( --enable-maintainer-mode )
# 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 we don't
# disable building them when the USE flag is disabled.
if ! use utils; then
rm -rf "${ED}"/usr/bin || die
fi
}

View File

@@ -28,7 +28,7 @@ fi
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
SLOT="0"
IUSE="bzip2 debuginfod lzma nls static-libs test +utils valgrind zstd"
IUSE="bzip2 debuginfod lzma nls static-libs stacktrace test +utils valgrind zstd"
RESTRICT="!test? ( test )"
RDEPEND="
@@ -43,6 +43,7 @@ RDEPEND="
net-misc/curl[static-libs?,${MULTILIB_USEDEP}]
)
lzma? ( >=app-arch/xz-utils-5.0.5-r1[static-libs?,${MULTILIB_USEDEP}] )
stacktrace? ( dev-util/sysprof )
zstd? ( app-arch/zstd:=[static-libs?,${MULTILIB_USEDEP}] )
elibc_musl? (
dev-libs/libbsd
@@ -96,6 +97,7 @@ multilib_src_configure() {
$(use_enable nls)
$(multilib_native_use_enable debuginfod)
$(use_enable debuginfod libdebuginfod)
$(multilib_native_use_enable stacktrace)
$(use_enable valgrind valgrind-annotations)
# explicitly disable thread safety, it's not recommended by upstream

View File

@@ -0,0 +1,96 @@
https://sourceware.org/git/?p=elfutils.git;a=commit;h=42b19e54393f031e6355cf0658e9518571e85ed3
From 42b19e54393f031e6355cf0658e9518571e85ed3 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 22 Oct 2024 18:19:09 +0200
Subject: [PATCH] configure: better error message for [lib]debuginfod missing
dependencies
When dependencies for libdebuginfod, debuginfod or ima verification are
missing and these features are explicitly enabled the user might not
immediately know which of the dependicies are missing. Move the checks
around a little so checks for dependencies are done immediately before
the enable error message. And add the possible reason to the error to
make things more clear.
* configure.ac: Move libcurl and json-c tests before libdebuginfod
check, move libmicrohttpd, sqlite3 and libarchive tests before
debuginfod check and move librpm, libcrypto and imaevm.h tests
before ima verification check.
https://sourceware.org/PR32294
Signed-off-by: Mark Wielaard <mark@klomp.org>
--- a/configure.ac
+++ b/configure.ac
@@ -837,16 +837,7 @@ AC_ARG_ENABLE([debuginfod-ima-verification],[AS_HELP_STRING([--enable-debuginfod
# Look for various packages, minimum versions as per rhel7.
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([libcurl],[libcurl >= 7.29.0],[have_libcurl=yes],[have_libcurl=no])
-AC_CHECK_LIB(pthread, pthread_setname_np, [AC_DEFINE([HAVE_PTHREAD_SETNAME_NP],[1],[Enable pthread_setname_np])])
PKG_CHECK_MODULES([jsonc],[json-c >= 0.11],[have_jsonc=yes],[have_jsonc=no])
-PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.33],[],[enable_debuginfod=no])
-PKG_CHECK_MODULES([oldlibmicrohttpd],[libmicrohttpd < 0.9.51],[old_libmicrohttpd=yes],[old_libmicrohttpd=no])
-PKG_CHECK_MODULES([sqlite3],[sqlite3 >= 3.7.17],[have_sqlite3=yes],[have_sqlite3=no])
-PKG_CHECK_MODULES([libarchive],[libarchive >= 3.1.2],[have_libarchive=yes],[have_libarchive=no])
-AC_CHECK_LIB(rpm, headerGet, [AC_CHECK_DECL(RPMSIGTAG_FILESIGNATURES,
- [AC_SUBST(rpm_LIBS, '-lrpm -lrpmio')],[], [#include <rpm/rpmlib.h>])])
-AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [AC_SUBST(crypto_LIBS, '-lcrypto')])
-AC_CHECK_HEADER(imaevm.h)
#
# pronounce judgement on ability to build client, overridden by =yes/=no
if test "x$enable_libdebuginfod" = "xno"; then
@@ -855,11 +846,15 @@ elif test "x$enable_libdebuginfod" = "xdummy"; then
true
elif test "x$have_jsonc$have_libcurl" = "xyesyes"; then
enable_libdebuginfod=yes
-elif test "x$enable_libdebuginfod" = "xyes" -o "x$enable_libdebuginfod" = "xdummy"; then
- AC_MSG_ERROR([unable to build libdebuginfod])
+elif test "x$enable_libdebuginfod" = "xyes"; then
+ AC_MSG_ERROR([unable to build libdebuginfod, missing libjson-c or libcurl])
else
enable_libdebuginfod=no
fi
+PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.33],[],[enable_debuginfod=no])
+PKG_CHECK_MODULES([oldlibmicrohttpd],[libmicrohttpd < 0.9.51],[old_libmicrohttpd=yes],[old_libmicrohttpd=no])
+PKG_CHECK_MODULES([sqlite3],[sqlite3 >= 3.7.17],[have_sqlite3=yes],[have_sqlite3=no])
+PKG_CHECK_MODULES([libarchive],[libarchive >= 3.1.2],[have_libarchive=yes],[have_libarchive=no])
#
# pronounce judgement on ability to build server, overridden by =yes/=no
if test "x$enable_debuginfod" = "xno"; then
@@ -867,18 +862,22 @@ if test "x$enable_debuginfod" = "xno"; then
elif test "x$have_jsonc$HAVE_CXX11$have_libarchive$have_sqlite3" = "xyesyesyesyes"; then
enable_debuginfod=yes
elif test "x$enable_debuginfod" = "xyes"; then
- AC_MSG_ERROR([unable to build debuginfod])
+ AC_MSG_ERROR([unable to build debuginfod, missing libmicrohttpd, sqlite3 or libarchive])
else
enable_debuginfod=no
fi
#
+AC_CHECK_LIB(rpm, headerGet, [AC_CHECK_DECL(RPMSIGTAG_FILESIGNATURES,
+ [AC_SUBST(rpm_LIBS, '-lrpm -lrpmio')],[], [#include <rpm/rpmlib.h>])])
+AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [AC_SUBST(crypto_LIBS, '-lcrypto')])
+AC_CHECK_HEADER(imaevm.h)
# pronounce judgment on ima signature support
if test "x$enable_debuginfod_ima_verification" = "xno"; then
true
elif test "x$ac_cv_lib_rpm_headerGet$ac_cv_have_decl_RPMSIGTAG_FILESIGNATURES$ac_cv_lib_crypto_EVP_MD_CTX_new$ac_cv_header_imaevm_h" = "xyesyesyesyes"; then
enable_debuginfod_ima_verification=yes
elif test "x$enable_debuginfod_ima_verification" = "xyes"; then
- AC_MSG_ERROR([unable to enable debuginfod ima verification])
+ AC_MSG_ERROR([unable to enable ima verification, missing librpm, libcrypto or imaevm.h])
else
enable_debuginfod_ima_verification=no
fi
@@ -895,6 +894,8 @@ AS_IF([test "x$have_libarchive" = "xyes"],AC_DEFINE([HAVE_LIBARCHIVE],[1],[Defin
AM_CONDITIONAL([ENABLE_IMA_VERIFICATION],[test "$enable_debuginfod_ima_verification" = "xyes"])
AM_CONDITIONAL([OLD_LIBMICROHTTPD],[test "x$old_libmicrohttpd" = "xyes"])
+AC_CHECK_LIB(pthread, pthread_setname_np, [AC_DEFINE([HAVE_PTHREAD_SETNAME_NP],[1],[Enable pthread_setname_np])])
+
dnl for /etc/profile.d/elfutils.{csh,sh}
default_debuginfod_urls=""
AC_ARG_ENABLE(debuginfod-urls,
--
2.43.5

View File

@@ -0,0 +1,31 @@
https://sourceware.org/git/?p=elfutils.git;a=commit;h=f5d6e088f84dd05278c4698a21cbf1ff4569978d
From f5d6e088f84dd05278c4698a21cbf1ff4569978d Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 22 Oct 2024 15:03:42 +0200
Subject: [PATCH] libelf: Add libeu objects to libelf.a static archive
libelf might use some symbols from libeu.a, specifically the eu-search
wrappers. But we don't ship libeu.a separately. So include the libeu
objects in the libelf.a archive to facilitate static linking.
* libelf/Makefile.am (libeu_objects): New variable.
(libelf_a_LIBADD): New, add libeu_objects.
https://sourceware.org/PR32293
Signed-off-by: Mark Wielaard <mark@klomp.org>
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -122,6 +122,9 @@ libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
+libeu_objects = $(shell $(AR) t ../lib/libeu.a)
+libelf_a_LIBADD = $(addprefix ../lib/,$(libeu_objects))
+
install: install-am libelf.so
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
--
2.43.5

View File

@@ -0,0 +1,38 @@
https://sourceware.org/git/?p=elfutils.git;a=commit;h=dce324303198545e1c5484d912e5f259b1d4953d
From dce324303198545e1c5484d912e5f259b1d4953d Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Thu, 24 Oct 2024 11:06:08 +0200
Subject: [PATCH] stacktrace: Init elf_fd in sysprof_init_dwfl
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
When building with LTO gcc believes elf_fd can be used uninitialized:
In function ‘sysprof_init_dwfl’,
inlined from ‘sysprof_unwind_cb’ at stacktrace.c:1235:16:
stacktrace.c:1087:7: error: ‘elf_fd’ may be used uninitialized [-Werror=maybe-uninitialized]
1087 | close (elf_fd);
| ^
This code won't be reached because if find_procfile doesn't initialize
elf_fd, it will return an error. But help the compiler by initializing
elf_fd to -1.
* src/stacktrace.c (sysprof_init_dwfl): Init elf_fd to -1.
Signed-off-by: Mark Wielaard <mark@klomp.org>
--- a/src/stacktrace.c
+++ b/src/stacktrace.c
@@ -1033,7 +1033,7 @@ sysprof_init_dwfl (struct sysprof_unwind_info *sui,
}
Elf *elf = NULL;
- int elf_fd;
+ int elf_fd = -1;
err = find_procfile (dwfl, &pid, &elf, &elf_fd);
if (err < 0)
{
--
2.43.5

View File

@@ -7,6 +7,11 @@
</maintainer>
<use>
<flag name="lzma">Support automatic decompression of LZMA-compressed files and kernel images</flag>
<flag name="stacktrace">
Build experimental eu-stacktrace tool. Relies on integration with dev-util/sysprof.
See https://developers.redhat.com/articles/2024/06/11/get-system-wide-profiles-binaries-without-frame-pointers.
</flag>
<flag name="utils">Install command-line utilities (all the eu-* programs)</flag>
<flag name="debuginfod">Enable debuginfod support, both the debuginfod server and the libdebuginfod client library</flag>
</use>

View File

@@ -17,6 +17,10 @@
#--- END OF EXAMPLES ---
# Sam James <sam@gentoo.org> (2024-10-29)
# Only available on amd64 for now
dev-libs/elfutils -stacktrace
# Viorel Munteanu <ceamac@gentoo.org> (2024-10-23)
# Dependency dev-python/asyncssh is keyworded here.
net-misc/dropbear -test

View File

@@ -1,6 +1,10 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Sam James <sam@gentoo.org> (2024-10-29)
# Only available on amd64 for now
dev-libs/elfutils stacktrace
# Viorel Munteanu <ceamac@gentoo.org> (2024-10-23)
# Missing keywords on dev-python/asyncssh.
net-misc/dropbear test

View File

@@ -3,6 +3,10 @@
# New entries go on top.
# Sam James <sam@gentoo.org> (2024-10-29)
# Currently needs patched dev-util/sysprof.
dev-libs/elfutils stacktrace
# Andreas K. Hüttel <dilfridge@gentoo.org> (2024-10-21)
# Mechanism for coping with the time64 transition of 32bit arches
# Will be unmasked in the time64 profiles