commit:     c4bc462b80146b44491195159bef8f835ed20496
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 21 08:34:13 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 21 08:34:33 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4bc462b

dev-libs/isa-l: Backport upstream big-endian bugfix

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-libs/isa-l/files/isa-l-2.31.1-big-endian.patch | 34 +++++++++++++
 dev-libs/isa-l/isa-l-2.31.1-r1.ebuild              | 56 ++++++++++++++++++++++
 2 files changed, 90 insertions(+)

diff --git a/dev-libs/isa-l/files/isa-l-2.31.1-big-endian.patch 
b/dev-libs/isa-l/files/isa-l-2.31.1-big-endian.patch
new file mode 100644
index 000000000000..4fa2431b4f3c
--- /dev/null
+++ b/dev-libs/isa-l/files/isa-l-2.31.1-big-endian.patch
@@ -0,0 +1,34 @@
+From 633add1b569fe927bace3960d7c84ed9c1b38bb9 Mon Sep 17 00:00:00 2001
+From: Pablo de Lara <[email protected]>
+Date: Fri, 24 Jan 2025 12:51:48 +0000
+Subject: [PATCH] igzip: fix header construction in Big Endian systems
+
+When a file contains a number of repeated '0x00' or '0xff'
+bytes, the block header is copied from a precomputed header,
+which only worked for Little-Endian systems.
+
+Fixes #311.
+
+Signed-off-by: Pablo de Lara <[email protected]>
+---
+ igzip/repeated_char_result.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/igzip/repeated_char_result.h b/igzip/repeated_char_result.h
+index c06d01d7..c90d529f 100644
+--- a/igzip/repeated_char_result.h
++++ b/igzip/repeated_char_result.h
+@@ -59,8 +59,13 @@
+ /* Headers for constant 0x00 and 0xFF blocks
+  * This also contains the first literal character. */
+ const uint32_t repeated_char_header[2][5] = {
++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+         { 0x0121c0ec, 0xc30c0000, 0x7d57fab0, 0x49270938 }, /* Deflate header 
for 0x00 */
+         { 0x0121c0ec, 0xc30c0000, 0x7baaff30, 0x49270938 }  /* Deflate header 
for 0xFF */
++#else
++        { 0xecc02101, 0x00000cc3, 0xb0fa577d, 0x38092749 }, /* Deflate header 
for 0x00 */
++        { 0xecc02101, 0x00000cc3, 0x30ffaa7b, 0x38092749 }, /* Deflate header 
for 0xFF */
++#endif
+ 
+ };
+ 

diff --git a/dev-libs/isa-l/isa-l-2.31.1-r1.ebuild 
b/dev-libs/isa-l/isa-l-2.31.1-r1.ebuild
new file mode 100644
index 000000000000..43a0e8de220b
--- /dev/null
+++ b/dev-libs/isa-l/isa-l-2.31.1-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Intelligent Storage Acceleration Library"
+HOMEPAGE="https://github.com/intel/isa-l";
+SRC_URI="https://github.com/intel/${PN}/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~s390 ~sparc ~x86"
+
+BDEPEND="
+       amd64? ( || (
+               >=dev-lang/nasm-2.11.01
+               >=dev-lang/yasm-1.2.0
+       ) )
+       x86? ( || (
+               >=dev-lang/nasm-2.11.01
+               >=dev-lang/yasm-1.2.0
+       ) )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.31.0_makefile-no-D.patch
+       "${FILESDIR}"/${PN}-2.31.0_makefile-x86.patch
+       "${FILESDIR}"/${PN}-2.31.0_no-fortify-source.patch
+       "${FILESDIR}"/${PN}-2.31.0_user-ldflags.patch
+       # 
https://github.com/intel/isa-l/commit/633add1b569fe927bace3960d7c84ed9c1b38bb9
+       "${FILESDIR}"/${P}-big-endian.patch
+)
+
+src_prepare() {
+       default
+
+       # isa-l does not support arbitrary assemblers on amd64 and x86,
+       # it must be either nasm or yasm.
+       if use amd64 || use x86; then
+               unset AS
+       fi
+
+       eautoreconf
+}
+
+src_compile() {
+       unset ARCH
+       default
+}
+
+src_install() {
+       default
+       find "${ED}" -name '*.la' -delete || die
+}

Reply via email to