commit:     77bcc45dc4b55e9d1a54d0944f6524943ebabfa3
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  2 12:04:05 2026 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Mon Feb  2 12:39:29 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77bcc45d

sys-apps/iucode_tool: Patch to build on non-x86 arches, ~arm64, EAPI 8

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 .../files/iucode_tool-2.3.1-non-x86.patch          | 47 ++++++++++++++++++++++
 sys-apps/iucode_tool/iucode_tool-2.3.1-r2.ebuild   | 21 ++++++++++
 2 files changed, 68 insertions(+)

diff --git a/sys-apps/iucode_tool/files/iucode_tool-2.3.1-non-x86.patch 
b/sys-apps/iucode_tool/files/iucode_tool-2.3.1-non-x86.patch
new file mode 100644
index 000000000000..772f05d33ce6
--- /dev/null
+++ b/sys-apps/iucode_tool/files/iucode_tool-2.3.1-non-x86.patch
@@ -0,0 +1,47 @@
+https://gitlab.com/iucode-tool/iucode-tool/-/merge_requests/5
+
+From dd2511c343b4eb62a28edf330dfc9e2c2e750a88 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <[email protected]>
+Date: Mon, 2 Feb 2026 11:16:13 +0000
+Subject: [PATCH] iucode_tool: Allow building on non-x86 little endian
+ architectures
+
+This is obviously an Intel x86-specific tool, but that doesn't mean it
+cannot be used elsewhere to prepare x86 images. The code is still
+endian-sensitive though, so the configure check to disallow big endian
+remains.
+
+Signed-off-by: James Le Cuirot <[email protected]>
+--- a/iucode_tool.c
++++ b/iucode_tool.c
+@@ -30,7 +30,10 @@
+ #include <argp.h>
+ #include <dirent.h>
+ #include <time.h>
++
++#if defined(__x86_64__) || defined(__i386__)
+ #include <cpuid.h>
++#endif
+ 
+ #include "intel_microcode.h"
+ 
+@@ -2933,11 +2936,16 @@ static int scan_system_processors(unsigned int 
strategy,
+       assert(filter_list);
+ 
+       print_msg(3, "trying to get CPUID information directly");
++#if defined(__x86_64__) || defined(__i386__)
+       if (!(__get_cpuid(0, &id0, &id1, &id2, &id3) &&
+             __get_cpuid(1, &sig, &idx, &idx, &idx))) {
+               print_msg(1, "microcode signature unavailable");
+               return 0;
+       }
++#else
++      print_msg(1, "CPUID instruction not available on this architecture");
++      return 0;
++#endif
+ 
+       /*
+        * fail-safe: only change filter_list_allow (switch away from "select
+-- 
+2.51.2
+

diff --git a/sys-apps/iucode_tool/iucode_tool-2.3.1-r2.ebuild 
b/sys-apps/iucode_tool/iucode_tool-2.3.1-r2.ebuild
new file mode 100644
index 000000000000..75c903aa169f
--- /dev/null
+++ b/sys-apps/iucode_tool/iucode_tool-2.3.1-r2.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Tool to manipulate Intel X86 and X86-64 processor microcode 
update collections"
+HOMEPAGE="https://gitlab.com/iucode-tool/";
+SRC_URI="https://gitlab.com/iucode-tool/releases/raw/master/${PN/_/-}_${PV}.tar.xz";
+S="${WORKDIR}/${PN/_/-}-${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+RDEPEND="elibc_musl? ( sys-libs/argp-standalone )"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.3.1-limits-include.patch
+       "${FILESDIR}"/${PN}-2.3.1-non-x86.patch
+)

Reply via email to