From 6684336eafc9aafebbccb8f48c3b82cc913b3aa8 Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Thu, 9 Jul 2020 18:39:23 -0700 Subject: MacOS 11, arm64, ffi_prep_cif_var On Apple arm64, theABI for a variardic function is different than the ABI for a fixed-arg function, even of the same arg types. In order to account for this, CFFI must call ffi_prep_cif_var for variardic calls. see: https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index c28147e..fc8d705 100644 --- a/setup.py +++ b/setup.py @@ -152,7 +152,8 @@ else: if 'darwin' in sys.platform and macosx_deployment_target() >= (10, 15): # use libffi from Mac OS SDK extra_compile_args += ['-iwithsysroot/usr/include/ffi'] - define_macros += [('CFFI_TRUST_LIBFFI', '1')] + define_macros += [('CFFI_TRUST_LIBFFI', '1'), + ('HAVE_FFI_PREP_CIF_VAR', '1')] libraries += ['ffi'] else: use_pkg_config() -- cgit v1.2.1