git: 656401a10b46 - main - graphics/bgfx: fix build on i386 with CPUTYPE=nehalem and newer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 18 May 2024 14:10:18 UTC
The branch main has been updated by vvd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=656401a10b46a87dcc5f62b884da4ea4e10e74b2
commit 656401a10b46a87dcc5f62b884da4ea4e10e74b2
Author: Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2024-05-18 14:04:08 +0000
Commit: Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-05-18 14:04:08 +0000
graphics/bgfx: fix build on i386 with CPUTYPE=nehalem and newer
Build error:
/wrkdirs/usr/ports/graphics/bgfx/work/bgfx.cmake-1.127.8725-465/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h:1313:26: error: use of undeclared identifier '_mm_popcnt_u64'; did you mean '_mm_popcnt_u32'?
return static_cast<int>(_mm_popcnt_u64(v));
^~~~~~~~~~~~~~
_mm_popcnt_u32
/usr/lib/clang/14.0.5/include/popcntintrin.h:33:1: note: '_mm_popcnt_u32' declared here
_mm_popcnt_u32(unsigned int __A)
^
1 error generated.
Upstream issues:
https://github.com/ARM-software/astc-encoder/issues/468
https://github.com/bkaradzic/bgfx/pull/2929#issuecomment-2093377116
PR: 278722
Approved by: yuri (maintainer timeout, 15 days)
---
..._3rdparty_astc-encoder_source_astcenc__vecmathlib__sse__4.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/graphics/bgfx/files/patch-bimg_3rdparty_astc-encoder_source_astcenc__vecmathlib__sse__4.h b/graphics/bgfx/files/patch-bimg_3rdparty_astc-encoder_source_astcenc__vecmathlib__sse__4.h
new file mode 100644
index 000000000000..1f80efad67d4
--- /dev/null
+++ b/graphics/bgfx/files/patch-bimg_3rdparty_astc-encoder_source_astcenc__vecmathlib__sse__4.h
@@ -0,0 +1,10 @@
+--- bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h.orig 2024-03-28 05:00:55 UTC
++++ bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h
+@@ -1309,5 +1309,7 @@ ASTCENC_SIMD_INLINE int popcount(uint64_t v)
+ {
+ #if defined(__MINGW32__)
+ return static_cast<int>(__builtin_popcountll(v));
++#elif defined(__FreeBSD__) && !defined(__x86_64__)
++ return static_cast<int>(_mm_popcnt_u32(static_cast<uint32_t>(v)));
+ #else
+ return static_cast<int>(_mm_popcnt_u64(v));