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>
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
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);
}