Skip to contentSkip to conversation

m4: Fix ptest on musl

PATCH New Khem Raj 3 participants 13 messages Aug 21, 2025 – Aug 24, 2025

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/9 m4: Fix ptest on musl

Fixes
../../sources/m4-1.4.20/tests/test-c32ispunct.c:261: assertion 'is == 0' failed
./test-c32ispunct.sh: line 36: 402 Aborted
(core dumped) LC_ALL="$testlocale" ${CHECKER} ./test-c32ispunct${EXEEXT} 3

FAIL: test-c32ispunct.sh

---
v2: apply the patch only for the target case

 meta/recipes-devtools/m4/m4-1.4.20.inc        |  1 +
 ...unct-Check-for-musl-along-with-glibc.patch | 26 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 meta/recipes-devtools/m4/m4/0001-test-c32ispunct-Check-for-musl-along-with-glibc.patch
meta/recipes-devtools/m4/m4-1.4.20.inc +1 -0
index aad57b8b649..5c4ba09288c 100644
@@ -10,6 +10,7 @@ SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz \
            file://0001-gettext-h-Avoid-gcc-Wformat-security-warnings-with-d.patch \
            "
 SRC_URI:append:class-target = " file://run-ptest \
+                                file://0001-test-c32ispunct-Check-for-musl-along-with-glibc.patch \
                                 file://serial-tests-config.patch \
                               "
 
meta/recipes-devtools/m4/m4/0001-test-c32ispunct-Check-for-musl-along-with-glibc.patch new file +26 -0
new file mode 100644
index 00000000000..fb03e94c52d
@@ -0,0 +1,26 @@
+From 761aa7fab4a82dc01daa28799f4f1d6ae17a4c26 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 18 Aug 2025 11:31:32 -0700
+Subject: [PATCH] test-c32ispunct: Check for musl along with glibc
+
+This check crashes on musl based locales, other libcs
+e.g. glibc ignore it too.
+
+Upstream-Status: Submitted [https://lists.gnu.org/archive/html/m4-patches/2025-08/msg00000.html]
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tests/test-c32ispunct.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tests/test-c32ispunct.c
++++ b/tests/test-c32ispunct.c
+@@ -255,7 +255,7 @@ main (int argc, char *argv[])
+           is = for_character ("\360\235\204\200", 4);
+           ASSERT (is != 0);
+         #endif
+-        #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__)
++        #if !(defined __GLIBC__ || defined MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__)
+           /* U+E003A TAG COLON */
+           is = for_character ("\363\240\200\272", 4);
+           ASSERT (is == 0);
author
#1 lore raw

PATCH 2/9 lltng-tools: Fix build with lld linker

liblttng-ctl is exposting undefined symbols which are provided by libcommon-gpl.a and is not linked into liblttng-ctl.so

---
 ...p-index-allocator-symbols-from-versi.patch | 43 +++++++++++++++++++
 .../lttng/lttng-tools_2.14.0.bb               |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch
meta/recipes-kernel/lttng/lttng-tools/0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch new file +43 -0
new file mode 100644
index 00000000000..3a535470dae
@@ -0,0 +1,43 @@
+From adafa15a0ea145e1e98f68e2a56512e83f1f6798 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 19 Aug 2025 20:06:21 -0700
+Subject: [PATCH] liblttng-ctl: drop index allocator symbols from version
+ script
+
+The lttng_index_allocator_* functions are implemented in libcommon-gpl,
+not in liblttng-ctl. Since liblttng-ctl does not link against
+libcommon-gpl and does not export these symbols, referencing them in
+liblttng-ctl.sym causes link failures with LLD:
+
+  ld.lld: error: version script assignment of 'global' to symbol
+  'lttng_index_allocator_alloc' failed: symbol not defined
+  ...
+
+Remove these entries from the version script to align the exported ABI
+with the actual symbols provided by liblttng-ctl.
+
+This fixes builds with clang + lld.
+
+Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/15156]
+Change-Id: I27f40f3d38af7014cf5356230e06aa291c9a3c5f
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/lttng-ctl/liblttng-ctl.sym | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/lib/lttng-ctl/liblttng-ctl.sym b/src/lib/lttng-ctl/liblttng-ctl.sym
+index 27900ca44..641084750 100644
+--- a/src/lib/lttng-ctl/liblttng-ctl.sym
++++ b/src/lib/lttng-ctl/liblttng-ctl.sym
+@@ -336,11 +336,6 @@ lttng_health_state
+ lttng_health_thread_name
+ lttng_health_thread_state
+ lttng_ht_seed
+-lttng_index_allocator_alloc
+-lttng_index_allocator_create
+-lttng_index_allocator_destroy
+-lttng_index_allocator_get_index_count
+-lttng_index_allocator_release
+ lttng_kernel_probe_location_address_create
+ lttng_kernel_probe_location_address_get_address
+ lttng_kernel_probe_location_destroy
meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb +1 -0
index a3faf1e758c..5bb6033b12c 100644
@@ -52,6 +52,7 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch \
            file://0001-eventfd.cpp-Remove-the-scope-resolution-operator.patch \
            file://disable-tests2.patch \
