Prerequisites
Description
There are some compilation errors relating to recently added x86 CPUID detection code.
ClangCL (Clang 20.1.8):
- Looks like
<intrin.h> should be included in files that call __cpuid. (I guess MSVC magically recognizes __cpuid without a header, but ClangCL needs the header.)
<...>\cpp\lib\libtomcrypt\src\hashes\sha2\sha256_desc.c(12,4): error : call to undeclared library function '__cpuid' with type 'void (int *, int)'; <...>
<...>\cpp\lib\libtomcrypt\src\hashes\sha2\sha256_desc.c(12,4): message : include the header <intrin.h> or explicitly provide a declaration for '__cpuid' <...>
MinGW-UCRT64 (GCC 15.2.0) / MinGW-Clang64 (Clang 21.1.7):
- Looks like
asm should be changed to __asm__, to allow building without GNU C extensions.
- I wonder if this issue also manifests on other x86 targets (e.g. Linux) that compile with
-std=c##.
<...>/cpp/lib/libtomcrypt/src/hashes/sha2/sha256_desc.c:18:5: error: use of undeclared identifier 'asm'
18 | asm volatile ("cpuid"
| ^~~
I am open to submitting a fix if desired, or an existing contributor could do so. Thanks for the recent work on adding x86 acceleration to the library.
Version
a68fa19 (top of develop tree May 19)
Prerequisites
Description
There are some compilation errors relating to recently added x86 CPUID detection code.
ClangCL (Clang 20.1.8):
<intrin.h>should be included in files that call__cpuid. (I guess MSVC magically recognizes__cpuidwithout a header, but ClangCL needs the header.)MinGW-UCRT64 (GCC 15.2.0) / MinGW-Clang64 (Clang 21.1.7):
asmshould be changed to__asm__, to allow building without GNU C extensions.-std=c##.I am open to submitting a fix if desired, or an existing contributor could do so. Thanks for the recent work on adding x86 acceleration to the library.
Version
a68fa19 (top of develop tree May 19)