]> sourceware.org Git - newlib-cygwin.git/commitdiff
* miscfuncs.cc (thread_wrapper): Make sure stack is 16 byte aligned
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 9 Jan 2012 14:19:56 +0000 (14:19 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 9 Jan 2012 14:19:56 +0000 (14:19 +0000)
to make gcc-3 compiled pthread applications happy.

winsup/cygwin/ChangeLog
winsup/cygwin/miscfuncs.cc

index 9948fec09a4aab98ea59da72d0c5c69109f07152..ee9e6723b914abed87c1ec6109e775e97de9def8 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-09  Corinna Vinschen  <corinna@vinschen.de>
+
+       * miscfuncs.cc (thread_wrapper): Make sure stack is 16 byte aligned
+       to make gcc-3 compiled pthread applications happy.
+
 2012-01-08  Christopher Faylor  <me.cygwin2011@cgf.cx>
 
        * dtable.cc (dtable::stdio_init): Always initialize console when we
index 9aae6aa8bc5ba5a08368db85077192d35d3ebfff..c6e37942d86a0c37651a2006cc4e044ae759bc5a 100644 (file)
@@ -1,7 +1,7 @@
 /* miscfuncs.cc: misc funcs that don't belong anywhere else
 
    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
+   2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -525,6 +525,10 @@ thread_wrapper (VOID *arg)
           subl  $4, %%ebx             # Subtract another 4 bytes    \n\
           movl  %%ebx, %%esp          # Set esp                     \n\
           xorl  %%ebp, %%ebp          # Set ebp to 0                \n\
+          # Make gcc 3.x happy and align the stack so that it is    \n\
+          # 16 byte aligned right before the final call opcode.     \n\
+          andl  $-16, %%esp           # 16 bit align                \n\
+          addl  $-12, %%esp           # 12 bytes + 4 byte arg = 16  \n\
           # Now we moved to the new stack.  Save thread func address\n\
           # and thread arg on new stack                             \n\
           pushl %%ecx                 # Push thread arg onto stack  \n\
This page took 0.037157 seconds and 5 git commands to generate.