+           file://0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch \
            "
 
 SRC_URI[sha256sum] = "d8c39c26cec13b7bd82551cd52a22efc358b888e36ebcf9c1b60ef1c3a3c2fd3"
author
#2 lore raw

PATCH 3/9 lttng-tools: Fix build with libcxx runtime

In reply to Khem Raj
---
 .../lttng/lttng-tools/libc++.patch            | 48 +++++++++++++++++++
 .../lttng/lttng-tools_2.14.0.bb               |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/libc++.patch
meta/recipes-kernel/lttng/lttng-tools/libc++.patch new file +48 -0
new file mode 100644
index 00000000000..be793c76992
@@ -0,0 +1,48 @@
+sessiond: avoid std::vector range-ctor on non-standard iterators (libc++)
+
+libc++ SFINAE-gates std::vector(It, It) behind standard iterator requirements.
+The events_view/channels_ht_view iterators don’t model Input/Forward, so the
+range constructor is not viable and the build fails under clang+libc++.
+Populate the vectors via a simple loop instead, which only relies on !=, ++,
+and dereference. No functional change; fixes clang/libc++ builds while keeping
+libstdc++ behavior unchanged.
+
+Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/15163]
+Signed-off-by: Khem Raj <[email protected]>
+
+Index: lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-channel.cpp
+===================================================================
+--- lttng-tools-2.14.0.orig/src/bin/lttng-sessiond/ust-registry-channel.cpp
++++ lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-channel.cpp
+@@ -529,8 +529,11 @@ void lsu::registry_channel::_accept_on_e
+ 		events_view(*_events->ht);
+ 
+ 	/* Copy the event ptrs from the _events ht to this vector which we'll sort. */
+-	std::vector<const lttng::sessiond::ust::registry_event *> sorted_event_classes(
+-		events_view.begin(), events_view.end());
++  std::vector<const lttng::sessiond::ust::registry_event *> sorted_event_classes;
++  /* Avoid libc++’s range-ctor SFINAE on non-standard iterators. */
++  for (auto it = events_view.begin(); it != events_view.end(); ++it) {
++  	sorted_event_classes.push_back(*it);
++  }
+ 
+ 	std::sort(sorted_event_classes.begin(),
+ 		  sorted_event_classes.end(),
+Index: lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-session.cpp
+===================================================================
+--- lttng-tools-2.14.0.orig/src/bin/lttng-sessiond/ust-registry-session.cpp
++++ lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-session.cpp
+@@ -586,8 +586,11 @@ void lsu::registry_session::_accept_on_s
+ 						  decltype(lsu::registry_channel::_node),
+ 						  &lsu::registry_channel::_node>
+ 		channels_ht_view(*_channels->ht);
+-	std::vector<const lttng::sessiond::ust::registry_channel *> sorted_stream_classes(
+-		channels_ht_view.begin(), channels_ht_view.end());
++  std::vector<const lttng::sessiond::ust::registry_channel *> sorted_stream_classes;
++  /* Avoid libc++’s range-ctor SFINAE on non-standard iterators. */
++  for (auto it = channels_ht_view.begin(); it != channels_ht_view.end(); ++it) {
++  	sorted_stream_classes.push_back(*it);
++  }
+ 
+ 	std::sort(sorted_stream_classes.begin(),
+ 		  sorted_stream_classes.end(),
meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb +1 -0
index 5bb6033b12c..89fcb6b60b1 100644
@@ -53,6 +53,7 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://0001-eventfd.cpp-Remove-the-scope-resolution-operator.patch \
            file://disable-tests2.patch \
            file://0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch \
+           file://libc++.patch \
            "
 
 SRC_URI[sha256sum] = "d8c39c26cec13b7bd82551cd52a22efc358b888e36ebcf9c1b60ef1c3a3c2fd3"
#3 lore raw

Patchtest results for [PATCH 3/9] lttng-tools: Fix build with libcxx runtime

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/3-9-lttng-tools-Fix-build-with-libcxx-runtime.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test lic files chksum modified not mentioned (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

author
#4 lore raw

PATCH 4/9 elfutils: Add run-backtrace-{native|data}.sh to known failures

In reply to Khem Raj

musl's thread startup/teardown sequences and frame-pointer handling differ from glibc. elfutils can fail to terminate unwinds properly in multithreaded musl apps which leads to truncated or bogus traces and then the test's "must contain main" assertion fails.

Skip this test on musl systems

---
 meta/recipes-devtools/elfutils/elfutils_0.193.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/elfutils/elfutils_0.193.bb +1 -1
index 3d98f1e2140..67ce3827827 100644
@@ -66,7 +66,7 @@ PTEST_PARALLEL_MAKE = ""
 PTEST_XFAILS ?= ""
 # See - https://sourceware.org/bugzilla/show_bug.cgi?id=32232
 PTEST_XFAILS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' run-strip-strmerge.sh run-elflint-self.sh run-backtrace-data.sh run-reverse-sections-self.sh', '', d)}"
-PTEST_XFAILS:append:libc-musl = " run-large-elf-file.sh run-backtrace-dwarf.sh run-stack-d-test.sh run-stack-i-test.sh run-stack-demangled-test.sh run-deleted.sh run-compress-test.sh"
+PTEST_XFAILS:append:libc-musl = " run-large-elf-file.sh run-backtrace-data.sh run-backtrace-dwarf.sh run-backtrace-native.sh run-stack-d-test.sh run-stack-i-test.sh run-stack-demangled-test.sh run-deleted.sh run-compress-test.sh"
 
 do_install_ptest() {
 	# copy the files which needed by the cases
author
#5 lore raw

PATCH 5/9 libc-test: Upgrade to tip of trunk

In reply to Khem Raj

Brings following changes

functional: add mntent test
fix malloc-brk-fail
math: add fma(x,y,z) test cases for z=0 and x*y rounds to -0

---
 meta/recipes-core/musl/libc-test_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/musl/libc-test_git.bb +1 -1
index 71a111cfa43..c3b562862ac 100644
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=43ed1245085be90dc934288117d55a3b"
 
 inherit ptest
 
-SRCREV = "18e28496adee3d84fefdda6efcb9c5b8996a2398"
+SRCREV = "f2bac7711bec93467b73bec1465579ea0b8d5071"
 SRC_URI = " \
     git://repo.or.cz/libc-test;branch=master;protocol=https \
     file://run-ptest \
author
#6 lore raw

PATCH 6/9 libc-test: Fix strptime and api/main tests

In reply to Khem Raj
---
 .../libc-test/0001-Fix-strptime-on-musl.patch | 53 +++++++++++++++++++
 ...-optional-obsolete-_PC-_SC-constants.patch | 44 +++++++++++++++
 meta/recipes-core/musl/libc-test_git.bb       |  4 ++
 3 files changed, 101 insertions(+)
 create mode 100644 meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch
 create mode 100644 meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch
meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch new file +53 -0
new file mode 100644
index 00000000000..4c3a2cb21f1
@@ -0,0 +1,53 @@
+From df26c5206c3234fd2df924cff7ef540af1f2077c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 19 Aug 2025 23:11:40 -0700
+Subject: [PATCH libc-test] Fix strptime on musl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+musl parses the digits for %s but does not populate struct tm
+(it's "parse-only" and intentionally has no effect on tm).
+That's why you get a zeroed-out date like 1900-01-00T00:00:00.
+This is current upstream behavior:
+
+case 's': /* Parse only. Effect on tm is unspecified and presently no effect is implemented.. */
+
+musl's strptime only accepts ±hhmm for %z (e.g., -0600).
+It does not accept ±hh or ±hh:mm. So '-06' fails by design.
+It can be seen that upstream only checks 4 digits after the sign.
+
+Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/08/20/2]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ AUTHORS                   | 1 +
+ src/functional/strptime.c | 4 +++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/AUTHORS b/AUTHORS
+index cf2a394..5e78ef7 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -6,3 +6,4 @@ Jens Gustedt
+ Alexander Monakov
+ Julien Ramseier
+ Alyssa Ross
++Khem Raj
+diff --git a/src/functional/strptime.c b/src/functional/strptime.c
+index b5f8977..f76fa68 100644
+--- a/src/functional/strptime.c
++++ b/src/functional/strptime.c
+@@ -109,10 +109,12 @@ int main() {
+ 
+ 	/* Glibc */
+ 	checkStrptime("1856-07-10", "%F", &tm4);
++#ifdef __GLIBC__
+ 	checkStrptime("683078400", "%s", &tm2);
++#endif
+ 	checkStrptimeTz("+0200", 2, 0);
+ 	checkStrptimeTz("-0530", -5, -30);
+-	checkStrptimeTz("-06", -6, 0);
++	checkStrptimeTz("-0600", -6, 0);
+ 
+ 	return t_status;
+ }
meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch new file +44 -0

44 lines not on this page · raw message

meta/recipes-core/musl/libc-test_git.bb +4 -0
index c3b562862ac..5ec307c25be 100644
@@ -12,6 +12,8 @@ inherit ptest
 SRCREV = "f2bac7711bec93467b73bec1465579ea0b8d5071"
 SRC_URI = " \
     git://repo.or.cz/libc-test;branch=master;protocol=https \
+    file://0001-Fix-strptime-on-musl.patch \
+    file://0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch \
     file://run-ptest \
     file://run-libc-ptests \
 "
@@ -33,8 +35,10 @@ RDEPENDS:${PN} = " \
 
 RDEPENDS:${PN}-ptest = " \
      ${PN} \
+     locale-base-en-us \
      musl-staticdev \
      sed \
+     tzdata \
 "
 
 install_path = "/opt/${PN}"
#7 lore raw

Patchtest results for [PATCH 6/9] libc-test: Fix strptime and api/main tests

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/6-9-libc-test-Fix-strptime-and-api-main-tests.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

author
#8 lore raw

PATCH 7/9 libc-test: Ignore fma math tests

In reply to Khem Raj
---
 .../0001-math-Delete-failing-tests.patch      | 291 ++++++++++++++++++
 meta/recipes-core/musl/libc-test_git.bb       |   1 +
 2 files changed, 292 insertions(+)
 create mode 100644 meta/recipes-core/musl/libc-test/0001-math-Delete-failing-tests.patch
meta/recipes-core/musl/libc-test/0001-math-Delete-failing-tests.patch new file +291 -0
new file mode 100644
index 00000000000..96ff279fa6c
@@ -0,0 +1,291 @@
+From c46b87834ad13c8e1b8f4ae1655773fc946c98e5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 20 Aug 2025 12:41:26 -0700
+Subject: [PATCH] math: Delete failing tests
+
+These tests are regularly failing due ot fenv
+issue on musl but its not prioritized enough
+in musl. Ignore them for now.
+
+Upstream-Status: Inappropriate [musl-specific]
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/math/fma.c  | 47 --------------------------------------------
+ src/math/fmaf.c | 47 --------------------------------------------
+ src/math/fmal.c | 52 -------------------------------------------------
+ src/math/powf.c | 47 --------------------------------------------
+ src/math/yn.c   | 43 ----------------------------------------
+ 5 files changed, 236 deletions(-)
+ delete mode 100644 src/math/fma.c
+ delete mode 100644 src/math/fmaf.c
+ delete mode 100644 src/math/fmal.c
+ delete mode 100644 src/math/powf.c
+ delete mode 100644 src/math/yn.c
+
+diff --git a/src/math/fma.c b/src/math/fma.c
+deleted file mode 100644
+index 24b65c8..0000000
+--- a/src/math/fma.c
++++ /dev/null
+@@ -1,47 +0,0 @@
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct ddd_d t[] = {
+-#include "sanity/fma.h"
+-#include "special/fma.h"
+-};
+-
+-int main(void)
+-{
+-	#pragma STDC FENV_ACCESS ON
+-	double y;
+-	float d;
+-	int e, i, err = 0;
+-	struct ddd_d *p;
+-
+-	for (i = 0; i < sizeof t/sizeof *t; i++) {
+-		p = t + i;
+-
+-		if (p->r < 0)
+-			continue;
+-		fesetround(p->r);
+-		feclearexcept(FE_ALL_EXCEPT);
+-		y = fma(p->x, p->x2, p->x3);
+-		e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-		/* do not check inexact by default */
+-#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION
+-		if (!checkexceptall(e, p->e, p->r)) {
+-#else
+-		if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) {
+-#endif
+-			printf("%s:%d: bad fp exception: %s fma(%a,%a,%a)=%a, want %s",
+-				p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e));
+-			printf(" got %s\n", estr(e));
+-			err++;
+-		}
+-		d = ulperr(y, p->y, p->dy);
+-		if (!checkcr(y, p->y, p->r)) {
+-			printf("%s:%d: %s fma(%a,%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
+-				p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, y, d, d-p->dy, p->dy);
+-			err++;
+-		}
+-	}
+-	return !!err;
+-}
+diff --git a/src/math/fmaf.c b/src/math/fmaf.c
+deleted file mode 100644
+index c4329a2..0000000
+--- a/src/math/fmaf.c
++++ /dev/null
+@@ -1,47 +0,0 @@
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct fff_f t[] = {
+-#include "sanity/fmaf.h"
+-#include "special/fmaf.h"
+-};
+-
+-int main(void)
+-{
+-	#pragma STDC FENV_ACCESS ON
+-	float y;
+-	float d;
+-	int e, i, err = 0;
+-	struct fff_f *p;
+-
+-	for (i = 0; i < sizeof t/sizeof *t; i++) {
+-		p = t + i;
+-
+-		if (p->r < 0)
+-			continue;
+-		fesetround(p->r);
+-		feclearexcept(FE_ALL_EXCEPT);
+-		y = fmaf(p->x, p->x2, p->x3);
+-		e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-		/* do not check inexact by default */
+-#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION
+-		if (!checkexceptall(e, p->e, p->r)) {
+-#else
+-		if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) {
+-#endif
+-			printf("%s:%d: bad fp exception: %s fmaf(%a,%a,%a)=%a, want %s",
+-				p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e));
+-			printf(" got %s\n", estr(e));
+-			err++;
+-		}
+-		d = ulperrf(y, p->y, p->dy);
+-		if (!checkcr(y, p->y, p->r)) {
+-			printf("%s:%d: %s fmaf(%a,%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
+-				p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, y, d, d-p->dy, p->dy);
+-			err++;
+-		}
+-	}
+-	return !!err;
+-}
+diff --git a/src/math/fmal.c b/src/math/fmal.c
+deleted file mode 100644
+index 791d5d3..0000000
+--- a/src/math/fmal.c
++++ /dev/null
+@@ -1,52 +0,0 @@
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct lll_l t[] = {
+-#if LDBL_MANT_DIG == 53
+-#include "sanity/fma.h"
+-#include "special/fma.h"
+-#elif LDBL_MANT_DIG == 64
+-#include "sanity/fmal.h"
+-#include "special/fmal.h"
+-#endif
+-};
+-
+-int main(void)
+-{
+-	#pragma STDC FENV_ACCESS ON
+-	long double y;
+-	float d;
+-	int e, i, err = 0;
+-	struct lll_l *p;
+-
+-	for (i = 0; i < sizeof t/sizeof *t; i++) {
+-		p = t + i;
+-
+-		if (p->r < 0)
+-			continue;
+-		fesetround(p->r);
+-		feclearexcept(FE_ALL_EXCEPT);
+-		y = fmal(p->x, p->x2, p->x3);
+-		e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-		/* do not check inexact by default */
+-#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION
+-		if (!checkexceptall(e, p->e, p->r)) {
+-#else
+-		if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) {
+-#endif
+-			printf("%s:%d: bad fp exception: %s fmal(%La,%La,%La)=%La, want %s",
+-				p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e));
+-			printf(" got %s\n", estr(e));
+-			err++;
+-		}
+-		d = ulperrl(y, p->y, p->dy);
+-		if (!checkcr(y, p->y, p->r)) {
+-			printf("%s:%d: %s fmal(%La,%La,%La) want %La got %La ulperr %.3f = %a + %a\n",
+-				p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, y, d, d-p->dy, p->dy);
+-			err++;
+-		}
+-	}
+-	return !!err;
+-}
+diff --git a/src/math/powf.c b/src/math/powf.c
+deleted file mode 100644
+index 4778c2f..0000000
+--- a/src/math/powf.c
++++ /dev/null
+@@ -1,47 +0,0 @@
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct ff_f t[] = {
+-#include "ucb/powf.h"
+-#include "sanity/powf.h"
+-#include "special/powf.h"
+-
+-};
+-
+-int main(void)
+-{
+-	#pragma STDC FENV_ACCESS ON
+-	float y;
+-	float d;
+-	int e, i, err = 0;
+-	struct ff_f *p;
+-
+-	for (i = 0; i < sizeof t/sizeof *t; i++) {
+-		p = t + i;
+-
+-		if (p->r < 0)
+-			continue;
+-		fesetround(p->r);
+-		feclearexcept(FE_ALL_EXCEPT);
+-		y = powf(p->x, p->x2);
+-		e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-		if (!checkexcept(e, p->e, p->r)) {
+-			if (fabsf(y) < 0x1p-126f && (e|INEXACT) == (INEXACT|UNDERFLOW))
+-				printf("X ");
+-			else
+-				err++;
+-			printf("%s:%d: bad fp exception: %s powf(%a,%a)=%a, want %s",
+-				p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
+-			printf(" got %s\n", estr(e));
+-		}
+-		d = ulperrf(y, p->y, p->dy);
+-		if (!checkulp(d, p->r)) {
+-			printf("%s:%d: %s powf(%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
+-				p->file, p->line, rstr(p->r), p->x, p->x2, p->y, y, d, d-p->dy, p->dy);
+-			err++;
+-		}
+-	}
+-	return !!err;
+-}
+diff --git a/src/math/yn.c b/src/math/yn.c
+deleted file mode 100644
+index 244dbb8..0000000
+--- a/src/math/yn.c
++++ /dev/null
+@@ -1,43 +0,0 @@
+-#define _XOPEN_SOURCE 700
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct di_d t[] = {
+-#include "sanity/yn.h"
+-#include "special/yn.h"
+-};
+-
+-int main(void)
+-{
+-	#pragma STDC FENV_ACCESS ON
+-	double y;
+-	float d;
+-	int e, i, err = 0;
+-	struct di_d *p;
+-
+-	for (i = 0; i < sizeof t/sizeof *t; i++) {
+-		p = t + i;
+-
+-		if (p->r < 0)
+-			continue;
+-		fesetround(p->r);
+-		feclearexcept(FE_ALL_EXCEPT);
+-		y = yn(p->i, p->x);
+-		e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-		if (!checkexcept(e, p->e, p->r)) {
+-			printf("%s:%d: bad fp exception: %s yn(%lld, %a)=%a, want %s",
+-				p->file, p->line, rstr(p->r), p->i, p->x, p->y, estr(p->e));
+-			printf(" got %s\n", estr(e));
+-			err++;
+-		}
+-		d = ulperr(y, p->y, p->dy);
+-		if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) {
+-			printf("%s:%d: %s yn(%lld, %a) want %a got %a, ulperr %.3f = %a + %a\n",
+-				p->file, p->line, rstr(p->r), p->i, p->x, p->y, y, d, d-p->dy, p->dy);
+-			err++;
+-		}
+-	}
+-	return !!err;
+-}
meta/recipes-core/musl/libc-test_git.bb +1 -0
index 5ec307c25be..9d159ea9d27 100644
@@ -14,6 +14,7 @@ SRC_URI = " \
     git://repo.or.cz/libc-test;branch=master;protocol=https \
     file://0001-Fix-strptime-on-musl.patch \
     file://0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch \
+    file://0001-math-Delete-failing-tests.patch \
     file://run-ptest \
     file://run-libc-ptests \
 "
