Skip to content

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

Merged
freakboy3742 merged 1 commit into
python:mainfrom
mhsmith:android-hacl-simd
Sep 23, 2024
Merged

gh-99108: Disable HACL SIMD code on older versions of Android#124304
freakboy3742 merged 1 commit into
python:mainfrom
mhsmith:android-hacl-simd

Conversation

@mhsmith

@mhsmithmhsmith commented Sep 21, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

!buildbot android

@bedevere-bot

Copy link
Copy Markdown

🤖 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

@mhsmithmhsmith mentioned this pull request Sep 21, 2024
6 tasks
@mhsmith

Copy link
Copy Markdown
MemberAuthor

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

@mhsmithmhsmith mentioned this pull request Sep 23, 2024
4 tasks

@freakboy3742freakboy3742 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mhsmith@bedevere-bot@freakboy3742