Skip to content
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

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

Closed

Conversation

lawrence-danna-apple
Copy link
Contributor

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

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
Contributor

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

@lawrence-danna-apple
Copy link
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
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