Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 May 2024 17:38:31 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 278722] graphics/bgfx: build error on i386 with CPUTYPE=nehalem and newer
Message-ID:  <bug-278722-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278722

            Bug ID: 278722
           Summary: graphics/bgfx: build error on i386 with
                    CPUTYPE=3Dnehalem and newer
           Product: Ports & Packages
           Version: Latest
          Hardware: i386
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: yuri@freebsd.org
          Reporter: vvd@FreeBSD.org
          Assignee: yuri@freebsd.org
             Flags: maintainer-feedback?(yuri@freebsd.org)
 Attachment #250356 maintainer-approval?
             Flags:

Created attachment 250356
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D250356&action=
=3Dedit
Fix build error on i386 with CPUTYPE=3Dnehalem and newer

Tested on 13.2 i386 with CPUTYPE=3Dnehalem and newer:

/wrkdirs/usr/ports/graphics/bgfx/work/bgfx.cmake-1.127.8725-465/bimg/3rdpar=
ty/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.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
This patch work for me:

--- bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h.orig
+++ 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));
 #endif // defined(__MINGW32__)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
Reported upstream:
https://github.com/bkaradzic/bgfx/pull/2929#issuecomment-2093377116

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-278722-7788>