diff --git a/racket/src/foreign/README b/racket/src/foreign/README index ea4635381e..7436d0e443 100644 --- a/racket/src/foreign/README +++ b/racket/src/foreign/README @@ -23,6 +23,8 @@ Local changes: * In "x86/ffi.c" for Win32, don't try to align stack for stdcall, fastcall, or thiscall. + * In "x86/freebsd.S", align the stack pointer to 16 bytes. + ========== libffi_msvc directory ===================================== This directory is synced from the CTypes repository diff --git a/racket/src/foreign/libffi/src/x86/freebsd.S b/racket/src/foreign/libffi/src/x86/freebsd.S index afde513164..cba17a538d 100644 --- a/racket/src/foreign/libffi/src/x86/freebsd.S +++ b/racket/src/foreign/libffi/src/x86/freebsd.S @@ -49,6 +49,9 @@ ffi_call_SYSV: movl 16(%ebp),%ecx subl %ecx,%esp + /* Align the stack pointer to 16-bytes */ + andl $0xfffffff0, %esp + movl %esp,%eax /* Place all of the ffi_prep_args in position */