[fpc-devel] Stack alignment on i386

Den Jean Den.Jean at telenet.be
Sun Dec 18 21:07:51 CET 2011


On Sunday 18 December 2011 14:05:00 Jonas Maebe wrote:
> That's because it changes the alignment of procedures (code), rather than
> that of the stack. You cannot change this setting via a switch, it's
> hardcoded in the compiler as part of the ABI.
The problem is that gcc already changed this long ago,
and to interface with library binaries of a distribution (compiled by gcc),
fpc does not provide an option. For the Qt binding I hope I solved it, 
so I am not in need of anything.
> Changing this will also require quite a few changes in the RTL as well to
> be safe (e.g., in case cmem is used and if the glibc memory manager one
> day would use sse), because the RTL contains lots of assembler code that
> doesn't care at all about stack alignment. The places where there's an
> {$ifndef darwin} in i386-specific files can probably help, since
> Darwin/i386 also requires a 16-byte aligned stack. The assembler startup
> code for Linux/i386 probably also needs to be adapted.
> Overall, it's not a trivial c> hange to make properly.
Thanks for the information.

regards,

Den Jean




More information about the fpc-devel mailing list