From 54cabf924030ec19d6c04acba69d9836f837d78f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 19 Sep 2007 18:36:35 -0600 Subject: [PATCH] align SP to 16 byte boundary on Darwin in cdecl.S --- src/cdecl.S | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cdecl.S b/src/cdecl.S index 3f418ffc1a..25b8c9ff5c 100644 --- a/src/cdecl.S +++ b/src/cdecl.S @@ -1,9 +1,14 @@ #include "types.h" .text -.globl cdeclCall +#ifdef __APPLE__ +.globl _cdeclCall +_cdeclCall: +#else +.globl cdeclCall cdeclCall: +#endif pushl %ebp movl %esp,%ebp @@ -14,6 +19,14 @@ cdeclCall: // reserve space for arguments movl 16(%ebp),%ecx + +#ifdef __APPLE__ + // align to a 16 byte boundary on Darwin + addl $15,%ecx + andl $0xFFFFFFF0,%ecx + addl $8,%ecx +#endif + subl %ecx,%esp // copy arguments into place