new file mode 100644
@@ -0,0 +1,34 @@
+From 3c36c2969dc3bea32d7e465428f7b2c78787de77 Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Tue, 10 Nov 2026 20:13:06 -0800
+Subject: [PATCH] math: disable FP contraction in jn.c
+
+GCC does not contract floating point expressions in ISO C mode
+(-std=c99), but clang contracts a*b+c into fma by default. In yn()
+that turns the forward recurrence b = (2.0*i/x)*b - a into an fma,
+which changes its rounding. Built with clang 23 for aarch64,
+libc-test's math/yn then fails with
+
+ yn(6, 0x1.8c5db097f7442p-1) want -0x1.6dbc18f9d5ddep+13
+ got -0x1.6dbc18f9d5de1p+13, ulperr -3.219
+
+Turn contraction off for this file, as GCC builds already have it.
+
+Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2026/11/11/4]
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ src/math/jn.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/math/jn.c b/src/math/jn.c
+index 4878a54..b077f02 100644
+--- a/src/math/jn.c
++++ b/src/math/jn.c
+@@ -35,6 +35,7 @@
+ */
+
+ #include "libm.h"
++#pragma STDC FP_CONTRACT OFF
+
+ static const double invsqrtpi = 5.64189583547756279280e-01; /* 0x3FE20DD7, 0x50429B6D */
+
@@ -15,6 +15,7 @@ SRC_URI = "git://git.musl-libc.org/musl;branch=master \
file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \
file://0003-tools-version.sh-fall-back-to-VERSION-when-git-descr.patch \
file://0004-math-enable-FENV_ACCESS-in-expm1-expm1f-hypot-and-hy.patch \
+ file://0005-math-disable-FP-contraction-in-jn.c.patch \
"
PROVIDES += "virtual/libc virtual/libiconv virtual/libintl virtual/crypt"
clang contracts a*b+c into fma by default, unlike GCC in ISO C mode. That changes the rounding of the yn() forward recurrence, and libc-test math/yn fails with a 3.2 ulp error when musl is built with clang. Turn contraction off in jn.c with #pragma STDC FP_CONTRACT OFF. Tested natively on aarch64 with clang 23.1.3 and gcc 14.2 for generic, cortex-a57, cortex-a72 and neoverse-n1: math/yn passes with both compilers. Signed-off-by: Khem Raj <raj.khem@gmail.com> AI-Generated: Uses Claude Code --- ...-math-disable-FP-contraction-in-jn.c.patch | 34 +++++++++++++++++++ meta/recipes-core/musl/musl_git.bb | 1 + 2 files changed, 35 insertions(+) create mode 100644 meta/recipes-core/musl/musl/0005-math-disable-FP-contraction-in-jn.c.patch