Skip to content
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

gh-99108: Disable HACL SIMD code on older versions of Android #124304

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

mhsmith
Copy link
Member

@mhsmith mhsmith commented Sep 21, 2024

The build is currently failing on Android x86-64:

/home/buildbot/android-sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android21-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 -I/home/buildbot/git/python/cpython/cross-build/x86_64-linux-android/prefix/include  -I/home/buildbot/git/python/cpython/cross-build/x86_64-linux-android/prefix/include  -s
td=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../../../Include/internal -I../../../Include/internal/mimalloc -IObjects -IIncl
ude -IPython -I. -I../../../Include   -fPIC -fPIC -DLINUX_NO_EXPLICIT_BZERO -msse -msse2 -msse3 -msse4.1 -msse4.2 -DHACL_CAN_COMPILE_VEC128 -o Modules/_hacl/Hacl_Hash_Blake2s_Simd128.o ../../../Modules/_hacl/Hacl_Hash_Blake2s_Sim
d128.c
../../../Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c:589:40: error: call to undeclared library function 'aligned_alloc' with type 'void *(unsigned long, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    (Lib_IntVector_Intrinsics_vec128 *)KRML_ALIGNED_MALLOC(16,
                                       ^
../../../Modules/_hacl/include/krml/internal/target.h:133:39: note: expanded from macro 'KRML_ALIGNED_MALLOC'
#    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)

This is because aligned_alloc was only added to Android in API level 28, while we're building against level 21. So this PR disables the SIMD code completely when building against older Android versions.

@mhsmith
Copy link
Member Author

mhsmith commented Sep 21, 2024

!buildbot android

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @mhsmith for commit 198a0b9 🤖

The command will test the builders whose names match following regular expression: android

The builders matched are:

  • AMD64 Android PR
  • aarch64 Android PR

@mhsmith mhsmith mentioned this pull request Sep 21, 2024
6 tasks
@mhsmith
Copy link
Member Author

mhsmith commented Sep 21, 2024

The x86-64 builder wasn't ready earlier, but it's passed now.

@mhsmith mhsmith mentioned this pull request Sep 23, 2024
4 tasks
Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@freakboy3742 freakboy3742 merged commit 41e7992 into python:main Sep 23, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants