Hello.

Missed that, sorry.

Thank you for noticing.

Radek
---
>From 68edd69104961961013f506593b5ccbb2ad0e61a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Barto=C5=88?= <radek.bar...@microsoft.com>
Date: Thu, 5 Jun 2025 13:15:22 +0200
Subject: [PATCH v4] Cygwin: stack base initialization for AArch64
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Radek BartoĊˆ <radek.bar...@microsoft.com>
---
 winsup/cygwin/dcrt0.cc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index f4c09befd..69c233c24 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -1030,7 +1030,7 @@ _dll_crt0 ()
          PVOID stackaddr = create_new_main_thread_stack (allocationbase);
          if (stackaddr)
            {
-#ifdef __x86_64__
+#if defined(__x86_64__)
              /* Set stack pointer to new address.  Set frame pointer to
                 stack pointer and subtract 32 bytes for shadow space. */
              __asm__ ("\n\
@@ -1038,6 +1038,13 @@ _dll_crt0 ()
                       movq  %%rsp, %%rbp  \n\
                       subq  $32,%%rsp     \n"
                       : : [ADDR] "r" (stackaddr));
+#elif defined(__aarch64__)
+             /* Set stack and frame pointers to new address. */
+             __asm__ ("\n\
+                      mov fp, %[ADDR] \n\
+                      mov sp, fp      \n"
+                      : : [ADDR] "r" (stackaddr)
+                      : "memory");
 #else
 #error unimplemented for this target
 #endif
-- 
2.49.0.vfs.0.4

Attachment: v4-0001-Cygwin-stack-base-initialization-for-AArch64.patch
Description: v4-0001-Cygwin-stack-base-initialization-for-AArch64.patch

Reply via email to