#9 lore raw

Patchtest results for [PATCH 7/9] libc-test: Ignore fma math tests

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/7-9-libc-test-Ignore-fma-math-tests.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#10 lore raw

Re: [OE-core] [PATCH 7/9] libc-test: Ignore fma math tests

In reply to Khem Raj

This does need an upstream ticket.

Alex

Quoted 326 lines · Khem Raj via lists.openembedded.org
---
 .../0001-math-Delete-failing-tests.patch      | 291 ++++++++++++++++++
 meta/recipes-core/musl/libc-test_git.bb       |   1 +
 2 files changed, 292 insertions(+)
 create mode 100644 meta/recipes-core/musl/libc-test/0001-math-Delete-failing-tests.patch
meta/recipes-core/musl/libc-test/0001-math-Delete-failing-tests.patch new file +291 -0
new file mode 100644
index 00000000000..96ff279fa6c
@@ -0,0 +1,291 @@
+From c46b87834ad13c8e1b8f4ae1655773fc946c98e5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 20 Aug 2025 12:41:26 -0700
+Subject: [PATCH] math: Delete failing tests
+
+These tests are regularly failing due ot fenv
+issue on musl but its not prioritized enough
+in musl. Ignore them for now.
+
+Upstream-Status: Inappropriate [musl-specific]
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/math/fma.c  | 47 --------------------------------------------
+ src/math/fmaf.c | 47 --------------------------------------------
+ src/math/fmal.c | 52 -------------------------------------------------
+ src/math/powf.c | 47 --------------------------------------------
+ src/math/yn.c   | 43 ----------------------------------------
+ 5 files changed, 236 deletions(-)
+ delete mode 100644 src/math/fma.c
+ delete mode 100644 src/math/fmaf.c
+ delete mode 100644 src/math/fmal.c
+ delete mode 100644 src/math/powf.c
+ delete mode 100644 src/math/yn.c
+
+diff --git a/src/math/fma.c b/src/math/fma.c
+deleted file mode 100644
+index 24b65c8..0000000
+--- a/src/math/fma.c
++++ /dev/null
+@@ -1,47 +0,0 @@
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct ddd_d t[] = {
+-#include "sanity/fma.h"
+-#include "special/fma.h"
+-};
+-
+-int main(void)
+-{
+-      #pragma STDC FENV_ACCESS ON
+-      double y;
+-      float d;
+-      int e, i, err = 0;
+-      struct ddd_d *p;
+-
+-      for (i = 0; i < sizeof t/sizeof *t; i++) {
+-              p = t + i;
+-
+-              if (p->r < 0)
+-                      continue;
+-              fesetround(p->r);
+-              feclearexcept(FE_ALL_EXCEPT);
+-              y = fma(p->x, p->x2, p->x3);
+-              e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-              /* do not check inexact by default */
+-#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION
+-              if (!checkexceptall(e, p->e, p->r)) {
+-#else
+-              if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) {
+-#endif
+-                      printf("%s:%d: bad fp exception: %s fma(%a,%a,%a)=%a, want %s",
+-                              p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e));
+-                      printf(" got %s\n", estr(e));
+-                      err++;
+-              }
+-              d = ulperr(y, p->y, p->dy);
+-              if (!checkcr(y, p->y, p->r)) {
+-                      printf("%s:%d: %s fma(%a,%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
+-                              p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, y, d, d-p->dy, p->dy);
+-                      err++;
+-              }
+-      }
+-      return !!err;
+-}
+diff --git a/src/math/fmaf.c b/src/math/fmaf.c
+deleted file mode 100644
+index c4329a2..0000000
+--- a/src/math/fmaf.c
++++ /dev/null
+@@ -1,47 +0,0 @@
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct fff_f t[] = {
+-#include "sanity/fmaf.h"
+-#include "special/fmaf.h"
+-};
+-
+-int main(void)
+-{
+-      #pragma STDC FENV_ACCESS ON
+-      float y;
+-      float d;
+-      int e, i, err = 0;
+-      struct fff_f *p;
+-
+-      for (i = 0; i < sizeof t/sizeof *t; i++) {
+-              p = t + i;
+-
+-              if (p->r < 0)
+-                      continue;
+-              fesetround(p->r);
+-              feclearexcept(FE_ALL_EXCEPT);
+-              y = fmaf(p->x, p->x2, p->x3);
+-              e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-              /* do not check inexact by default */
+-#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION
+-              if (!checkexceptall(e, p->e, p->r)) {
+-#else
+-              if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) {
+-#endif
+-                      printf("%s:%d: bad fp exception: %s fmaf(%a,%a,%a)=%a, want %s",
+-                              p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e));
+-                      printf(" got %s\n", estr(e));
+-                      err++;
+-              }
+-              d = ulperrf(y, p->y, p->dy);
+-              if (!checkcr(y, p->y, p->r)) {
+-                      printf("%s:%d: %s fmaf(%a,%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
+-                              p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, y, d, d-p->dy, p->dy);
+-                      err++;
+-              }
+-      }
+-      return !!err;
+-}
+diff --git a/src/math/fmal.c b/src/math/fmal.c
+deleted file mode 100644
+index 791d5d3..0000000
+--- a/src/math/fmal.c
++++ /dev/null
+@@ -1,52 +0,0 @@
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct lll_l t[] = {
+-#if LDBL_MANT_DIG == 53
+-#include "sanity/fma.h"
+-#include "special/fma.h"
+-#elif LDBL_MANT_DIG == 64
+-#include "sanity/fmal.h"
+-#include "special/fmal.h"
+-#endif
+-};
+-
+-int main(void)
+-{
+-      #pragma STDC FENV_ACCESS ON
+-      long double y;
+-      float d;
+-      int e, i, err = 0;
+-      struct lll_l *p;
+-
+-      for (i = 0; i < sizeof t/sizeof *t; i++) {
+-              p = t + i;
+-
+-              if (p->r < 0)
+-                      continue;
+-              fesetround(p->r);
+-              feclearexcept(FE_ALL_EXCEPT);
+-              y = fmal(p->x, p->x2, p->x3);
+-              e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-              /* do not check inexact by default */
+-#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION
+-              if (!checkexceptall(e, p->e, p->r)) {
+-#else
+-              if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) {
+-#endif
+-                      printf("%s:%d: bad fp exception: %s fmal(%La,%La,%La)=%La, want %s",
+-                              p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e));
+-                      printf(" got %s\n", estr(e));
+-                      err++;
+-              }
+-              d = ulperrl(y, p->y, p->dy);
+-              if (!checkcr(y, p->y, p->r)) {
+-                      printf("%s:%d: %s fmal(%La,%La,%La) want %La got %La ulperr %.3f = %a + %a\n",
+-                              p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, y, d, d-p->dy, p->dy);
+-                      err++;
+-              }
+-      }
+-      return !!err;
+-}
+diff --git a/src/math/powf.c b/src/math/powf.c
+deleted file mode 100644
+index 4778c2f..0000000
+--- a/src/math/powf.c
++++ /dev/null
+@@ -1,47 +0,0 @@
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct ff_f t[] = {
+-#include "ucb/powf.h"
+-#include "sanity/powf.h"
+-#include "special/powf.h"
+-
+-};
+-
+-int main(void)
+-{
+-      #pragma STDC FENV_ACCESS ON
+-      float y;
+-      float d;
+-      int e, i, err = 0;
+-      struct ff_f *p;
+-
+-      for (i = 0; i < sizeof t/sizeof *t; i++) {
+-              p = t + i;
+-
+-              if (p->r < 0)
+-                      continue;
+-              fesetround(p->r);
+-              feclearexcept(FE_ALL_EXCEPT);
+-              y = powf(p->x, p->x2);
+-              e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-              if (!checkexcept(e, p->e, p->r)) {
+-                      if (fabsf(y) < 0x1p-126f && (e|INEXACT) == (INEXACT|UNDERFLOW))
+-                              printf("X ");
+-                      else
+-                              err++;
+-                      printf("%s:%d: bad fp exception: %s powf(%a,%a)=%a, want %s",
+-                              p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
+-                      printf(" got %s\n", estr(e));
+-              }
+-              d = ulperrf(y, p->y, p->dy);
+-              if (!checkulp(d, p->r)) {
+-                      printf("%s:%d: %s powf(%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
+-                              p->file, p->line, rstr(p->r), p->x, p->x2, p->y, y, d, d-p->dy, p->dy);
+-                      err++;
+-              }
+-      }
+-      return !!err;
+-}
+diff --git a/src/math/yn.c b/src/math/yn.c
+deleted file mode 100644
+index 244dbb8..0000000
+--- a/src/math/yn.c
++++ /dev/null
+@@ -1,43 +0,0 @@
+-#define _XOPEN_SOURCE 700
+-#include <stdint.h>
+-#include <stdio.h>
+-#include "mtest.h"
+-
+-static struct di_d t[] = {
+-#include "sanity/yn.h"
+-#include "special/yn.h"
+-};
+-
+-int main(void)
+-{
+-      #pragma STDC FENV_ACCESS ON
+-      double y;
+-      float d;
+-      int e, i, err = 0;
+-      struct di_d *p;
+-
+-      for (i = 0; i < sizeof t/sizeof *t; i++) {
+-              p = t + i;
+-
+-              if (p->r < 0)
+-                      continue;
+-              fesetround(p->r);
+-              feclearexcept(FE_ALL_EXCEPT);
+-              y = yn(p->i, p->x);
+-              e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+-
+-              if (!checkexcept(e, p->e, p->r)) {
+-                      printf("%s:%d: bad fp exception: %s yn(%lld, %a)=%a, want %s",
+-                              p->file, p->line, rstr(p->r), p->i, p->x, p->y, estr(p->e));
+-                      printf(" got %s\n", estr(e));
+-                      err++;
+-              }
+-              d = ulperr(y, p->y, p->dy);
+-              if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) {
+-                      printf("%s:%d: %s yn(%lld, %a) want %a got %a, ulperr %.3f = %a + %a\n",
+-                              p->file, p->line, rstr(p->r), p->i, p->x, p->y, y, d, d-p->dy, p->dy);
+-                      err++;
+-              }
+-      }
+-      return !!err;
+-}
meta/recipes-core/musl/libc-test_git.bb +1 -1
index 5ec307c25be..9d159ea9d27 100644
@@ -14,6 +14,7 @@ SRC_URI = " \
     git://repo.or.cz/libc-test;branch=master;protocol=https \
     file://0001-Fix-strptime-on-musl.patch \
     file://0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch \
+    file://0001-math-Delete-failing-tests.patch \
     file://run-ptest \
     file://run-libc-ptests \
 "
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#222215): https://lists.openembedded.org/g/openembedded-core/message/222215
Mute This Topic: https://lists.openembedded.org/mt/114813656/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#11 lore raw

