winpthreads/src/thread.c: Force aligning ESP on 16-byte boundaries on x86.
ESP isn't guaranteed to be aligned on 16-byte boundaries if the thread is
created with _beginthreadex(), but modern GCC assumes it is and generates
code that requires it. For example, the MOVDQA instruction may be used to
load XMMWORDs from the stack when SSE2 is enabled, which results in segment
faults if the address isn't correctly aligned.

Reported-by: Aleksey Vasenev
Reference: https://sourceforge.net/p/mingw-w64/mailman/message/35294616/

Signed-off-by: Liu Hao <lh_mouse@126.com>
(cherry picked from commit 2d36585b035289542975cfba559e193cb2c8d5ec)
Signed-off-by: Jonathan Yong <10walls@gmail.com>
1 file changed