[Python-Dev] HEADS UP: Compilation risk with new GCC 4.5.0

James Y Knight foom at fuhm.net
Wed May 12 16:27:09 CEST 2010


On May 12, 2010, at 10:01 AM, Jesus Cea wrote:
> On 12/05/10 15:39, James Y Knight wrote:
>> While assuming the stack is 16byte aligned is undeniably an
>> ABI-violation in GCC, at this point, it's surely simpler to just go
>> along: the new unofficial ABI for x86 is that the stack must always  
>> be
>> left in 16-byte alignment...
>
> You can not rule out other software embedding python inside, or
> callbacks from foreign code. For instance, Berkeley DB library can do
> callbacks to Python code.

So? When calling callback functions, the Berkeley DB library won't  
un-16byte-align the stack, will it? (Assuming it's been compiled with  
gcc in the last 10 years)

> Not all the universe is GCC based. For instance, Solaris system
> libraries are not compiled using GCC. The world is bigger that Linux/ 
> GCC.

If the Solaris compilers don't use 16byte-aligned stackframes, and GCC  
on Solaris/x86 also assumes 16byte-aligned stacks, I guess GCC on  
Solaris/x86 is pretty broken indeed. But for Linux/x86, stacks have  
been de-facto 16byte aligned for so long, you can *almost* excuse the  
ABI violation as unimportant.

But anyways, psyco should keep the stackframes 16byte aligned  
regardless, for performance reasons: even when accessing datatypes for  
which unaligned access doesn't crash, it's faster when it's aligned.

James


More information about the Python-Dev mailing list