Hi,
Pls find the attached 3rd patch of the series: - [PATCH V2 3/3] - Cygwin: 
export sqrtl as alias to sqrt on AArch64

In-lined patch 3/3:

From 9bdd0ee49375d842ff227c463194fb2ad9b84345 Mon Sep 17 00:00:00 2001
From: Thirumalai Nagalingam <thirumalai.nagalin...@multicorewareinc.com>
Date: Wed, 27 Aug 2025 01:26:49 +0530
Subject: [PATCH 3/3] Cygwin: export sqrtl as alias to sqrt on AArch64

On AArch64, `long double` is the same as `double`, so `sqrtl`
does not require a separate implementation in cygwin/math.

Update `cygwin.din` to handle this correctly:
- On AArch64: `sqrtl` is exported as an alias to `sqrt`.
- On other architectures: `sqrtl` continues to export a
  separate implementation.

This ensures the correct ABI while avoiding duplicate math
implementations for equivalent types.

Signed-off-by: Thirumalai Nagalingam 
<thirumalai.nagalin...@multicorewareinc.com>
---
 winsup/cygwin/cygwin.din | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index cd71da274..17bd36e0d 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -1453,7 +1453,9 @@ spawnvpe SIGFE
 sprintf SIGFE
 sqrt NOSIGFE
 sqrtf NOSIGFE
-sqrtl NOSIGFE
+# On AArch64, long double == double, so aliasing sqrtl → sqrt
+[aarch64] sqrtl = sqrt NOSIGFE
+[!aarch64] sqrtl NOSIGFE
 srand NOSIGFE
 srand48 NOSIGFE
 srandom NOSIGFE
-- 
2.50.1.windows.1

Thanks & regards 
Thirumalai N

Attachment: 0003-Cygwin-export-sqrtl-as-alias-to-sqrt-on-AArch64.patch
Description: 0003-Cygwin-export-sqrtl-as-alias-to-sqrt-on-AArch64.patch

Reply via email to