You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS: configure does not support linking against a non-system libffi #155813
On macOS, the configure script does not provide a way to link _ctypes against a non-system libffi.
Although LIBFFI_CFLAGS and LIBFFI_LIBS are documented as configuration variables for libffi, configurefirst checks for the system libffi from Apple's SDK and if found overwrites these variables.
The pkg-config based check, which does preserve these variables, is never run when the system libffi is detected.
The confusing --with-system-ffi option, removed in Python 3.12 (#100544), provided a way to invoke the pkg-config based configuration on macOS, bypassing the detection of the SDK libffi.
I ran into this while updating python-build-standalone to use the standard extension configuration in 3.12+ (astral-sh/python-build-standalone#1180). Other than patching configure the best option seemed to be to use ac_cv_lib_ffi_ffi_call=no to force the check to fail.
I also found that conda-forge patches configure to get around this issue when building CPython.
@freakboy3742 could you review gh-156486? On macOS, configure overwrites LIBFFI_CFLAGS and LIBFFI_LIBS with the SDK values. This keeps them if you pass them in. Builds that don't set them are unchanged.
Activity
advitrocks9 commentedon Oct 8, 2026
@freakboy3742 could you review gh-156486? On macOS, configure overwrites LIBFFI_CFLAGS and LIBFFI_LIBS with the SDK values. This keeps them if you pass them in. Builds that don't set them are unchanged.