Hi folks,
Totally agree this adds little to the distro, other than dummy stubs.
Should we be adding arch ifdefs in existing stable files, or should we instead
add arch directories to the tree to handle completely different approaches in
RISC ISAs?
Were this newlib, we may be able to rely on EL1 access to feature instructions
and registers, but it appears Linux exposes them via HWCAPs, ELF getauxval
AT_HWCAP/2 and sysfs, so on Windows, we may have to rely on possibly different
APIs and registry entries.
Some Windows porting issues:
https://www.janeasystems.com/blog/porting-software-arm64
and some internals info:
https://connormcgarr.github.io/arm64-windows-internals-basics/
Some arch info is documented in:
$ info gcc aarch64
WoA dev info is not easily discoverable on the web flooded with marketing bumph!
On 2026-02-12 13:36, Corinna Vinschen wrote:
Hi Thirumalai,
in terms of all three patches you sent on Feb 8, I wonder if this is
the right thing to do. I know you just want to get it built, but
doesn't this open up a can of worms? How easy will it be to miss
one of these places where the compiler warning doesn't occur anymore.
Wouldn't it be better to wait until you can fill these places with
actual code, even if it's a bit harder in the interim?
Thanks,
Corinna
On Feb 8 19:30, Thirumalai Nagalingam wrote:
Hi,
This patch adds minimal AArch64 stubs to winsup/cygwin/local_includes/cpuid.h
to allow the header to compile for the Cygwin AArch64 target.
*
Conditional handling for aarch64 is added alongside the existing x86_64 code.
*
The cpuid() helper returns zeroed values, and can_set_flag()
is stubbed out for AArch64.
*
No functional CPU feature detection is implemented.
*
The change is intended solely to unblock the AArch64 build and will require
proper architecture-specific implementations in a follow-up patch.
Thanks & regards
Thirumalai Nagalingam
In-lined patch:
diff --git a/winsup/cygwin/local_includes/cpuid.h
b/winsup/cygwin/local_includes/cpuid.h
index 6dbb1bddf..238c88777 100644
--- a/winsup/cygwin/local_includes/cpuid.h
+++ b/winsup/cygwin/local_includes/cpuid.h
@@ -13,17 +13,23 @@ static inline void __attribute ((always_inline))
cpuid (uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t ain,
uint32_t cin = 0)
{
+#if defined(__x86_64__)
asm volatile ("cpuid"
: "=a" (*a), "=b" (*b), "=c" (*c), "=d" (*d)
: "a" (ain), "c" (cin));
+#elif defined(__aarch64__)
+ // TODO
+ *a = *b = *c = *d = 0;
+#endif
}
-#ifdef __x86_64__
+#if defined(__x86_64__) || defined(__aarch64__)
static inline bool __attribute ((always_inline))
can_set_flag (uint32_t long flag)
{
uint32_t long r1, r2;
+#if defined(__x86_64__)
asm volatile ("pushfq\n"
"popq %0\n"
"movq %0, %1\n"
@@ -37,6 +43,9 @@ can_set_flag (uint32_t long flag)
: "=&r" (r1), "=&r" (r2)
: "ir" (flag)
);
+#elif defined(__aarch64__)
+ // TODO
+#endif
return ((r1 ^ r2) & flag) != 0;
}
#else
--
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry