commit:     bd357ea56a817343b7bbca3b0393622ab73b3f25
Author:     Ian Jordan <immoloism <AT> gmail <DOT> com>
AuthorDate: Sun Nov 10 19:43:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Dec  1 11:48:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd357ea5

dev-util/patchelf: Backport dt-mips-xhash patch

As patchelf-0.18.0 is still not working correctly on all arches, this patch
will allow 0.17.2 to continue to compile in the meantime.

Bug: https://bugs.gentoo.org/943026
Signed-off-by: Ian Jordan <immoloism <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/39261
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/patchelf-0.17.2-dt-mips-xhash.patch      | 14 ++++++++++++
 dev-util/patchelf/patchelf-0.17.2-r1.ebuild        | 26 ++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/dev-util/patchelf/files/patchelf-0.17.2-dt-mips-xhash.patch 
b/dev-util/patchelf/files/patchelf-0.17.2-dt-mips-xhash.patch
new file mode 100644
index 000000000000..a5e18fb4e8e7
--- /dev/null
+++ b/dev-util/patchelf/files/patchelf-0.17.2-dt-mips-xhash.patch
@@ -0,0 +1,14 @@
+--- /dev/null  2024-11-05 18:50:26.176666244 +0000
++++ b/src/elfmips.h    2024-11-10 19:02:29.662347993 +0000
+@@ -0,0 +1,3 @@
++#ifndef DT_MIPS_XHASH
++#define DT_MIPS_XHASH 0x70000036
++#endif
+--- a/src/patchelf.h   2024-11-10 18:59:50.300318823 +0000
++++ b/src/patchelf.h   2024-11-10 19:11:20.597382739 +0000
+@@ -1,3 +1,5 @@
++#include "elfmips.h"
++
+ using FileContents = std::shared_ptr<std::vector<unsigned char>>;
+ 
+ #define ElfFileParams class Elf_Ehdr, class Elf_Phdr, class Elf_Shdr, class 
Elf_Addr, class Elf_Off, class Elf_Dyn, class Elf_Sym, class Elf_Verneed, class 
Elf_Versym

diff --git a/dev-util/patchelf/patchelf-0.17.2-r1.ebuild 
b/dev-util/patchelf/patchelf-0.17.2-r1.ebuild
new file mode 100644
index 000000000000..092f5dd68b5a
--- /dev/null
+++ b/dev-util/patchelf/patchelf-0.17.2-r1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Small utility to modify the dynamic linker and RPATH of ELF 
executables"
+HOMEPAGE="https://github.com/NixOS/patchelf";
+SRC_URI="https://github.com/NixOS/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~m68k ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 
~amd64-linux ~riscv-linux ~x86-linux"
+LICENSE="GPL-3"
+
+PATCHES=("${FILESDIR}"/${PN}-0.17.2-dt-mips-xhash.patch)
+
+src_prepare() {
+       default
+       rm src/elf.h || die
+
+       sed -i \
+               -e 's:-Werror::g' \
+               configure.ac || die
+
+       eautoreconf
+}

Reply via email to