GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — MacOS: skip bundled libffi on non-x86_64 by bjia56 · Pull Request #342 · python-cmake-buildsystem/python-cmake-buildsystem

Conversation

@bjia56

@bjia56 bjia56 commented Sep 27, 2023

Copy link
Copy Markdown
Contributor

When cross compiling for arm64 Macs, the bundled cpython libffi throws an unsupported cpu error. This change makes it so that Mac compilation skips the bundled libffi if a system libffi was requested.

This change also now makes it possible to build universal python binaries for x86_64/arm64, though that also requires pre-compiling dependencies (including libffi) from source for both architectures.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

theartful reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
bjia56 added 2 commits September 26, 2023 23:32
@bjia56
allow using system ffi on macos
c45d712
@bjia56
typo
3ae8684
@bjia56

bjia56 commented Sep 27, 2023

Copy link
Copy Markdown
Contributor Author

I see from the CI tests that this ended up disabling ctypes on regular x86_64 macos, will tweak to restore prior behavior.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bjia56
restore x86_64 behavior
53d5a76
@bjia56 bjia56 changed the title MacOS: skip bundled libffi if a system one is provided MacOS: skip bundled libffi on non-x86_64 Sep 27, 2023
@bjia56 bjia56 mentioned this pull request Dec 19, 2023
Add support for Python 3.10 #345
Closed
@theartful

theartful commented Sep 14, 2025

Copy link
Copy Markdown

What's the status on this? I was about to do a PR doing exactly the same thing, but then found out you already did it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

theartful
theartful reviewed Sep 14, 2025
View reviewed changes
Comment thread cmake/extensions/CMakeLists.txt
${SRC_DIR}/Modules/_ctypes/darwin
DEFINITIONS MACOSX
)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")

@theartful theartful Sep 14, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm testing this PR, and trying to build python on an arm macos for x86_64, and then for arm64 (I made a wrong review that I deleted before, disregard it if you saw it).

I failed locally to build for x86_64 on an arm machine (ctypes didn't work), since I get CMAKE_SYSTEM_PROCESSOR = arm64, while CMAKE_OSX_ARCHITECTURES = x86_64.

I think it's better to check only for CMAKE_OSX_ARCHITECTURES

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

1 more reviewer
@theartful theartful theartful left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@bjia56 @theartful
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.