Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Aug 2026 09:29:48 +0000
From:      Robert Clausecker <fuz@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 4744e66b618a - 2026Q3 - games/CWR-CE: fix build on armv7
Message-ID:  <6a74540c.199ee.4d87779@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch 2026Q3 has been updated by fuz:

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

commit 4744e66b618a15a657bc75bd1ce78ee610616650
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2026-08-04 16:20:06 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-08-06 09:29:29 +0000

    games/CWR-CE: fix build on armv7
    
     - disabled pre-compiled headers to work around a long-standing clang bug
     - apply sse2neon workaround to arm, too
     - fix assumption of size_t being 64 bits in a hash calculation
     - improve architecture name reporting
    
    See also:       https://github.com/llvm/llvm-project/issues/69524
    Approved by:    portmgr (build fix blanket)
    MFH:            2026Q3
    
    (cherry picked from commit 319393265d592e3bd5b422959190a12bd4e02033)
---
 games/CWR-CE/Makefile                               |  9 +++++++--
 ...patch-engine_Poseidon_Asset_Cache_AssetCache.hpp | 21 +++++++++++++++++++++
 ...atch-engine_Poseidon_Foundation_Math_Quatrix.hpp | 13 ++++++-------
 ...ch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp | 11 +++++------
 ...h-engine_Poseidon_Graphics_Rendering_ColorsK.hpp | 10 +++++-----
 .../files/patch-engine_Poseidon_UI_OptionsUIApp.cpp | 17 ++++++++++++++---
 6 files changed, 58 insertions(+), 23 deletions(-)

diff --git a/games/CWR-CE/Makefile b/games/CWR-CE/Makefile
index 2ef97966212d..b5171862b4dd 100644
--- a/games/CWR-CE/Makefile
+++ b/games/CWR-CE/Makefile
@@ -11,6 +11,9 @@ MAINTAINER=	olivier@FreeBSD.org
 COMMENT=	Arma: Cold War Assault - Remastered Community Edition
 WWW=		https://github.com/ofpisnotdead-com/CWR-CE
 
+ONLY_FOR_ARCHS=	aarch64 amd64 armv7 i386
+ONLY_FOR_ARCHS_REASON=	requires SSE intrinsics, light porting work for other architectures
+
 LICENSE=	GPLv3+
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
@@ -51,7 +54,9 @@ SUB_FILES=	pkg-message
 CMAKE_ARGS=	-DVCPKG_MANIFEST_MODE=OFF \
 		-DCMAKE_DISABLE_FIND_PACKAGE_VCPKG=ON
 
-CMAKE_OFF=	POSEIDON_DISABLE_PCH POSEIDON_BUILD_FUZZERS
+CMAKE_OFF=	POSEIDON_BUILD_FUZZERS
+# https://github.com/llvm/llvm-project/issues/69524
+CMAKE_ON=	POSEIDON_DISABLE_PCH
 CXXFLAGS_powerpc64le=	-DNO_WARN_X86_INTRINSICS
 
 PLIST_FILES=	bin/PoseidonGame \
@@ -79,7 +84,7 @@ do-install:
 
 .include <bsd.port.pre.mk>
 
-.if ${ARCH} == aarch64
+.if ${ARCH} == aarch64 || ${ARCH:Marmv?}
 BUILD_DEPENDS+=	${LOCALBASE}/include/sse2neon.h:devel/sse2neon
 .endif
 
diff --git a/games/CWR-CE/files/patch-engine_Poseidon_Asset_Cache_AssetCache.hpp b/games/CWR-CE/files/patch-engine_Poseidon_Asset_Cache_AssetCache.hpp
new file mode 100644
index 000000000000..89d4e94a17cc
--- /dev/null
+++ b/games/CWR-CE/files/patch-engine_Poseidon_Asset_Cache_AssetCache.hpp
@@ -0,0 +1,21 @@
+--- engine/Poseidon/Asset/Cache/AssetCache.hpp.orig	2026-08-04 10:49:53 UTC
++++ engine/Poseidon/Asset/Cache/AssetCache.hpp
+@@ -70,15 +70,15 @@ struct StringKeyHash
+     // FNV-1a over lowercased bytes — case-insensitive hash matching the equality above.
+     size_t operator()(const StringKey& k) const noexcept
+     {
+-        size_t h = 14695981039346656037ULL;
++        uint64_t h = 14695981039346656037ULL;
+         for (char c : k.value)
+         {
+             const unsigned char u  = static_cast<unsigned char>(c);
+             const unsigned char lc = (u >= 'A' && u <= 'Z') ? u + 32 : u;
+-            h ^= static_cast<size_t>(lc);
++            h ^= static_cast<uint64_t>(lc);
+             h *= 1099511628211ULL;
+         }
+-        return h;
++        return static_cast<size_t>(h);
+     }
+ };
+ 
diff --git a/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_Quatrix.hpp b/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_Quatrix.hpp
index f8d12f18b07d..69d9f63f7dc2 100644
--- a/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_Quatrix.hpp
+++ b/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_Quatrix.hpp
@@ -1,17 +1,16 @@
---- engine/Poseidon/Foundation/Math/Quatrix.hpp.orig
+--- engine/Poseidon/Foundation/Math/Quatrix.hpp.orig	2026-08-04 10:46:28 UTC
 +++ engine/Poseidon/Foundation/Math/Quatrix.hpp
