[newlib-cygwin/main] Cygwin: cygcheck: port to AArch64
Corinna Vinschen
corinna@sourceware.org
Thu Jul 17 09:29:18 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=49ba5f467c4278be04274c96d799943830d5f6d3
commit 49ba5f467c4278be04274c96d799943830d5f6d3
Author: Radek Bartoň <radek.barton@microsoft.com>
AuthorDate: Mon Jun 9 13:08:35 2025 +0200
Commit: Corinna Vinschen <corinna@vinschen.de>
CommitDate: Thu Jul 17 11:28:41 2025 +0200
Cygwin: cygcheck: port to AArch64
This patch ports `winsup/utils/mingw/cygcheck.cc` to AArch64:
- Adds arch=aarch64 to packages API URL.
- Ports dll_info function.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
Diff:
---
winsup/utils/mingw/cygcheck.cc | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/winsup/utils/mingw/cygcheck.cc b/winsup/utils/mingw/cygcheck.cc
index 89a08e560f4f..d17909bfccc4 100644
--- a/winsup/utils/mingw/cygcheck.cc
+++ b/winsup/utils/mingw/cygcheck.cc
@@ -654,16 +654,22 @@ dll_info (const char *path, HANDLE fh, int lvl, int recurse)
WORD arch = get_word (fh, pe_header_offset + 4);
if (GetLastError () != NO_ERROR)
display_error ("get_word");
-#ifdef __x86_64__
+#if defined(__x86_64__)
if (arch != IMAGE_FILE_MACHINE_AMD64)
{
puts (verbose ? " (not x86_64 dll)" : "\n");
return;
}
- int base_off = 108;
+#elif defined (__aarch64__)
+ if (arch != IMAGE_FILE_MACHINE_ARM64)
+ {
+ puts (verbose ? " (not aarch64 dll)" : "\n");
+ return;
+ }
#else
#error unimplemented for this target
#endif
+ int base_off = 108;
int opthdr_ofs = pe_header_offset + 4 + 20;
unsigned short v[6];
@@ -2108,8 +2114,10 @@ static const char safe_chars[] = "$-_.!*'(),";
static const char grep_base_url[] =
"http://cygwin.com/cgi-bin2/package-grep.cgi?text=1&grep=";
-#ifdef __x86_64__
+#if defined(__x86_64__)
#define ARCH_STR "&arch=x86_64"
+#elif defined(__aarch64__)
+#define ARCH_STR "&arch=aarch64"
#else
#error unimplemented for this target
#endif
More information about the Cygwin-cvs
mailing list