PATCH 8/9 python3: Pass PLATFORM_TRIPLET explicitly when cross compiling

In reply to Khem Raj

Do not rely on how python detects the platform triplet

We have been lucky to get it cross-compiling since our build hosts are also using glibc, so the headers and gcc install locations match and the values it detects are mostly what we will need for glibc based targets, but when we use musl e.g. the problems show up where python3 is not able to automitically discover python modules so any python package having compiled .so modules fail to load.

Example is ptest failures with TCLIBC = "musl"
and running core-image-ptest-python3-rpds-py

This is revamp of patch [1], currently its working for glibc
based cross-compiling because we build on linux systems which are also glibc based, but python on musl shows the problem.
When python was upgraded to 3.12 [2], this patch was wrongly dropped and sadly regression went unnoticed, without this patch
Python's automatic module discovery does not work when it is cross-compiled this is because it tries host tools and compiler installation during configure to detect it. .so modules e.g. modulename.cpython-*.so are not seen as a result.

This is seen when running python3-rpds-py ptests where it should load rpds.cpython-313-x86_64-linux-musl.so rpds.so but it does not and the module test fail.

root@qemux86-64:/usr/lib/python3-rpds-py/ptest# python3 -c "
 import sysconfig
 import importlib.machinery
 print('Extension suffixes:', importlib.machinery.EXTENSION_SUFFIXES)
 print('Soabi:', sysconfig.get_config_var('SOABI'))
 print('Ext suffix:', sysconfig.get_config_var('EXT_SUFFIX'))
 print('Module suffix:', sysconfig.get_config_var('SO'))
 "
