Description
Bug report
Bug description:
I'm getting a lot of:
/opt/wasi-sdk/bin/clang -c -I../../Modules/_hacl -I../../Modules/_hacl/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -Wno-unused-value -Wno-empty-body -Qunused-arguments -Wno-parentheses-equality -Wno-unused-value -Wno-empty-body -Qunused-arguments -Wno-parentheses-equality -std=c11 -Wextra -Wno-unused-parameter -Wno-int-conversion -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -msimd128 -msse -msse2 -msse3 -msse4.1 -msse4.2 -DHACL_CAN_COMPILE_VEC128 -o Modules/_hacl/Hacl_Hash_Blake2s_Simd128.o ../../Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c
In file included from ../../Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:26:
In file included from ../../Modules/_hacl/internal/Hacl_Hash_Blake2s_Simd128.h:40:
../../Modules/_hacl/internal/../Hacl_Hash_Blake2s_Simd128.h:55:3: error: unknown type name 'Lib_IntVector_Intrinsics_vec128'
That seems to be defined at:
cpython/Modules/_hacl/libintvector.h
Line 30 in 5e91684
But that whole header file is guarded by:
cpython/Modules/_hacl/libintvector.h
Line 22 in 5e91684
Unfortunately, if you add defined(__wasi__)
to that guard you then get:
/opt/wasi-sdk-24.0-x86_64-linux/lib/clang/18/include/immintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
14 | #error "This header is only meant to be used on x86 and x64 architecture"
| ^
To me that suggests the check at:
Lines 7854 to 7906 in 5e91684
is too broad since the header files don't work on non-x86 architectures.
This probably requires either a CPU/platform check before checking the flag support or an explicit opt-out for at least WASI.
(And I have no idea why CI isn't running into this problem while I am locally; bad configure caching via
cpython/.github/workflows/reusable-wasi.yml
Lines 63 to 68 in 5e91684
CPython versions tested on:
CPython main branch
Operating systems tested on:
Other