-@@ -1,10 +1,14 @@
+@@ -1,9 +1,13 @@
  #pragma once
-
-+#ifdef __aarch64__
+ 
++#if defined(__aarch64__) || defined(__arm__)
 +#include <sse2neon.h>
 +#else
  #ifdef _MSC_VER
  #include <intrin.h>
  #else
  #include <xmmintrin.h>
- #endif
 +#endif
-
+ #endif
+ 
  namespace Poseidon::Foundation
- {
diff --git a/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp b/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp
index 3174dc07d403..de2336fb41bc 100644
--- a/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp
+++ b/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp
@@ -1,18 +1,17 @@
---- engine/Poseidon/Foundation/Math/V3QuadsP3.cpp.orig
+--- engine/Poseidon/Foundation/Math/V3QuadsP3.cpp.orig	2026-08-04 10:46:28 UTC
 +++ engine/Poseidon/Foundation/Math/V3QuadsP3.cpp
-@@ -7,11 +7,15 @@
+@@ -7,10 +7,14 @@
  #include <Poseidon/Foundation/Math/V3Quads.hpp>
  #include <Poseidon/Graphics/Core/TLVertex.hpp>
  #include <Poseidon/Foundation/Math/Math3D.hpp>
-+#ifdef __aarch64__
++#if defined(__aarch64__) || defined(__arm__)
 +#include <sse2neon.h>
 +#else
  #ifdef _MSC_VER
  #include <intrin.h> // For MMX intrinsics
  #else
  #include <x86intrin.h>
- #endif
 +#endif
-
+ #endif
+ 
  #if defined __ICL
- #define _COMPILER_CAN_PIII 1
diff --git a/games/CWR-CE/files/patch-engine_Poseidon_Graphics_Rendering_ColorsK.hpp b/games/CWR-CE/files/patch-engine_Poseidon_Graphics_Rendering_ColorsK.hpp
index 378e6a5abbd3..4adfda08ae38 100644
--- a/games/CWR-CE/files/patch-engine_Poseidon_Graphics_Rendering_ColorsK.hpp
+++ b/games/CWR-CE/files/patch-engine_Poseidon_Graphics_Rendering_ColorsK.hpp
@@ -1,14 +1,14 @@
---- engine/Poseidon/Graphics/Rendering/ColorsK.hpp.orig
+--- engine/Poseidon/Graphics/Rendering/ColorsK.hpp.orig	2026-08-04 10:46:27 UTC
 +++ engine/Poseidon/Graphics/Rendering/ColorsK.hpp
-@@ -2,7 +2,11 @@
+@@ -2,7 +2,11 @@ int toInt(double f);
  int toInt(float fval);
  int toInt(double f);
-
-+#ifdef __aarch64__
+ 
++#if defined(__aarch64__) || defined(__arm__)
 +#include <sse2neon.h>
 +#else
  #include <xmmintrin.h>
 +#endif
  #include <Poseidon/Foundation/platform.hpp>
  #include <Poseidon/Foundation/Math/MathDefs.hpp>
-
+ 
diff --git a/games/CWR-CE/files/patch-engine_Poseidon_UI_OptionsUIApp.cpp b/games/CWR-CE/files/patch-engine_Poseidon_UI_OptionsUIApp.cpp
index 56222be713a7..99bd9abac1b8 100644
--- a/games/CWR-CE/files/patch-engine_Poseidon_UI_OptionsUIApp.cpp
+++ b/games/CWR-CE/files/patch-engine_Poseidon_UI_OptionsUIApp.cpp
@@ -1,11 +1,22 @@
---- engine/Poseidon/UI/OptionsUIApp.cpp.orig
+--- engine/Poseidon/UI/OptionsUIApp.cpp.orig	2026-08-06 09:21:54 UTC
 +++ engine/Poseidon/UI/OptionsUIApp.cpp
-@@ -120,6 +120,8 @@
+@@ -119,8 +119,18 @@ RString GetAppVersion()
  {
  #if defined(_M_X64) || defined(__x86_64__)
      const char* platform = "x64";
+-#else
 +#elif defined(__aarch64__)
 +    const char* platform = "aarch64";
- #else
++#elif defined(__arm__)
++    const char* platform = "arm";
++#elif defined(__powerpc64__)
++    const char* platform = "powerpc64";
++#elif defined(__powerpc__)
++    const char* platform = "powerpc";
++#elif defined(__i386__)
      const char* platform = "x86";
++#else
++    const char* platform = "unknown";
  #endif
+ 
+     RString renderer = GEngine ? GEngine->GetRendererName() : "No renderer";


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a74540c.199ee.4d87779>