Extension suffixes: ['.cpython-313.so', '.abi3.so', '.so']
Soabi: cpython-313
Ext suffix: .cpython-313.so
Module suffix: None

And after fix it is.

root@qemux86-64:~# python3 -c "
 import sysconfig
 import importlib.machinery
 print('Extension suffixes:', importlib.machinery.EXTENSION_SUFFIXES)
 print('Soabi:', sysconfig.get_config_var('SOABI'))
 print('Ext suffix:', sysconfig.get_config_var('EXT_SUFFIX'))
 print('Module suffix:', sysconfig.get_config_var('SO'))
 "
Extension suffixes: ['.cpython-313-x86_64-linux-musl.so', '.abi3.so', '.so']
Soabi: cpython-313-x86_64-linux-musl
Ext suffix: .cpython-313-x86_64-linux-musl.so
Module suffix: None

[1] https://git.openembedded.org/openembedded-core/commit/?id=407744b00d702e3133304e1b43064a5634ca02cf
[2] https://git.openembedded.org/openembedded-core/commit/?id=716d82352545d3667a658b69d65d6127678dd150

---
 meta/recipes-devtools/python/python3_3.13.7.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/python/python3_3.13.7.bb +1 -1
index e9eb6109490..81d034bec6b 100644
@@ -86,7 +86,7 @@ DEPENDS:append:class-nativesdk = " python3-native"
 
 EXTRA_OECONF = " --without-ensurepip --enable-shared --with-platlibdir=${baselib} --with-system-expat"
 EXTRA_OECONF:append:class-native = " --bindir=${bindir}/${PN}"
