Sync up LZMA CpumArch patches
Brad Smith <[email protected]> Sat, 1 Aug 2026 01:11:40 -0400
| Newsgroups | gmane.os.openbsd.ports |
|---|---|
| Message-ID | <[email protected]> |
I noticed there were a few copies of the LZMA SDK CpuArch patches
in the tree. I synched them up so they are all the same as what is
upstream.
I only patched archivers/unarr, emulators/mame and graphics/blender.
I did not touch the copies in www/chromium, www/iridium,
www/ungoogled-chromium and x11/qt6/qtwebengine.
I also sent kn@ an update to sysutils/uefitool and ports@ an update
to sysutils/ugrep. I got upstream for both to sync up to newer (26.00+)
LZMA SDK.
Index: archivers/unarr/Makefile
===================================================================
RCS file: /cvs/ports/archivers/unarr/Makefile,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 Makefile
--- archivers/unarr/Makefile 8 Jul 2026 12:41:58 -0000 1.8
+++ archivers/unarr/Makefile 30 Jul 2026 06:55:39 -0000
@@ -1,7 +1,7 @@
COMMENT = decompression library for rar, tar, zip and 7z archives
V = 1.1.1
-REVISION = 0
+REVISION = 1
DISTNAME = unarr-${V}
SHARED_LIBS = unarr 0.1
Index: archivers/unarr/patches/patch-lzmasdk_CpuArch_c
===================================================================
RCS file: /cvs/ports/archivers/unarr/patches/patch-lzmasdk_CpuArch_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-lzmasdk_CpuArch_c
--- archivers/unarr/patches/patch-lzmasdk_CpuArch_c 28 Sep 2023 17:17:33 -0000 1.1
+++ archivers/unarr/patches/patch-lzmasdk_CpuArch_c 30 Jul 2026 06:55:39 -0000
@@ -1,17 +1,75 @@
-disable asm checks on aarch64; unbreak the build: it assumes sys/auxv.h
-(for getauxval) and asm/hwcap.h (for AT_HWCAP.)
+- 24.05
+ fc662341e6f85da78ada0e443f6116b978f79f22
+- 26.00
+ 839151eaaad24771892afaae6bac690e31e58384
Index: lzmasdk/CpuArch.c
--- lzmasdk/CpuArch.c.orig
+++ lzmasdk/CpuArch.c
-@@ -760,10 +760,6 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP
+@@ -760,32 +760,62 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP
#else // __APPLE__
-#include <sys/auxv.h>
--
--#define USE_HWCAP
--
++#if defined(__GLIBC__) && (__GLIBC__ * 100 + __GLIBC_MINOR__ >= 216)
++ #define Z7_GETAUXV_AVAILABLE
++#else
++ #if defined __has_include
++ #if __has_include (<sys/auxv.h>)
++ #define Z7_GETAUXV_AVAILABLE
++ #endif
++ #endif
++#endif
+
++#ifdef Z7_GETAUXV_AVAILABLE
++#include <sys/auxv.h>
+ #define USE_HWCAP
++#endif
+
#ifdef USE_HWCAP
++#if defined(__FreeBSD__) || defined(__OpenBSD__)
++static unsigned long MY_getauxval(int aux)
++{
++ unsigned long val;
++ if (elf_aux_info(aux, &val, sizeof(val)))
++ return 0;
++ return val;
++}
++#else
++#define MY_getauxval getauxval
++ #if defined __has_include
++ #if __has_include (<asm/hwcap.h>)
#include <asm/hwcap.h>
++ #endif
++ #endif
++#endif
+
+ #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
+- BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; }
++ BoolInt CPU_IsSupported_ ## name1(void) { return (MY_getauxval(AT_HWCAP) & (HWCAP_ ## name2)); }
+
+ #ifdef MY_CPU_ARM64
+ #define MY_HWCAP_CHECK_FUNC(name) \
+ MY_HWCAP_CHECK_FUNC_2(name, name)
++#if 1 || defined(__ARM_NEON)
++ BoolInt CPU_IsSupported_NEON(void) { return True; }
++#else
+ MY_HWCAP_CHECK_FUNC_2(NEON, ASIMD)
++#endif
+ // MY_HWCAP_CHECK_FUNC (ASIMD)
+ #elif defined(MY_CPU_ARM)
+ #define MY_HWCAP_CHECK_FUNC(name) \
+- BoolInt CPU_IsSupported_ ## name() { return (getauxval(AT_HWCAP2) & (HWCAP2_ ## name)) ? 1 : 0; }
++ BoolInt CPU_IsSupported_ ## name(void) { return (MY_getauxval(AT_HWCAP2) & (HWCAP2_ ## name)); }
+ MY_HWCAP_CHECK_FUNC_2(NEON, NEON)
+ #endif
+
+ #else // USE_HWCAP
+
+ #define MY_HWCAP_CHECK_FUNC(name) \
+- BoolInt CPU_IsSupported_ ## name() { return 0; }
++ BoolInt CPU_IsSupported_ ## name(void) { return 0; }
+ MY_HWCAP_CHECK_FUNC(NEON)
+
+ #endif // USE_HWCAP
Index: emulators/mame/Makefile
===================================================================
RCS file: /cvs/ports/emulators/mame/Makefile,v
retrieving revision 1.103
diff -u -p -u -p -r1.103 Makefile
--- emulators/mame/Makefile 28 May 2026 20:40:21 -0000 1.103
+++ emulators/mame/Makefile 30 Jul 2026 06:55:39 -0000
@@ -10,6 +10,7 @@ GH_ACCOUNT = mamedev
GH_PROJECT = mame
GH_TAGNAME = mame0${V}
DISTNAME = mame-0.${V}
+REVISION = 0
CATEGORIES = emulators
HOMEPAGE = https://mamedev.org/
Index: emulators/mame/patches/patch-3rdparty_lzma_C_CpuArch_c
===================================================================
RCS file: /cvs/ports/emulators/mame/patches/patch-3rdparty_lzma_C_CpuArch_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-3rdparty_lzma_C_CpuArch_c
--- emulators/mame/patches/patch-3rdparty_lzma_C_CpuArch_c 17 Apr 2024 16:22:59 -0000 1.1
+++ emulators/mame/patches/patch-3rdparty_lzma_C_CpuArch_c 30 Jul 2026 06:55:39 -0000
@@ -1,38 +1,75 @@
+- 24.05
+ fc662341e6f85da78ada0e443f6116b978f79f22
+- 26.00
+ 839151eaaad24771892afaae6bac690e31e58384
+
Index: 3rdparty/lzma/C/CpuArch.c
--- 3rdparty/lzma/C/CpuArch.c.orig
+++ 3rdparty/lzma/C/CpuArch.c
-@@ -757,6 +757,34 @@ BoolInt CPU_IsSupported_SHA1(void) { return APPLE_CRYP
- BoolInt CPU_IsSupported_SHA2(void) { return APPLE_CRYPTO_SUPPORT_VAL; }
- BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; }
-
-+#elif defined(__OpenBSD__)
-+
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#include <machine/cpu.h>
-+#include <machine/armreg.h>
-+
-+BoolInt CPU_IsSupported_NEON() { return 1; }
-+
-+#define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
-+ BoolInt CPU_IsSupported_ ## name1() { \
-+ int isar0_mib[] = { CTL_MACHDEP, CPU_ID_AA64ISAR0 }; \
-+ size_t len = sizeof(uint64_t); \
-+ uint64_t cpu_id = 0; \
-+ if (sysctl(isar0_mib, 2, &cpu_id, &len, NULL, 0) < 0) \
-+ return 0; \
-+ if (ID_AA64ISAR0_ ## name2(cpu_id) >= ID_AA64ISAR0_## name2 ##_BASE) \
-+ return 1; \
-+ return 0; \
-+ }
-+
-+#define MY_HWCAP_CHECK_FUNC(name) \
-+ MY_HWCAP_CHECK_FUNC_2(name, name)
-+
-+MY_HWCAP_CHECK_FUNC (CRC32)
-+MY_HWCAP_CHECK_FUNC (SHA1)
-+MY_HWCAP_CHECK_FUNC (SHA2)
-+MY_HWCAP_CHECK_FUNC (AES)
+@@ -760,32 +760,62 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP
#else // __APPLE__
+-#include <sys/auxv.h>
++#if defined(__GLIBC__) && (__GLIBC__ * 100 + __GLIBC_MINOR__ >= 216)
++ #define Z7_GETAUXV_AVAILABLE
++#else
++ #if defined __has_include
++ #if __has_include (<sys/auxv.h>)
++ #define Z7_GETAUXV_AVAILABLE
++ #endif
++ #endif
++#endif
+
++#ifdef Z7_GETAUXV_AVAILABLE
++#include <sys/auxv.h>
+ #define USE_HWCAP
++#endif
+
+ #ifdef USE_HWCAP
+
++#if defined(__FreeBSD__) || defined(__OpenBSD__)
++static unsigned long MY_getauxval(int aux)
++{
++ unsigned long val;
++ if (elf_aux_info(aux, &val, sizeof(val)))
++ return 0;
++ return val;
++}
++#else
++#define MY_getauxval getauxval
++ #if defined __has_include
++ #if __has_include (<asm/hwcap.h>)
+ #include <asm/hwcap.h>
++ #endif
++ #endif
++#endif
+
+ #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
+- BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; }
++ BoolInt CPU_IsSupported_ ## name1(void) { return (MY_getauxval(AT_HWCAP) & (HWCAP_ ## name2)); }
+
+ #ifdef MY_CPU_ARM64
+ #define MY_HWCAP_CHECK_FUNC(name) \
+ MY_HWCAP_CHECK_FUNC_2(name, name)
++#if 1 || defined(__ARM_NEON)
++ BoolInt CPU_IsSupported_NEON(void) { return True; }
++#else
+ MY_HWCAP_CHECK_FUNC_2(NEON, ASIMD)
++#endif
+ // MY_HWCAP_CHECK_FUNC (ASIMD)
+ #elif defined(MY_CPU_ARM)
+ #define MY_HWCAP_CHECK_FUNC(name) \
+- BoolInt CPU_IsSupported_ ## name() { return (getauxval(AT_HWCAP2) & (HWCAP2_ ## name)) ? 1 : 0; }
++ BoolInt CPU_IsSupported_ ## name(void) { return (MY_getauxval(AT_HWCAP2) & (HWCAP2_ ## name)); }
+ MY_HWCAP_CHECK_FUNC_2(NEON, NEON)
+ #endif
+
+ #else // USE_HWCAP
+
+ #define MY_HWCAP_CHECK_FUNC(name) \
+- BoolInt CPU_IsSupported_ ## name() { return 0; }
++ BoolInt CPU_IsSupported_ ## name(void) { return 0; }
+ MY_HWCAP_CHECK_FUNC(NEON)
+
+ #endif // USE_HWCAP
Index: graphics/blender/Makefile
===================================================================
RCS file: /cvs/ports/graphics/blender/Makefile,v
retrieving revision 1.151
diff -u -p -u -p -r1.151 Makefile
--- graphics/blender/Makefile 2 Mar 2026 15:00:23 -0000 1.151
+++ graphics/blender/Makefile 30 Jul 2026 06:55:39 -0000
@@ -9,7 +9,7 @@ COMMENT = 3D creation software
VERSION = 4.5.3
V = ${VERSION:R}
DISTNAME = blender-${VERSION}
-REVISION = 3
+REVISION = 4
CATEGORIES = graphics
Index: graphics/blender/patches/patch-extern_lzma_CpuArch_c
===================================================================
RCS file: /cvs/ports/graphics/blender/patches/patch-extern_lzma_CpuArch_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-extern_lzma_CpuArch_c
--- graphics/blender/patches/patch-extern_lzma_CpuArch_c 5 Jun 2025 11:03:11 -0000 1.1
+++ graphics/blender/patches/patch-extern_lzma_CpuArch_c 30 Jul 2026 06:55:39 -0000
@@ -1,36 +1,75 @@
-Fix build on arm64 and make use of elf_aux_info to emulate getauxval.
+- 24.05
+ fc662341e6f85da78ada0e443f6116b978f79f22
+- 26.00
+ 839151eaaad24771892afaae6bac690e31e58384
Index: extern/lzma/CpuArch.c
--- extern/lzma/CpuArch.c.orig
+++ extern/lzma/CpuArch.c
-@@ -760,13 +760,28 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP
+@@ -760,32 +760,62 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP
#else // __APPLE__
-#include <sys/auxv.h>
--
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__GLIBC__) && (__GLIBC__ * 100 + __GLIBC_MINOR__ >= 216)
++ #define Z7_GETAUXV_AVAILABLE
++#else
++ #if defined __has_include
++ #if __has_include (<sys/auxv.h>)
++ #define Z7_GETAUXV_AVAILABLE
++ #endif
++ #endif
++#endif
+
++#ifdef Z7_GETAUXV_AVAILABLE
++#include <sys/auxv.h>
#define USE_HWCAP
+#endif
#ifdef USE_HWCAP
-+#include <sys/auxv.h>
-+
-+#ifdef __linux__
- #include <asm/hwcap.h>
-+#endif
-+
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
-+static inline
-+unsigned long getauxval(int aux) {
-+ unsigned long val;
-+
-+ if (elf_aux_info(aux, &val, sizeof(val)) == -1)
-+ val = 0;
-+ return val;
++static unsigned long MY_getauxval(int aux)
++{
++ unsigned long val;
++ if (elf_aux_info(aux, &val, sizeof(val)))
++ return 0;
++ return val;
+}
++#else
++#define MY_getauxval getauxval
++ #if defined __has_include
++ #if __has_include (<asm/hwcap.h>)
+ #include <asm/hwcap.h>
++ #endif
++ #endif
+#endif
#define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
- BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; }
+- BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; }
++ BoolInt CPU_IsSupported_ ## name1(void) { return (MY_getauxval(AT_HWCAP) & (HWCAP_ ## name2)); }
+
+ #ifdef MY_CPU_ARM64
+ #define MY_HWCAP_CHECK_FUNC(name) \
+ MY_HWCAP_CHECK_FUNC_2(name, name)
++#if 1 || defined(__ARM_NEON)
++ BoolInt CPU_IsSupported_NEON(void) { return True; }
++#else
+ MY_HWCAP_CHECK_FUNC_2(NEON, ASIMD)
++#endif
+ // MY_HWCAP_CHECK_FUNC (ASIMD)
+ #elif defined(MY_CPU_ARM)
+ #define MY_HWCAP_CHECK_FUNC(name) \
+- BoolInt CPU_IsSupported_ ## name() { return (getauxval(AT_HWCAP2) & (HWCAP2_ ## name)) ? 1 : 0; }
++ BoolInt CPU_IsSupported_ ## name(void) { return (MY_getauxval(AT_HWCAP2) & (HWCAP2_ ## name)); }
+ MY_HWCAP_CHECK_FUNC_2(NEON, NEON)
+ #endif
+
+ #else // USE_HWCAP
+
+ #define MY_HWCAP_CHECK_FUNC(name) \
+- BoolInt CPU_IsSupported_ ## name() { return 0; }
++ BoolInt CPU_IsSupported_ ## name(void) { return 0; }
+ MY_HWCAP_CHECK_FUNC(NEON)
+
+ #endif // USE_HWCAP