[fpc-devel] Stack alignment on i386

Sven Barth pascaldragon at googlemail.com
Thu Dec 22 17:18:14 CET 2011

Am 22.12.2011 17:04, schrieb Jonas Maebe:
> On 22 Dec 2011, at 16:42, Sven Barth wrote:
>> While with OpenCV this issue might be solved by recompiling it (which
>> I'd yet need to look into, because I'm simply using the provided
>> binaries), what should be done about closed source code?
> Closed source code should be compiled with a compiler that respects the
> ABI by default. I guess most of it is compiled with Microsoft Visual
> Studio, which does presumably does that. I don't think that any compiler
> other than GCC can create code for Win32 that assumes a 16-byte aligned
> stack.

My mysterious OpenCV problems are with the MSVC version of the 
libraries... with the GCC variant I don't even reach the point of 
displaying a OpenCV window ^^

>> Somehow this motivates me more to add a "stackalignment" modifier...
> Then you would have to add this to all routines that may (directly or
> indirectly) a routine from a broken library.

Wouldn't it be sufficient to align the stack when calling a routine from 
such a library? (sorry for sounding naive here, but the requirements for 
stack alignment still puzzle me a bit)


More information about the fpc-devel mailing list