Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2026 21:27:24 +0000
From:      Robert Clausecker <fuz@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: f55f8180ef14 - main - emulators/mame: fix build on armv7
Message-ID:  <6a31bfbc.3ec80.145034da@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f55f8180ef148c80198ba0b928f9d323d228ce15

commit f55f8180ef148c80198ba0b928f9d323d228ce15
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2026-06-14 14:19:06 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-06-16 21:26:54 +0000

    emulators/mame: fix build on armv7
    
    The bundled copy of the LZMA toolkit has been updated to a fairly
    recent version.  As a result, while our patches still apply, they are
    largely obsolete or even defective.
    
    Remove the obsolete patches and add a missing compile option to fix the
    build on armv7 (-march=armv8-a enables AES intrinsics required by LZMA).
    
    Approved by:    portmgr (build fix blanket)
    MFH:            2026Q2
---
 emulators/mame/Makefile                            |  7 ++-
 .../files/extra-patch-3rdparty_lzma_C_AesOpt.c     | 38 ---------------
 .../patch-3rdparty_lzma_CPP_7zip_7zip__gcc.mak     | 56 ----------------------
 .../patch-3rdparty_lzma_CPP_7zip_var__gcc.mak      | 12 -----
 .../patch-3rdparty_lzma_CPP_Windows_SystemInfo.cpp | 27 -----------
 emulators/mame/files/patch-3rdparty_lzma_C_7zCrc.c | 11 -----
 emulators/mame/files/patch-3rdparty_lzma_C_Aes.c   | 11 -----
 .../mame/files/patch-3rdparty_lzma_C_Sha256Opt.c   | 11 -----
 8 files changed, 3 insertions(+), 170 deletions(-)

diff --git a/emulators/mame/Makefile b/emulators/mame/Makefile
index 1950cd4d4c53..937f034ebcf0 100644
--- a/emulators/mame/Makefile
+++ b/emulators/mame/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	mame
 DISTVERSION=	0.288
+PORTREVISION=	1
 CATEGORIES=	emulators games
 
 MAINTAINER=	laurent@FreeBSD.org
@@ -68,6 +69,8 @@ MAKE_ENV=	FORCE_DRC_C_BACKEND=1 \
 		USE_SYSTEM_LIB_ZSTD=1 \
 		USE_TAPTUN=1
 
+# for LZMA AES support
+CFLAGS_armv7=	-march=armv8-a+aes
 CFLAGS_aarch64=	-march=armv8-a+crc+crypto
 
 EXTRACT_AFTER_ARGS=	${_DIST_EXCLUDES:S,^,--exclude ,}
@@ -189,10 +192,6 @@ _TOOLS_MANUALS=		-name *.1 -depth 1 -type f -and -not -type d -and -not \
 MAKE_ENV+=		PTR64=1
 .endif
 
-.if ${ARCH} == aarch64 || ${ARCH} == armv7
-EXTRA_PATCHES+=		${PATCHDIR}/extra-patch-3rdparty_lzma_C_AesOpt.c
-.endif
-
 # Compiling with -pg (PROFILE) causes the linker to run out of memory on i386,
 # build with less profiling data:
 .if ${ARCH:Mi386}
