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>
This commit is contained in:
Corinna Vinschen 2020-02-28 14:31:56 +01:00
parent f5357141ad
commit a834dc1ba9
2 changed files with 6 additions and 21 deletions

View File

@ -16,20 +16,12 @@ extern int main (int argc, char **argv);
void cygwin_crt0 (int (*main) (int, char **)); void cygwin_crt0 (int (*main) (int, char **));
#ifdef __i386__
__attribute__ ((force_align_arg_pointer))
#endif
void void
mainCRTStartup () 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); cygwin_crt0 (main);
/* These are never actually called. They are just here to force the inclusion /* These are never actually called. They are just here to force the inclusion

View File

@ -19,19 +19,12 @@ unsigned threadfunc_ix[8];
static bool dll_finished_loading; static bool dll_finished_loading;
#define OLDFUNC_OFFSET -1 #define OLDFUNC_OFFSET -1
#ifdef __i386__
__attribute__ ((force_align_arg_pointer))
#endif
static void WINAPI static void WINAPI
threadfunc_fe (VOID *arg) 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); _cygtls::call ((DWORD (*) (void *, void *)) TlsGetValue (_my_oldfunc), arg);
} }