Building on Windows or Ubuntu 22.10 with LLVM Clang 15 or GCC 12.2.0, the following error occurs when attempting to compile lib/sha512.c:
F:/Projects/Bootlie/contrib/SymCrypt/lib/sha512.c:1036:33: error: request for member 'm128i_u64' in something not a structure or union
This error occurs because Clang and GCC define the 128-bit XMM data types as typedef'd vectors rather than as a struct/union like defined in the UCRT. I.e. Clang defines these types as such:
typedef long long __m128i __attribute__((__vector_size__(16), __aligned__(16)));
A quick fix for little endian systems is to simply pointer-cast a given 128-bit XMM data type variable to an unsigned 64-bit integer.
Please consider adding a simple compiler check to pointer-cast to an unsigned __int64 type for Clang and GCC toolchains. Below is a patch:
Building on Windows or Ubuntu 22.10 with LLVM Clang 15 or GCC 12.2.0, the following error occurs when attempting to compile
lib/sha512.c
:F:/Projects/Bootlie/contrib/SymCrypt/lib/sha512.c:1036:33: error: request for member 'm128i_u64' in something not a structure or union
This error occurs because Clang and GCC define the 128-bit XMM data types as typedef'd vectors rather than as a struct/union like defined in the UCRT. I.e. Clang defines these types as such:
typedef long long __m128i __attribute__((__vector_size__(16), __aligned__(16)));
A quick fix for little endian systems is to simply pointer-cast a given 128-bit XMM data type variable to an unsigned 64-bit integer.
Please consider adding a simple compiler check to pointer-cast to an
unsigned __int64
type for Clang and GCC toolchains. Below is a patch: