Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-130478: Fixed HACL compilation failure on macOS Silicon #134177

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
wants to merge 0 commits into from

Conversation

naizhao
Copy link

@naizhao naizhao commented May 18, 2025

Fix: Prevent HACL compilation failure on macOS Silicon when not building universal binaries (#130478)

Problem:

In Python 3.14.0b1, compiling on macOS Silicon without the --enable-universalsdk flag resulted in a compilation error: "unknown type name 'Lib_IntVector_Intrinsics_vec256'". This occurred because the previous fix for a similar issue (#123748, #130366, #129043) in the configure and configure.ac scripts relied on the $UNIVERSAL_ARCHS variable for conditional checks. However, $UNIVERSAL_ARCHS is only set to "universal2" when --enable-universalsdk is explicitly provided. When this flag is absent (as is the case when only targeting the native arm64 architecture), $UNIVERSAL_ARCHS defaults to "32-bit", causing the conditional logic to fail and the necessary definitions for HACL not to be included.

Solution:

This PR modifies the configure and configure.ac scripts to use the $build_cpu and $build_vendor variables instead of $UNIVERSAL_ARCHS for determining the target architecture. This approach ensures that the necessary HACL definitions are included when building on macOS with an arm64 architecture, even when --enable-universalsdk is not specified.

The PR provides a quick fix based on $build_cpu and $build_vendor. While functional, this PR aims for a more robust and maintainable solution by directly checking for the "aarch64" architecture in $build_cpu.

Testing:

This fix has been tested successfully on macOS Silicon (arm64) when building Python 3.14.0b1 without the --enable-universalsdk flag. The compilation now completes without the "unknown type name 'Lib_IntVector_Intrinsics_vec256'" error.

Related Issue:

@python-cla-bot
Copy link

python-cla-bot bot commented May 18, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented May 18, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@naizhao naizhao changed the title Fixed: HACL compilation failure on macOS Silicon GH-130478: Fixed HACL compilation failure on macOS Silicon May 18, 2025
configure.ac Outdated
@@ -7936,7 +7936,7 @@ then
# available on x86_64. However, performance of the HACL SIMD128 implementation
# isn't great, so it's disabled on ARM64.
AC_MSG_CHECKING([for HACL* SIMD128 implementation])
if test "$UNIVERSAL_ARCHS" == "universal2"; then
if [[ "$build_cpu" == "aarch64" && "$build_vendor" == "apple" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Please keep the "UNIVERSAL_ARCHS" test as well and use test instead of [[ as it's more portable.

@bedevere-app
Copy link

bedevere-app bot commented May 18, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

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.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.