On Wed, 18 Jun 2025, Jeremy Drake via Cygwin-patches wrote:
> On Wed, 18 Jun 2025, Radek Barton via Cygwin-patches wrote:
>
> > -#ifdef __x86_64__
> > /* Set stack pointer to new address. Set frame pointer to
> > stack pointer and subtract 32 bytes for shadow space. */
> > +#if defined(__x86_64__)
> > __asm__ ("\n\
> > movq %[ADDR], %%rsp \n\
> > movq %%rsp, %%rbp \n\
> > subq $32,%%rsp \n"
> > : : [ADDR] "r" (stackaddr));
> > +#elif defined(__aarch64__)
> > + __asm__ ("\n\
> > + mov fp, %[ADDR] \n\
> > + sub sp, fp, #32 \n"
>
> Is the 32-byte shadow space part of the aarch64 calling convention spec,
> or is this just copying what x86_64 was doing? My impression is that this
> space was part of the x86_64 calling convention.
The patch for pthread stack initialization dropped the 32-byte shadow
space, and I believe this patch should as well.