[fpc-devel] Stack alignment on i386

Sven Barth pascaldragon at googlemail.com
Tue Dec 20 09:51:45 CET 2011


Am 19.12.2011 13:14, schrieb Henry Vermaak:
> On 18/12/11 12:37, Den Jean wrote:
>> Hi,
>>
>> to interface with c libraries containing SSE code,
>> the stack must be aligned to 16 bytes.
>>
>> Currently the default -mpreferred-stack-boundary=num of gcc provides
>> for this.
>>
>> However current fpc 2.4.4 does not align the stack as such.
>> I do not know if this correct or not when reading things like:
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838#c8
>> http://groups.google.com/group/ia32-abi/browse_thread/thread/4f9b3e5069943bf1
>>
>>
>
> Ow, we hit this problem. We are calling a library that uses opencv
> (where SSE instructions are used). Luckily we can add -mstackrealign to
> the CFLAGS of our library. People without an "interface" lib will be in
> trouble, though.

And now I finally know why OpenCV is so hard to handle when used from 
within FPC... -.-

Regards,
Sven




More information about the fpc-devel mailing list