From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15240 invoked by alias); 1 Apr 2013 11:18:47 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 14874 invoked by uid 89); 1 Apr 2013 11:18:39 -0000 X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_40,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 01 Apr 2013 11:18:09 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id r31BI5Eb003538 for ; Mon, 1 Apr 2013 13:18:06 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id r31BI5OV023760; Mon, 1 Apr 2013 13:18:05 +0200 (CEST) Date: Mon, 01 Apr 2013 11:18:00 -0000 Message-Id: <201304011118.r31BI5OV023760@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: libffi-discuss@sourceware.org Subject: [PATCH] Fix stack alignment on *BSD/i386 X-SW-Source: 2013/txt/msg00127.txt.bz2 The same thing was done to the "generic" SystemV ABI code back in 2010. Without this, executing code that uses SSE instructions with data on the stack will fail. 2013-04-01 Mark Kettenis * src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to 16-bytes. Index: src/x86/freebsd.S =================================================================== --- src/x86/freebsd.S (revision 197303) +++ src/x86/freebsd.S (working copy) @@ -49,6 +49,9 @@ 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 */