-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fails on i386 with -march=nehalem or newer #468
Comments
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: ARM-software/astc-encoder#468 bkaradzic/bgfx#2929 (comment) PR: 278722 Approved by: yuri (maintainer timeout, 15 days)
That fix is broken - it's truncating the value to 32-bits before taking the popcount. Any reason you don't use the
|
I'm new to this, so I did it this way. |
Thanks for confirming - I'll get that in for 4.9. |
If, before writing the patch, I had read what the popcnt instructions do, I would have suggested the following patch:
:-) |
…and newer Previous patch truncating the value to 32-bits before taking the popcount. Upstream made correct patch: ARM-software/astc-encoder#468 (comment) This patch will be included in next release of the astc-encoder 4.9. Also we can apply this patch to misc/astc-encoder (4.7 in ports). PR: 278722 Fixes: 656401a (fix build on i386 with CPUTYPE=nehalem and newer)
Patch against main branch:
|
Fixed on main. |
I got this build error related to
popcnt
andi386
:FreeBSD 13.2 i386, llvm 14.0.5,
-march=nehalem
or newer, as a workaround I can use-march=penryn
to prevent usage ofpopcnt
.This patch work for me:
The text was updated successfully, but these errors were encountered: