Skip to content

Commit 3365ad8

Browse files
committed
aarch64: match Darwin stack slots to compiler ABI
1 parent 8c8b079 commit 3365ad8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/aarch64/ffi.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,12 @@ allocate_composite_to_stack (struct arg_state *state, void *stack,
417417
size_t alignment = ty->alignment;
418418
size_t size = ty->size;
419419

420-
#if defined (__APPLE__)
420+
/* Apple's ABI gives these composites full pointer-sized slots. The
421+
experimental GCC Darwin port instead packs them to their natural size;
422+
match the compiler ABI used to build libffi so calls and closures remain
423+
self-consistent. */
424+
#if defined (__APPLE__) \
425+
&& (!defined (__GNUC__) || defined (__clang__))
421426
alignment = FFI_ALIGN (alignment, sizeof (void *));
422427
size = FFI_ALIGN (size, sizeof (void *));
423428
#endif

0 commit comments

Comments
 (0)