From 549b877275d9104cc313a0b714548b58cb3fdd69 Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Thu, 9 Jul 2020 20:12:58 -0700 Subject: only trust ffi_closure_alloc on arm --- c/_cffi_backend.c | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c index 5c5fe45..ed89753 100644 --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -84,7 +84,7 @@ * known that on the NetBSD kernel, a different strategy is used which * should not be open to the fork() bug. */ -#ifdef __NetBSD__ +#if defined(__NetBSD__) || (CFFI_LIBFFI_FROM_MACOS && (defined(__arm__) || defined(__arm64__))) # define CFFI_TRUST_LIBFFI #endif diff --git a/setup.py b/setup.py index fc8d705..217504a 100644 --- a/setup.py +++ b/setup.py @@ -152,7 +152,7 @@ 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_LIBFFI_FROM_MACOS', '1'), ('HAVE_FFI_PREP_CIF_VAR', '1')] libraries += ['ffi'] else: -- cgit v1.2.1