You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build failure on Elbrus architecture (e2k) with LCC compiler in zstd/lib/common/bitstream.h (DEBUG_STATIC_ASSERT) #324
When installing the package via pip on the Elbrus (e2k) architecture, the compilation fails due to a false positive trigger in the compile-time static assert macro. The LCC compiler throws an error stating that the array size must be greater than zero during the size comparison of bitContainer and U32.
Error Log
lcc: "zstd/lib/common/debug.h", line 39: error #94: the size of an array must be greater than zero
#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
^
in expansion of macro "DEBUG_STATIC_ASSERT" at line 168 of
"zstd/lib/common/bitstream.h"
DEBUG_STATIC_ASSERT(sizeof(bitContainer) == sizeof(U32));
1 error detected in the compilation of "zstd/lib/common/entropy_common.c".
error: command '/usr/bin/e2k-alt-linux-gcc' failed with exit code 1
Suggested Solution
To prevent breaking compatibility with mainstream compilers (GCC, Clang, MSVC) on x86/ARM while enabling successful builds on Elbrus, we can conditionally bypass or adapt this macro when the __LCC__ compiler flag is detected.
Modifying zstd/lib/common/debug.h as follows resolves the issue:
Activity
sergey-dryabzhinsky commentedon Sep 4, 2026
As the source of
zstd/lib/common/debug.his from upstream facebook/zstd, I can't modify it. I suggest you to push changes to upstream zstd lib.dmitry-lipetsk commentedon Sep 4, 2026
Hello,
Thank you for your answer.
I found this PR there:
meta/zstd#4730