Skip to content

Commit d5581a8

Browse files
Scottcjnclaude
andcommitted
Fix AltiVec bool keyword conflict with -Dbool=_Bool
GCC with -maltivec and -std=c11 redefines 'bool' as '__vector __bool int' in some contexts, breaking all uses of scalar bool in the HACL* BLAKE2 SIMD128 code. The -Dbool=_Bool flag forces the C99 scalar boolean type, which is what HACL* intends. This is a known GCC/AltiVec interaction: the AltiVec extension adds 'bool' as a keyword for vector boolean types, conflicting with C99/C11 stdbool.h. The -Dbool=_Bool workaround is used by several other projects including FFmpeg and OpenSSL. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 40e72eb commit d5581a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

configure

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8133,7 +8133,7 @@ then
81338133
dnl x86 SSE not available; check for PowerPC AltiVec/VSX (Power8+).
81348134
dnl HACL* libintvector.h has a complete vec128 implementation for __powerpc64__.
81358135
AX_CHECK_COMPILE_FLAG([-maltivec -mvsx],[
8136-
[LIBHACL_SIMD128_FLAGS="-maltivec -mvsx -flax-vector-conversions -Wno-return-type"]
8136+
[LIBHACL_SIMD128_FLAGS="-maltivec -mvsx -flax-vector-conversions -Wno-return-type -Dbool=_Bool"]
81378137
81388138
AC_DEFINE([_Py_HACL_CAN_COMPILE_VEC128], [1], [
81398139
HACL* library can compile SIMD128 implementations])

0 commit comments

Comments
 (0)