aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2020-02-28 14:31:56 +0100
committerCorinna Vinschen <corinna@vinschen.de>2020-02-28 15:02:09 +0100
commita834dc1ba923d33a87f0dc3be0e23a9aa81603b8 (patch)
tree6f47f182304879874348ecd2affaf0153440769d
parentf5357141ade956d8057e76b0a5e58f5069a6d399 (diff)
downloadnewlib-a834dc1ba923d33a87f0dc3be0e23a9aa81603b8.zip
newlib-a834dc1ba923d33a87f0dc3be0e23a9aa81603b8.tar.gz
newlib-a834dc1ba923d33a87f0dc3be0e23a9aa81603b8.tar.bz2
Cygwin: 32 bit: remove old code to 16 bit align stack
Aligning the stack pointer using an asm statement isn't any longer supported. gcc-9.2.0 generates the following warning: init.cc:33:46: error: listing the stack pointer register '%esp' in a clobber list is deprecated [-Werror=deprecated] [...] init.cc:33:46: note: the value of the stack pointer after an 'asm' statement must be the same as it was before the statement Replace the asm expression with the gcc function attribute `force_align_arg_pointer'. This aligns the stack exactly as required. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/crt0.c14
-rw-r--r--winsup/cygwin/init.cc13
2 files changed, 6 insertions, 21 deletions
diff --git a/winsup/cygwin/crt0.c b/winsup/cygwin/crt0.c
index fee4b2e..ec7959a 100644
--- a/winsup/cygwin/crt0.c
+++ b/winsup/cygwin/crt0.c
@@ -16,20 +16,12 @@ extern int main (int argc, char **argv);
void cygwin_crt0 (int (*main) (int, char **));
+#ifdef __i386__
+__attribute__ ((force_align_arg_pointer))
+#endif
void
mainCRTStartup ()
{
-#ifdef __i386__
-#if __GNUC_PREREQ(6,0)
-#pragma GCC diagnostic ignored "-Wframe-address"
-#endif
- (void)__builtin_return_address(1);
-#if __GNUC_PREREQ(6,0)
-#pragma GCC diagnostic pop
-#endif
- asm volatile ("andl $-16,%%esp" ::: "%esp");
-#endif
-
cygwin_crt0 (main);
/* These are never actually called. They are just here to force the inclusion
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index 851a7ff..7787b16 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -19,19 +19,12 @@ unsigned threadfunc_ix[8];
static bool dll_finished_loading;
#define OLDFUNC_OFFSET -1
+#ifdef __i386__
+__attribute__ ((force_align_arg_pointer))
+#endif
static void WINAPI
threadfunc_fe (VOID *arg)
{
-#ifdef __i386__
-#if __GNUC_PREREQ(6,0)
-#pragma GCC diagnostic ignored "-Wframe-address"
-#endif
- (void)__builtin_return_address(1);
-#if __GNUC_PREREQ(6,0)
-#pragma GCC diagnostic pop
-#endif
- asm volatile ("andl $-16,%%esp" ::: "%esp");
-#endif
_cygtls::call ((DWORD (*) (void *, void *)) TlsGetValue (_my_oldfunc), arg);
}