summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/miscfuncs.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-01-09 14:19:56 +0000
committerCorinna Vinschen <corinna@vinschen.de>2012-01-09 14:19:56 +0000
commitcde9b54e7192bae4dce903c8d39129d31c703cd9 (patch)
treefc34a8adff0ad48b2b7f6122f6d5743263773133 /winsup/cygwin/miscfuncs.cc
parentdf8c8e18eb9b74133e12c15124c87f4fc576f506 (diff)
downloadcygnal-cde9b54e7192bae4dce903c8d39129d31c703cd9.tar.gz
cygnal-cde9b54e7192bae4dce903c8d39129d31c703cd9.tar.bz2
cygnal-cde9b54e7192bae4dce903c8d39129d31c703cd9.zip
* miscfuncs.cc (thread_wrapper): Make sure stack is 16 byte aligned
to make gcc-3 compiled pthread applications happy.
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 9aae6aa8b..c6e37942d 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -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\