Hello.

Sending the same patch with more detailed commit message added.

Radek
---
>From bfa5d3c1afe40431b28dd2496c38ba84f91ec0e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Barto=C5=88?= <radek.bar...@microsoft.com>
Date: Tue, 10 Jun 2025 17:11:20 +0200
Subject: [PATCH v2] Cygwin: profiler: port to AArch64
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch allows to build winsup/utils/profiler.cc for AArch64 by handling
target architecture condition in find_text_section function implementation.

Signed-off-by: Radek BartoĊˆ <radek.bar...@microsoft.com>
---
 winsup/utils/profiler.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/winsup/utils/profiler.cc b/winsup/utils/profiler.cc
index b5ce16cf2..4fe900b7f 100644
--- a/winsup/utils/profiler.cc
+++ b/winsup/utils/profiler.cc
@@ -503,8 +503,10 @@ find_text_section (LPVOID base, HANDLE h)
 
   read_child ((void *) &machine, sizeof (machine),
               &inth->FileHeader.Machine, h);
-#ifdef __x86_64__
+#if defined(__x86_64__)
   if (machine != IMAGE_FILE_MACHINE_AMD64)
+#elif defined(__aarch64__)
+  if (machine != IMAGE_FILE_MACHINE_ARM64)
 #else
 #error unimplemented for this target
 #endif
-- 
2.50.1.vfs.0.0

Attachment: v2-0001-Cygwin-profiler-port-to-AArch64.patch
Description: v2-0001-Cygwin-profiler-port-to-AArch64.patch

Reply via email to