Re: [fpc-devel] Stack alignment on i386

2011-12-28 Thread Florian Klaempfl
Am 22.12.2011 17:56, schrieb Jonas Maebe: Keeping an aligned stack requires completely different code generation inside the calling routine, you can't implement that on a call-by-call basis. Intel defined once how procedure entry/exit code should look like for procedures doing 16 byte

Re: [fpc-devel] Stack alignment on i386

2011-12-22 Thread Sven Barth
Am 18.12.2011 14:05, schrieb Jonas Maebe: 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

Re: [fpc-devel] Stack alignment on i386

2011-12-22 Thread Jonas Maebe
On 22 Dec 2011, at 15:12, Sven Barth wrote: Hmm... I have thought a bit. Do you (or someone else) think it's feasible (and useful) to add a procedure modifier that allows you to specify the stack alignment that should be used when calling that procedure? (of course this modifier should be

Re: [fpc-devel] Stack alignment on i386

2011-12-22 Thread Sven Barth
Am 22.12.2011 15:31, schrieb Jonas Maebe: On 22 Dec 2011, at 15:12, Sven Barth wrote: Hmm... I have thought a bit. Do you (or someone else) think it's feasible (and useful) to add a procedure modifier that allows you to specify the stack alignment that should be used when calling that

Re: [fpc-devel] Stack alignment on i386

2011-12-22 Thread Jonas Maebe
On 22 Dec 2011, at 15:40, Sven Barth wrote: i386/Win32 should be adjusted then as well, because I suspect very much that this is the reason for my problems with OpenCV... (on Windows as well as on Linux) From what I understand from

Re: [fpc-devel] Stack alignment on i386

2011-12-22 Thread Sven Barth
Am 22.12.2011 15:57, schrieb Jonas Maebe: On 22 Dec 2011, at 15:40, Sven Barth wrote: i386/Win32 should be adjusted then as well, because I suspect very much that this is the reason for my problems with OpenCV... (on Windows as well as on Linux) From what I understand from

Re: [fpc-devel] Stack alignment on i386

2011-12-22 Thread Marco van de Voort
In our previous episode, Sven Barth said: 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? In such case, it is better to let the vendor recompile it

Re: [fpc-devel] Stack alignment on i386

2011-12-22 Thread 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

Re: [fpc-devel] Stack alignment on i386

2011-12-22 Thread Jonas Maebe
On 22 Dec 2011, at 17:18, Sven Barth wrote: Am 22.12.2011 17:04, schrieb Jonas Maebe: 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

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread Sven Barth
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

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread Sven Barth
Am 19.12.2011 10:02, schrieb Den Jean: On Monday 19 December 2011 08:04:30 zeljko wrote: How ? The binding now aligns the stack before calling the Qt libraries Would you please post an example how exactly you aligned the stack? Regards, Sven ___

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread zeljko
On Tuesday 20 of December 2011 09:52:20 Sven Barth wrote: Am 19.12.2011 10:02, schrieb Den Jean: On Monday 19 December 2011 08:04:30 zeljko wrote: How ? The binding now aligns the stack before calling the Qt libraries Would you please post an example how exactly you aligned the stack?

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread Sven Barth
Am 20.12.2011 10:34, schrieb zeljko: On Tuesday 20 of December 2011 09:52:20 Sven Barth wrote: Am 19.12.2011 10:02, schrieb Den Jean: On Monday 19 December 2011 08:04:30 zeljko wrote: How ? The binding now aligns the stack before calling the Qt libraries Would you please

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread Den Jean
On Tuesday 20 December 2011 10:36:12 Sven Barth wrote: Ok, that doesn't help me then, because I'm directly using OpenCV which I didn't (and don't want to) compile myself. that is why I wrote that to interface with library binaries of a distribution (compiled by gcc),fpc does not provide an

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread Den Jean
On Sunday 18 December 2011 14:05:00 Jonas Maebe wrote: since Darwin/i386 also requires a 16-byte aligned stack Does this mean I can drop these stack alignment options for Osx 32 and 64 bit? Anyhow my old OsX has gcc 4.0.1 and does not have all these options. It has mstackrealign but not the

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread Jonas Maebe
On 20 Dec 2011, at 23:35, Den Jean wrote: On Sunday 18 December 2011 14:05:00 Jonas Maebe wrote: since Darwin/i386 also requires a 16-byte aligned stack Does this mean I can drop these stack alignment options for Osx 32 and 64 bit? Yes. Any program that does not have a 16 byte alliged

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread Den Jean
On Tuesday 20 December 2011 23:51:28 Jonas Maebe wrote: Yes. Any program that does not have a 16 byte alliged stack on Mac OS X/i386 will crash almost immediately, because the dynamic linker enforces it. You also don't need it on any x86-64 platform, because they all have always required a 16

Re: [fpc-devel] Stack alignment on i386

2011-12-20 Thread zeljko
On Tuesday 20 of December 2011 23:35:52 Den Jean wrote: On Sunday 18 December 2011 14:05:00 Jonas Maebe wrote: since Darwin/i386 also requires a 16-byte aligned stack Does this mean I can drop these stack alignment options for Osx 32 and 64 bit? Anyhow my old OsX has gcc 4.0.1 and does not

Re: [fpc-devel] Stack alignment on i386

2011-12-19 Thread Den Jean
On Monday 19 December 2011 08:04:30 zeljko wrote: How ? The binding now aligns the stack before calling the Qt libraries ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] Stack alignment on i386

2011-12-19 Thread 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

[fpc-devel] Stack alignment on i386

2011-12-18 Thread Den Jean
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

Re: [fpc-devel] Stack alignment on i386

2011-12-18 Thread Jonas Maebe
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

Re: [fpc-devel] Stack alignment on i386

2011-12-18 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: 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

Re: [fpc-devel] Stack alignment on i386

2011-12-18 Thread Den Jean
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

Re: [fpc-devel] Stack alignment on i386

2011-12-18 Thread zeljko
On Sunday 18 of December 2011 21:07:51 Den Jean wrote: 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. How