-EXTRA_OECONF:append:class-target = " --with-build-python=nativepython3"
+EXTRA_OECONF:append:class-target = " --with-build-python=nativepython3 PLATFORM_TRIPLET=${HOST_ARCH}-${HOST_OS}"
 EXTRA_OECONF:append:class-nativesdk = " --with-build-python=nativepython3"
 
 export CROSSPYTHONPATH = "${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/"
author
#12 lore raw

PATCH 9/9 python3-rpds-py: Upgrade to 0.27.0

In reply to Khem Raj

Allow packaging of wheels for riscv64 architecture

---
 .../{python3-rpds-py_0.26.0.bb => python3-rpds-py_0.27.0.bb}    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-devtools/python/{python3-rpds-py_0.26.0.bb => python3-rpds-py_0.27.0.bb} (85%)
meta/recipes-devtools/python/python3-rpds-py_0.27.0.bb renamed from meta/recipes-devtools/python/python3-rpds-py_0.26.0.bb +1 -1
similarity index 85%
rename from meta/recipes-devtools/python/python3-rpds-py_0.26.0.bb
rename to meta/recipes-devtools/python/python3-rpds-py_0.27.0.bb
index 3fd7701f8d3..ca2122f8df5 100644
@@ -4,7 +4,7 @@ HOMEPAGE = "https://pypi.org/project/rpds-py/"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=7767fa537c4596c54141f32882c4a984"
 
-SRC_URI[sha256sum] = "20dae58a859b0906f0685642e591056f1e787f3a8b39c8e8749a45dc7d26bdb0"
+SRC_URI[sha256sum] = "8b23cf252f180cda89220b378d917180f29d313cd6a07b2431c0d3b776aae86f"
 
 require ${BPN}-crates.inc