-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Problem
Building with GCC 13+ fails with alignment errors in blake2.h:
blake2.h:101:5: error: size of array element is not a multiple of its alignment
101 | blake2s_state S[8][1];
| ^~~~~~~~~~~~~
blake2.h:102:5: error: size of array element is not a multiple of its alignment
102 | blake2s_state R[1];
Cause
GCC 13 is stricter about alignment constraints. The blake2s_state and blake2b_state structs are declared with ALIGN(64) but their sizes are not multiples of 64 bytes. When these aligned structs are used in arrays inside #pragma pack(push, 1), GCC 13 rejects this as invalid.
Solution
Two changes needed:
- Remove
ALIGN(64)fromblake2s_stateandblake2b_statestruct definitions (not needed for reference implementation) - Move
#pragma pack(pop)before the parallel state structures (blake2sp_state,blake2bp_state) which contain arrays of the aligned types
Environment
- GCC 13.3.0 (Ubuntu 24.04)
- Affects clean builds from source
Related
- Issue GCC 13 optimization bug causes LYRA2REv2 hash failures - fix identified #141 - GCC 13 BMW256 optimization bug (separate issue, same compiler)
Metadata
Metadata
Assignees
Labels
No labels