summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorLawrence D'Anna <lawrence_danna@apple.com>2020-07-09 18:39:23 -0700
committerLawrence D'Anna <lawrence_danna@apple.com>2020-07-09 18:39:23 -0700
commit6684336eafc9aafebbccb8f48c3b82cc913b3aa8 (patch)
tree3a8c0bb1bea225de15c2e3724b79c9465c723a92 /setup.py
parentfc9349e8aa5a533ff51f5ec6c592e8024f2d727e (diff)
downloadcffi-6684336eafc9aafebbccb8f48c3b82cc913b3aa8.tar.gz
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
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py3
1 files changed, 2 insertions, 1 deletions
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()