[Pythonmac-SIG] psyco and Mac OS X i386

Michael Glassford glassfordm at hotmail.com
Tue Jun 6 22:27:04 CEST 2006


Bob Ippolito wrote:
[snip]
> I went through and confirmed that indeed the stack alignment is the  
> reason why psyco doesn't function properly on Mac OS X i386. You can  
> confirm this by running the bpnn.py example under gdb. You'll  
> eventually get an Illegal Instruction (GP(0) exception) during the  
> call to the libSystem version of pow(). The reason for this is that  
> pow() uses a SSE2 instruction that requires 16 byte alignment  
> (specifically, "movapd %xmm1,-104(%ebp)") and the way that psyco set  
> up the stack does not make it so.
> 
> I can't really commit any more time to fixing this right now, but  
> Armin has said that:
> 
> arigo: let me see, you need to hack in c/i386/iencoding.h
> arigo: CALL_SET_ARG_* macros
> arigo: and CALL_C_FUNCTION*
> arigo: or maybe better yet, add a new macro CALL_ALIGN_STACK(nb_args)
> arigo: which should be called before any of the CALL_SET_ARG
> 
> The IA-32 calling conventions for Mac OS X are documented here:
> http://developer.apple.com/documentation/DeveloperTools/Conceptual/ 
> LowLevelABI/Articles/IA32.html
> 
> And you'll probably also want to look at the disassembly (otool -tVv  
> is good for this, or just gcc -S) of a trivial C program or two to  
> get an idea of what it looks like in practice.

OK, thanks. I was just trying it out because 
http://mail.python.org/pipermail/pythonmac-sig/2006-April/017153.html 
seemed to indicate that it might "just work". Apparently that's not the 
case, and I don't think I have the time right now to do what it sound 
like would be necessary. Maybe a project for another day.

Mike



More information about the Pythonmac-SIG mailing list