diff --git a/emulators/mame/files/extra-patch-3rdparty_lzma_C_AesOpt.c b/emulators/mame/files/extra-patch-3rdparty_lzma_C_AesOpt.c
deleted file mode 100644
index d9c7100bbe30..000000000000
--- a/emulators/mame/files/extra-patch-3rdparty_lzma_C_AesOpt.c
+++ /dev/null
@@ -1,38 +0,0 @@
---- 3rdparty/lzma/C/AesOpt.c.orig	2023-05-30 17:50:57 UTC
-+++ 3rdparty/lzma/C/AesOpt.c
-@@ -506,7 +506,7 @@ VAES_COMPAT_STUB (AesCtr_Code_HW)
- #endif // ! USE_INTEL_VAES
- 
- 
--#elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE)
-+#elif defined(MY_CPU_ARM64) && defined(MY_CPU_LE)
- 
-   #if defined(__clang__)
-     #if (__clang_major__ >= 8) // fix that check
-@@ -773,4 +773,25 @@ AES_FUNC_START2 (AesCtr_Code_HW)
- 
- #endif // USE_HW_AES
- 
--#endif // MY_CPU_ARM_OR_ARM64
-+#else
-+
-+/* no USE_HW_AES */
-+
-+#pragma message("AES  HW_SW stub was used")
-+
-+#define AES_TYPE_keys UInt32
-+#define AES_TYPE_data Byte
-+
-+#define AES_FUNC_START(name) \
-+    void MY_FAST_CALL name(UInt32 *p, Byte *data, size_t numBlocks) \
-+
-+#define AES_COMPAT_STUB(name) \
-+    AES_FUNC_START(name); \
-+    AES_FUNC_START(name ## _HW) \
-+    { name(p, data, numBlocks); }
-+
-+AES_COMPAT_STUB (AesCbc_Encode)
-+AES_COMPAT_STUB (AesCbc_Decode)
-+AES_COMPAT_STUB (AesCtr_Code)
-+
-+#endif
diff --git a/emulators/mame/files/patch-3rdparty_lzma_CPP_7zip_7zip__gcc.mak b/emulators/mame/files/patch-3rdparty_lzma_CPP_7zip_7zip__gcc.mak
deleted file mode 100644
index 95685c6207ec..000000000000
--- a/emulators/mame/files/patch-3rdparty_lzma_CPP_7zip_7zip__gcc.mak
+++ /dev/null
@@ -1,56 +0,0 @@
---- 3rdparty/lzma/CPP/7zip/7zip_gcc.mak.orig	2024-02-01 08:45:29 UTC
-+++ 3rdparty/lzma/CPP/7zip/7zip_gcc.mak
-@@ -24,7 +24,7 @@ ifneq ($(CC), xlc)
- 
- 
- ifneq ($(CC), xlc)
--CFLAGS_WARN_WALL = -Werror -Wall -Wextra
-+CFLAGS_WARN_WALL =
- endif
- 
- # for object file
-@@ -32,14 +32,14 @@ CFLAGS_BASE_LIST = -c
- # -save-temps
- CFLAGS_BASE_LIST = -c
- # CFLAGS_BASE_LIST = -S
--CFLAGS_BASE = -O2 $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \
-- -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-+CFLAGS_BASE = $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \
-+ -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-  -fPIC
- 
- FLAGS_FLTO = -ffunction-sections
- FLAGS_FLTO = -flto
- FLAGS_FLTO =
--# 
-+#
- # -DZ7_AFFINITY_DISABLE
- 
- 
-@@ -110,7 +110,7 @@ PROGPATH_STATIC = $(O)/$(PROG)s$(SHARED_EXT)
- 
- PROGPATH = $(O)/$(PROG)$(SHARED_EXT)
- PROGPATH_STATIC = $(O)/$(PROG)s$(SHARED_EXT)
--	
-+
- ifdef IS_MINGW
- 
- ifdef MSYSTEM
-@@ -130,7 +130,7 @@ CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE
- CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE
- # -Wno-delete-non-virtual-dtor
- 
-- 
-+
- else
- 
- RM = rm -f
-@@ -142,7 +142,7 @@ DEL_OBJ_EXE = -$(RM) $(PROGPATH) $(PROGPATH_STATIC) $(
- 
- # LOCAL_LIBS=-lpthread
- # LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
--LIB2 = -lpthread -ldl
-+LIB2 = -lpthread
- 
- 
- endif
diff --git a/emulators/mame/files/patch-3rdparty_lzma_CPP_7zip_var__gcc.mak b/emulators/mame/files/patch-3rdparty_lzma_CPP_7zip_var__gcc.mak
deleted file mode 100644
index cfd83c3c7213..000000000000
--- a/emulators/mame/files/patch-3rdparty_lzma_CPP_7zip_var__gcc.mak
+++ /dev/null
@@ -1,12 +0,0 @@
---- 3rdparty/lzma/CPP/7zip/var_gcc.mak.orig	2023-05-30 17:50:57 UTC
-+++ 3rdparty/lzma/CPP/7zip/var_gcc.mak
-@@ -6,7 +6,7 @@ IS_ARM64=
- CROSS_COMPILE=
- MY_ARCH=
- USE_ASM=
--CC=$(CROSS_COMPILE)gcc
--CXX=$(CROSS_COMPILE)g++
-+CC=$(CC)
-+CXX=$(CXX)
- 
- # -march=armv8-a+crc+crypto
diff --git a/emulators/mame/files/patch-3rdparty_lzma_CPP_Windows_SystemInfo.cpp b/emulators/mame/files/patch-3rdparty_lzma_CPP_Windows_SystemInfo.cpp
deleted file mode 100644
index 25e855008237..000000000000
--- a/emulators/mame/files/patch-3rdparty_lzma_CPP_Windows_SystemInfo.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
---- 3rdparty/lzma/CPP/Windows/SystemInfo.cpp.orig	2023-05-30 17:50:57 UTC
-+++ 3rdparty/lzma/CPP/Windows/SystemInfo.cpp
-@@ -20,6 +20,15 @@
- 
- #include <sys/auxv.h>
- 
-+#if defined(__FreeBSD__)
-+unsigned long getauxval(unsigned long type)
-+{
-+    unsigned long aux = 0;
-+    elf_aux_info(type, &aux, sizeof(aux));
-+    return aux;
-+}
-+#endif
-+
- // #undef AT_HWCAP    // to debug
- // #undef AT_HWCAP2   // to debug
- 
-@@ -36,7 +45,7 @@
- #endif
- */
- 
--#ifdef MY_CPU_ARM_OR_ARM64
-+#if defined(MY_CPU_ARM_OR_ARM64) && !defined(__FreeBSD__)
- #include <asm/hwcap.h>
- #endif
- #endif
diff --git a/emulators/mame/files/patch-3rdparty_lzma_C_7zCrc.c b/emulators/mame/files/patch-3rdparty_lzma_C_7zCrc.c
deleted file mode 100644
index 5047b6809214..000000000000
--- a/emulators/mame/files/patch-3rdparty_lzma_C_7zCrc.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- 3rdparty/lzma/C/7zCrc.c.orig	2023-05-30 17:50:57 UTC
-+++ 3rdparty/lzma/C/7zCrc.c
-@@ -71,7 +71,7 @@ UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *
- 
- #ifdef MY_CPU_LE
- 
--#if defined(MY_CPU_ARM_OR_ARM64)
-+#if defined(MY_CPU_ARM64)
- 
- // #pragma message("ARM*")
- 
diff --git a/emulators/mame/files/patch-3rdparty_lzma_C_Aes.c b/emulators/mame/files/patch-3rdparty_lzma_C_Aes.c
deleted file mode 100644
index 8c66c80c974f..000000000000
--- a/emulators/mame/files/patch-3rdparty_lzma_C_Aes.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- 3rdparty/lzma/C/Aes.c.orig	2023-05-30 17:50:57 UTC
-+++ 3rdparty/lzma/C/Aes.c
-@@ -55,7 +55,7 @@ static Byte InvS[256];
- 
- #ifdef MY_CPU_X86_OR_AMD64
-   #define USE_HW_AES
--#elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE)
-+#elif defined(MY_CPU_ARM) && defined(MY_CPU_LE)
-   #if defined(__clang__)
-     #if (__clang_major__ >= 8) // fix that check
-       #define USE_HW_AES
diff --git a/emulators/mame/files/patch-3rdparty_lzma_C_Sha256Opt.c b/emulators/mame/files/patch-3rdparty_lzma_C_Sha256Opt.c
deleted file mode 100644
index eeafd8402ec6..000000000000
--- a/emulators/mame/files/patch-3rdparty_lzma_C_Sha256Opt.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- 3rdparty/lzma/C/Sha256Opt.c.orig	2025-09-24 14:56:11 UTC
-+++ 3rdparty/lzma/C/Sha256Opt.c
-@@ -202,7 +202,7 @@ void Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8
- 
- #endif // USE_HW_SHA
- 
--#elif defined(MY_CPU_ARM_OR_ARM64)
-+#elif defined(MY_CPU_ARM64)
- 
-   #if defined(__clang__)
-     #if (__clang_major__ >= 8) // fix that check


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a31bfbc.3ec80.145034da>