Skip to content

HACL Blake2 implementation does not check for aligned_alloc availability on macOS #128134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zanieb opened this issue Dec 20, 2024 · 4 comments
Closed
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@zanieb
Copy link
Contributor

zanieb commented Dec 20, 2024

Bug report

Bug description:

In python-build-standalone, we support macOS 10.9. While this is really old and we can definitely bump to a newer version, we often find symbol references without guards when building CPython.

In this case, aligned_alloc is referenced in the HACL Blake2 implementation. aligned_alloc is only available in macOS 10.15+.

cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:523:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]

Expand for build logs...
cpython-3.14> clang  -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/ncursesw -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/uuid -Werror=unguarded-availability-new   -flto=thin -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-instr-generate -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/ncursesw -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/uuid -Werror=unguarded-availability-new   -DPy_BUILD_CORE_BUILTIN -c ./Modules/cjkcodecs/_codecs_jp.c -o Modules/cjkcodecs/_codecs_jp.o
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:523:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>   523 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   524 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:523:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>   521 |   Lib_IntVector_Intrinsics_vec128
cpython-3.14>   522 |   *buf =
cpython-3.14>   523 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   524 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   525 |   memset(buf, 0U, 4U * sizeof (Lib_IntVector_Intrinsics_vec128));
cpython-3.14>   526 |   return buf;
cpython-3.14>       |
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> clang  -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/ncursesw -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/uuid -Werror=unguarded-availability-new   -flto=thin -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-instr-generate -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -I/var/folders/6p/k5sd5z7j./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:535:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>   535 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   536 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 431b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/ncursesw -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/uuid -Werror=unguarded-availability-new   -DPy_BUILD_CORE_BUILTIN -c ./Modules/cjkcodecs/_codecs_kr.c -o Modules/cjkcodecs/_codecs_kr.o
cpython-3.14> U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:535:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>   533 |   Lib_IntVector_Intrinsics_vec128
cpython-3.14>   534 |   *wv =
cpython-3.14>   535 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   536 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:540:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>   540 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   541 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:540:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>   538 |   Lib_IntVector_Intrinsics_vec128
cpython-3.14>   539 |   *b =
cpython-3.14>   540 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   541 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   542 |   memset(b, 0U, 4U * sizeof (Lib_IntVector_Intrinsics_vec128));
cpython-3.14>   543 |   Hacl_Hash_Blake2s_Simd128_block_state_t
cpython-3.14>   544 |   block_state =
cpython-3.14>   545 |     {
cpython-3.14>   546 |       .fst = kk.key_length,
cpython-3.14>   547 |       .snd = kk.digest_length,
cpython-3.14>   548 |       .thd = kk.last_node,
cpython-3.14>   549 |       .f3 = { .fst = wv, .snd = b }
cpython-3.14>   550 |     };
cpython-3.14>       |
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> clang  -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/ncursesw -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/uuid -Werror=unguarded-availability-new   -flto=thin -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-instr-generate -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/ncursesw -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/uuid -Werror=unguarded-availability-new   -DPy_BUILD_CORE_BUILTIN -c ./Modules/cjkcodecs/_codecs_tw.c -o Modules/cjkcodecs/_codecs_tw.o
cpython-3.14> clang  -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/ncursesw -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/uuid -Werror=unguarded-availability-new   -flto=thin -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-instr-generate -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/ncursesw -I/var/folders/6p/k5sd5z7j31b31pq4lhn0l8d80000gn/T/tmp71yh_yjb/tools/deps/include/uuid -Werror=unguarded-availability-new   -DPy_BUILD_CORE_BUILTIN -c ./Modules/_contextvarsmodule.c -o Modules/_contextvarsmodule.o
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:1206:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>  1206 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1207 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:1206:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>  1204 |   Lib_IntVector_Intrinsics_vec128
cpython-3.14>  1205 |   *wv =
cpython-3.14>  1206 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1207 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:1211:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>  1211 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1212 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:1211:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>  1209 |   Lib_IntVector_Intrinsics_vec128
cpython-3.14>  1210 |   *b =
cpython-3.14>  1211 |     (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1212 |       sizeof (Lib_IntVector_Intrinsics_vec128) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1213 |   memset(b, 0U, 4U * sizeof (Lib_IntVector_Intrinsics_vec128));
cpython-3.14>  1214 |   Hacl_Hash_Blake2s_Simd128_block_state_t
cpython-3.14>  1215 |   block_state =
cpython-3.14>  1216 |     {
cpython-3.14>  1217 |       .fst = i.key_length,
cpython-3.14>  1218 |       .snd = i.digest_length,
cpython-3.14>  1219 |       .thd = i.last_node,
cpython-3.14>  1220 |       .f3 = { .fst = wv, .snd = b }
cpython-3.14>  1221 |     };
cpython-3.14>       |
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> 5 errors generated.
cpython-3.14> make[2]: *** [Modules/_hacl/Hacl_Hash_Blake2s_Simd128.o] Error 1
cpython-3.14> make[2]: *** Waiting for unfinished jobs....
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:530:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>   530 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   531 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:530:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>   528 |   Lib_IntVector_Intrinsics_vec256
cpython-3.14>   529 |   *buf =
cpython-3.14>   530 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   531 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   532 |   memset(buf, 0U, 4U * sizeof (Lib_IntVector_Intrinsics_vec256));
cpython-3.14>   533 |   return buf;
cpython-3.14>       |
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:542:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>   542 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   543 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:542:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>   540 |   Lib_IntVector_Intrinsics_vec256
cpython-3.14>   541 |   *wv =
cpython-3.14>   542 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   543 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:547:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>   547 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   548 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:547:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>   545 |   Lib_IntVector_Intrinsics_vec256
cpython-3.14>   546 |   *b =
cpython-3.14>   547 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   548 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>   549 |   memset(b, 0U, 4U * sizeof (Lib_IntVector_Intrinsics_vec256));
cpython-3.14>   550 |   Hacl_Hash_Blake2b_Simd256_block_state_t
cpython-3.14>   551 |   block_state =
cpython-3.14>   552 |     {
cpython-3.14>   553 |       .fst = kk.key_length,
cpython-3.14>   554 |       .snd = kk.digest_length,
cpython-3.14>   555 |       .thd = kk.last_node,
cpython-3.14>   556 |       .f3 = { .fst = wv, .snd = b }
cpython-3.14>   557 |     };
cpython-3.14>       |
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:1250:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>  1250 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1251 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:1250:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>  1248 |   Lib_IntVector_Intrinsics_vec256
cpython-3.14>  1249 |   *wv =
cpython-3.14>  1250 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1251 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:1255:40: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
cpython-3.14>  1255 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1256 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:7: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.9.0
cpython-3.14>    65 | void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size
(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
cpython-3.14>       |       ^
cpython-3.14> ./Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c:1255:40: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
cpython-3.14>  1253 |   Lib_IntVector_Intrinsics_vec256
cpython-3.14>  1254 |   *b =
cpython-3.14>  1255 |     (Lib_IntVector_Intrinsics_vec256 *)KRML_ALIGNED_MALLOC(32,
cpython-3.14>       |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1256 |       sizeof (Lib_IntVector_Intrinsics_vec256) * 4U);
cpython-3.14>       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpython-3.14>  1257 |   memset(b, 0U, 4U * sizeof (Lib_IntVector_Intrinsics_vec256));
cpython-3.14>  1258 |   Hacl_Hash_Blake2b_Simd256_block_state_t
cpython-3.14>  1259 |   block_state =
cpython-3.14>  1260 |     {
cpython-3.14>  1261 |       .fst = i.key_length,
cpython-3.14>  1262 |       .snd = i.digest_length,
cpython-3.14>  1263 |       .thd = i.last_node,
cpython-3.14>  1264 |       .f3 = { .fst = wv, .snd = b }
cpython-3.14>  1265 |     };
cpython-3.14>       |
cpython-3.14> ./Modules/_hacl/include/krml/internal/target.h:137:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
cpython-3.14>   137 | #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
cpython-3.14>       |                                       ^~~~~~~~~~~~~
cpython-3.14> 5 errors generated.

Related:

Similar:

CPython versions tested on:

3.14

Operating systems tested on:

macOS

@zanieb zanieb added the type-bug An unexpected behavior, bug, or error label Dec 20, 2024
@zanieb
Copy link
Contributor Author

zanieb commented Dec 20, 2024

As a meta-note, I'm interested in submitting a patch to fix this and have opened #128135 to help avoid future regressions.

@picnixz
Copy link
Member

picnixz commented Dec 20, 2024

I think this should be addressed upstream. Everything under Modules/_hacl/* is managed externally except the refresh.sh script and the README (and perhaps other text files).

cc @msprotz as our HACL* contact


Well.. technically, we could do something and not include those headers? since it seems to only concern the SIMD-128 version, we could add a configure check for that. Tell me which way is preferred.

@zanieb
Copy link
Contributor Author

zanieb commented Dec 20, 2024

Sorry I just looked at the code and noticed that this was patched in #127932 (a couple days ago) and is a duplicate of #127897

@picnixz
Copy link
Member

picnixz commented Dec 20, 2024

Closing as a duplicate of #127897.

@picnixz picnixz closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2024
@picnixz picnixz added the build The build process and cross-build label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants