mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-30 18:12:08 +02:00
dev-libs/elfutils: Sync with gentoo
It's from gentoo commit 3036d691f0b4a77804ba48d90079c766c4befbe8.
This commit is contained in:
parent
463df98b18
commit
cde11b3221
@ -1,2 +1,4 @@
|
|||||||
DIST elfutils-0.177.tar.bz2 8852413 BLAKE2B 03f432342651f7646d73b7847325bd14b722ce34d85df01b1ad072b916af9b9da2d0d119cd24e952073bd584ec76b027ba9b6c7d45fb057372b3e700b1f5741a SHA512 2779987463a22ed220759e25a09c9a1eb84c0f36db37675136e59aa55c7f8f90b7a7d34ffc4e6a4291d7fa73692a1bd1a303a74270b11d1623b4f9868d19498f
|
DIST elfutils-0.185-patches.tar.gz 7625 BLAKE2B 92aff147aa7e45976863e8129e25ecad74ad9bca231c9223897094c5933c3b350eb525a203b492d80c1eabee3b3808b43e30bdb879d7173eac968afa2005e97c SHA512 3f253c4de97190731ac157044572912b76df80f9473f3df335f0383dad6409f987593a749c5284672cf1b20241ac3ed9d77b126f730aaf594725703b6a426906
|
||||||
DIST elfutils-0.178.tar.bz2 9007557 BLAKE2B 241b611dbfac37f35a670fbe80096c21b870e4b26fcddc8af26fba0373c9cd72eae42aabae2803b7b16c3bf649aeda036b1ea1b40952b43c4021ed23fcb51e80 SHA512 356656ad0db8f6877b461de1a11280de16a9cc5d8dde4381a938a212e828e32755135e5e3171d311c4c9297b728fbd98123048e2e8fbf7fe7de68976a2daabe5
|
DIST elfutils-0.185.tar.bz2 9187627 BLAKE2B 57cfa7e4060975c4bf6170dbd354687a19a92f7069c060db1ac2fa4da5a9d34e8bddd07c7ce376b5c28b5670ad5b8c1df795164cbcfb600a44cf1db60c20c4af SHA512 34de0de1355b11740e036e0fc64f2fc063587c8eb121b19216ee5548d3f0f268d8fc3995176c47190466b9d881007cfa11a9d01e9a50e38af6119492bf8bb47f
|
||||||
|
DIST elfutils-0.186-patches.tar.gz 3323 BLAKE2B 360365597d3a08d6f4fe843d04bcddd07a44ca93dae2034615abc450517e1be21c81a55aa379c409902e134ae795b38bb7461c65cdba3934ac7ef1e4e0e53091 SHA512 e2d427be505fdc416751a1fbc3bb4f39577859d94ce43990faa83c135fe36be2ddb3a2ef0f1020cfa37060e6d43dc7b8cf3db0d07d62b31bf29cb9a4a5945ce1
|
||||||
|
DIST elfutils-0.186.tar.bz2 9230491 BLAKE2B 49573d0a1f3519eab81d1ba3e94354cbc0935a36a94a3fdb22fe223a47b78cca8fd6e322870b0e335a809529fa6f54180b13c67936dec0242123c54ba20c9fc9 SHA512 c9180b27ec62935f18b9431268d176f6023d1bb938731d2af6e7626ae460af6608a70ba68483aa1ec7e6cb0fa0528b661ca8b68bc4f58ea8e18af527c5950c78
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright 1999-2020 Gentoo Authors
|
# Copyright 2003-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=7
|
EAPI=7
|
||||||
@ -8,34 +8,45 @@ inherit flag-o-matic multilib-minimal
|
|||||||
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
|
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
|
||||||
HOMEPAGE="http://elfutils.org/"
|
HOMEPAGE="http://elfutils.org/"
|
||||||
SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
|
SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
|
||||||
|
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-0.185-patches.tar.gz"
|
||||||
|
|
||||||
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
|
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
|
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"
|
IUSE="bzip2 lzma nls static-libs test +threads +utils valgrind zstd"
|
||||||
|
|
||||||
RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
|
RDEPEND=">=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
|
||||||
bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
|
bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] )
|
||||||
lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
|
lzma? ( >=app-arch/xz-utils-5.0.5-r1[static-libs?,${MULTILIB_USEDEP}] )
|
||||||
!dev-libs/libelf"
|
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}
|
DEPEND="${RDEPEND}
|
||||||
valgrind? ( dev-util/valgrind )
|
valgrind? ( dev-util/valgrind )
|
||||||
"
|
"
|
||||||
BDEPEND="nls? ( sys-devel/gettext )
|
BDEPEND="nls? ( sys-devel/gettext )
|
||||||
>=sys-devel/flex-2.5.4a
|
>=sys-devel/flex-2.5.4a
|
||||||
sys-devel/m4"
|
sys-devel/m4
|
||||||
|
"
|
||||||
RESTRICT="!test? ( test )"
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}"/${PN}-0.118-PaX-support.patch
|
"${WORKDIR}"/${PN}-0.185-patches/
|
||||||
"${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
|
|
||||||
"${FILESDIR}"/${PN}-0.177-disable-large.patch
|
|
||||||
)
|
)
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
|
|
||||||
|
if use elibc_musl; then
|
||||||
|
eapply "${WORKDIR}"/${PN}-0.185-patches/musl/
|
||||||
|
fi
|
||||||
|
|
||||||
if ! use static-libs; then
|
if ! use static-libs; then
|
||||||
sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
|
sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
|
||||||
fi
|
fi
|
||||||
@ -45,6 +56,11 @@ src_prepare() {
|
|||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
use test && append-flags -g #407135
|
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-minimal_src_configure
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,10 +70,12 @@ multilib_src_configure() {
|
|||||||
$(use_enable threads thread-safety) \
|
$(use_enable threads thread-safety) \
|
||||||
$(use_enable valgrind) \
|
$(use_enable valgrind) \
|
||||||
--disable-debuginfod \
|
--disable-debuginfod \
|
||||||
|
--disable-libdebuginfod \
|
||||||
--program-prefix="eu-" \
|
--program-prefix="eu-" \
|
||||||
--with-zlib \
|
--with-zlib \
|
||||||
$(use_with bzip2 bzlib) \
|
$(use_with bzip2 bzlib) \
|
||||||
$(use_with lzma)
|
$(use_with lzma) \
|
||||||
|
$(use_with zstd)
|
||||||
}
|
}
|
||||||
|
|
||||||
multilib_src_test() {
|
multilib_src_test() {
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright 1999-2020 Gentoo Authors
|
# Copyright 2003-2022 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=7
|
EAPI=7
|
||||||
@ -6,43 +6,62 @@ EAPI=7
|
|||||||
inherit flag-o-matic multilib-minimal
|
inherit flag-o-matic multilib-minimal
|
||||||
|
|
||||||
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
|
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
|
||||||
HOMEPAGE="http://elfutils.org/"
|
HOMEPAGE="https://elfutils.org/"
|
||||||
SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
|
SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
|
||||||
|
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-0.186-patches.tar.gz"
|
||||||
|
|
||||||
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
|
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~amd64-linux ~x86-linux"
|
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"
|
IUSE="bzip2 lzma nls static-libs test +threads +utils valgrind zstd"
|
||||||
|
|
||||||
RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
|
RDEPEND=">=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
|
||||||
bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
|
bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] )
|
||||||
lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
|
lzma? ( >=app-arch/xz-utils-5.0.5-r1[static-libs?,${MULTILIB_USEDEP}] )
|
||||||
!dev-libs/libelf"
|
zstd? ( app-arch/zstd:=[static-libs?,${MULTILIB_USEDEP}] )
|
||||||
DEPEND="${RDEPEND}"
|
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 )
|
BDEPEND="nls? ( sys-devel/gettext )
|
||||||
>=sys-devel/flex-2.5.4a
|
>=sys-devel/flex-2.5.4a
|
||||||
sys-devel/m4"
|
sys-devel/m4
|
||||||
|
"
|
||||||
RESTRICT="!test? ( test )"
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}"/${PN}-0.118-PaX-support.patch
|
"${WORKDIR}"/${PN}-0.186-patches/
|
||||||
"${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
|
|
||||||
"${FILESDIR}"/${PN}-0.177-disable-large.patch
|
|
||||||
)
|
)
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
|
|
||||||
|
if use elibc_musl; then
|
||||||
|
eapply "${WORKDIR}"/${PN}-0.186-patches/musl/
|
||||||
|
fi
|
||||||
|
|
||||||
if ! use static-libs; then
|
if ! use static-libs; then
|
||||||
sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
|
sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# https://sourceware.org/PR23914
|
# https://sourceware.org/PR23914
|
||||||
sed -i 's:-Werror::' */Makefile.in || die
|
sed -i 's:-Werror::' */Makefile.in || die
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
use test && append-flags -g #407135
|
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-minimal_src_configure
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,10 +69,14 @@ multilib_src_configure() {
|
|||||||
ECONF_SOURCE="${S}" econf \
|
ECONF_SOURCE="${S}" econf \
|
||||||
$(use_enable nls) \
|
$(use_enable nls) \
|
||||||
$(use_enable threads thread-safety) \
|
$(use_enable threads thread-safety) \
|
||||||
|
$(use_enable valgrind) \
|
||||||
|
--disable-debuginfod \
|
||||||
|
--disable-libdebuginfod \
|
||||||
--program-prefix="eu-" \
|
--program-prefix="eu-" \
|
||||||
--with-zlib \
|
--with-zlib \
|
||||||
$(use_with bzip2 bzlib) \
|
$(use_with bzip2 bzlib) \
|
||||||
$(use_with lzma)
|
$(use_with lzma) \
|
||||||
|
$(use_with zstd)
|
||||||
}
|
}
|
||||||
|
|
||||||
multilib_src_test() {
|
multilib_src_test() {
|
@ -1,26 +0,0 @@
|
|||||||
Add support for PaX ELF markings
|
|
||||||
|
|
||||||
Patch by Kevin F. Quinn <kevquinn@gentoo.org>
|
|
||||||
|
|
||||||
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 */
|
|
||||||
#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 */
|
|
||||||
--- a/src/elflint.c
|
|
||||||
+++ b/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 ("\
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
https://sourceware.org/PR24158
|
|
||||||
|
|
||||||
Tets fails when 32-bit elfutils tries to dump 64-bit process.
|
|
||||||
--- a/tests/run-backtrace-native-biarch.sh
|
|
||||||
+++ b/tests/run-backtrace-native-biarch.sh
|
|
||||||
@@ -17,2 +17,3 @@
|
|
||||||
|
|
||||||
+ELFUTILS_DISABLE_BIARCH=yes # https://sourceware.org/PR24158
|
|
||||||
if test -n "$ELFUTILS_DISABLE_BIARCH"; then
|
|
@ -1,14 +0,0 @@
|
|||||||
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
|
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||||
<pkgmetadata>
|
<pkgmetadata>
|
||||||
<maintainer type="project">
|
<maintainer type="project">
|
||||||
<email>toolchain@gentoo.org</email>
|
<email>toolchain@gentoo.org</email>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user