newlib/winsup/cygwin/crt0.c
Corinna Vinschen a834dc1ba9 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>
2020-02-28 15:02:09 +01:00

37 lines
1020 B
C

/* crt0.c
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
/* In the following ifdef'd i386 code, the FPU precision is set to 80 bits
and all FPU exceptions are masked. The former is needed to make long
doubles work correctly. The latter causes the FPU to generate NaNs and
Infinities instead of signals for certain operations. */
#include "winlean.h"
#include <sys/cygwin.h>
extern int main (int argc, char **argv);
void cygwin_crt0 (int (*main) (int, char **));
#ifdef __i386__
__attribute__ ((force_align_arg_pointer))
#endif
void
mainCRTStartup ()
{
cygwin_crt0 (main);
/* These are never actually called. They are just here to force the inclusion
of things like -lbinmode. */
cygwin_premain0 (0, NULL, NULL);
cygwin_premain1 (0, NULL, NULL);
cygwin_premain2 (0, NULL, NULL);
cygwin_premain3 (0, NULL, NULL);
}
void WinMainCRTStartup(void) __attribute__ ((alias("mainCRTStartup")));