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

bpo-41100: use system libffi for Mac OS 10.15 and up#21239

Closed
lawrence-danna-apple wants to merge 2 commits into
python:masterpython/cpython:masterfrom
lawrence-danna-apple:postback-0003lawrence-danna-apple/cpython:postback-0003Copy head branch name to clipboard
Closed

bpo-41100: use system libffi for Mac OS 10.15 and up#21239
lawrence-danna-apple wants to merge 2 commits into
python:masterpython/cpython:masterfrom
lawrence-danna-apple:postback-0003lawrence-danna-apple/cpython:postback-0003Copy head branch name to clipboard

Conversation

@lawrence-danna-apple

@lawrence-danna-apple lawrence-danna-apple commented Jun 30, 2020

Copy link
Copy Markdown
Contributor

The vendored libffi sources do not support arm64 Mac OS. Recent versions of mac OS include libffi, including Mac OS 11 on arm64.

This updates setup.py to default to the system libffi on Mac OS 10.15 and forward. It also updates
detect_ctypes to prefer finding libffi in the Xcode SDK, rather than /usr/include

Also, when the Mac OS libffi is used, it removes malloc_closure.c from the sourcs for _ctypes.
libffi already comes with ffi_closure_alloc, and it is not compatible with the one in
malloc_closure.c

https://bugs.python.org/issue41100

This updates setup.py to default to the system libffi on Mac OS 10.15 and forward.   It also updates
detect_ctypes to prefer finding libffi in the Xcode SDK, rather than /usr/include

Also, when the Mac OS libffi is used, it removes malloc_closure.c from the sourcs for _ctypes.
libffi already comes with ffi_closure_alloc, and it is not compatible with the one in
malloc_closure.c
@ronaldoussoren

Copy link
Copy Markdown
Contributor

Do you know how far back libffi is included with macOS and part of the SDK?

@lawrence-danna-apple

Copy link
Copy Markdown
Contributor Author

Do you know how far back libffi is included with macOS and part of the SDK?

Looks like it goes back to at least 10.11, but 10.15 is the first one that has ffi_closure_alloc

@lawrence-danna-apple

Copy link
Copy Markdown
Contributor Author

superseded by #21249

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.

4 participants

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