On 18 Dec 2011, at 13:37, Den Jean wrote:

> 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
> 
> I tried to change alignment with {$CODEALIGN 16} but this didn't work.

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.

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 change to make properly.


Jonas_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to