[d3d9] D3D9 state tracker crashes due to stack misalignment if Mesa is compiled with -mfpmath=sse
Submitted by Itzamna
Assigned to mes..@..op.org
Description
Description: The "Nine" D3D9 state tracker crashes when Wine loads any D3D program if Mesa is compiled with -mfpmath=sse. This is because the Linux ABI assumes a stack alignment to 16 bytes, whereas the Win32 ABI assumes a stack alignment to 4 bytes. This causes a stack misalignment and thus a general protection fault.
Additional information: Also see the following external bug reports:
https://bugs.winehq.org/show_bug.cgi?id=22475 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838
Specifications: OS: Gentoo GNU/Linux x86_64 Kernel version: Linux 4.0.4-hardened-r3 Mesa version: 10.6.0
Solution: The crashes no longer occur when Mesa's stack is realigned to 4 bytes. Therefore, always pass -mstackrealign to CFLAGS if -mfpmath=sse is enabled; this should probably be handled in the configure script.
Version: 10.6