gh-123748: Add conditional compilation rules to allow HACL SIMD256 to be compiled on universal#123989
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add modifications to the compilation of hashlib to restore the ability to generate a universal build.
#119316 added an implementation of Blake2 to hashlib. That implementation compiles fine on single architecture macOS builds (both x86_64 and ARM64, as verified by CI); but universal2 builds generate a compilation error because the SIMD256 algorithm can be compiled on x86_64, but can't be compiled on ARM64. Since both architectures are compiled in a single pass, autoconf by itself can't detect or control how to include (or exclude) the SIMD256 module.
This PR:
Hacl_Hash_Blake2b_Simd256_universal2.cfile that conditionally#includesHacl_Hash_Blake2b_Simd256.c`. This keeps the Python additions isolated, allowing the original HACL sources to be used (and updated) as-is._universal2wrapper variant if compiling on universal, along with configure logging to identify when this occursblake2module.cthat disables theHACL_CAN_COMPILE_SIMD256symbol if on ARM64. On a pure ARM64 compile, this will never be executed; but in a universal build, it will.Fixes#123748.
/cc @msprotz