From: OOHehir <oo.hehir@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: raj.khem@gmail.com, tgamblin@baylibre.com,
mathieu.dubois-briand@bootlin.com, OOHehir <oo.hehir@gmail.com>
Subject: [PATCH v2 8/8] python3-numpy: call libm for ceil/floor/trunc on riscv64
Date: Sat, 17 Oct 2026 12:23:57 +0100 [thread overview]
Message-ID: <20261017112358.77434-9-oo.hehir@gmail.com> (raw)
In-Reply-To: <20261017112358.77434-1-oo.hehir@gmail.com>
numpy builds with -std=c11, so GCC 15 onwards expands ceil/floor/trunc
inline on riscv64, & its first scheduling pass moves the fcvt above the
|x| < 2^52 check. ceil(+-inf) & ceil(1e300) then raise FE_INVALID, & the
72 cases of test_unary_spurious_fpexception fail. Confirmed as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127908.
-fno-fp-int-builtin-inexact makes GCC call libm, which handles these
inputs correctly. python3-numpy-ptest on a VisionFive 2 (JH7110), with
2.5.3: 45770 pass, 0 fail. On qemuriscv64 with PTEST_RUNNER_TIMEOUT = "7200",
with 2.5.4: 45993 pass, 0 fail.
Signed-off-by: OOHehir <oo.hehir@gmail.com>
---
meta/recipes-devtools/python/python3-numpy_2.5.4.bb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/meta/recipes-devtools/python/python3-numpy_2.5.4.bb b/meta/recipes-devtools/python/python3-numpy_2.5.4.bb
index 93aa356db1..275c49690b 100644
--- a/meta/recipes-devtools/python/python3-numpy_2.5.4.bb
+++ b/meta/recipes-devtools/python/python3-numpy_2.5.4.bb
@@ -26,6 +26,11 @@ PACKAGECONFIG[svml] = "-Ddisable-svml=false,-Ddisable-svml=true"
# the overflow tests fail with compiler-rt on aarch64
LDFLAGS:append:toolchain-clang:aarch64 = " -rtlib=libgcc -unwindlib=libgcc"
+# GCC 15+ inlines ceil/floor/trunc on riscv64 with the fcvt ahead of the range
+# check, so +-inf raises FE_INVALID; call libm instead. GCC PR 127908.
+CFLAGS:append:toolchain-gcc:riscv64 = " -fno-fp-int-builtin-inexact"
+CXXFLAGS:append:toolchain-gcc:riscv64 = " -fno-fp-int-builtin-inexact"
+
# To ensure reproducibility, remove entries from __config__ which expose build
# machine details, such as build paths, host paths, and hardware configuration.
strip_build_info() {
--
2.43.0
next prev parent reply other threads:[~2026-10-17 11:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 20:45 [PATCH 0/7] riscv64 ptest fixes OOHehir
2026-10-16 20:45 ` [PATCH 1/7] strace: skip qual_fault-syscall.test on riscv64 OOHehir
2026-10-16 20:45 ` [PATCH 2/7] ptest-packagelists.inc: re-enable strace for riscv64 OOHehir
2026-10-16 20:45 ` [PATCH 3/7] ptest-packagelists.inc: re-enable python3 " OOHehir
2026-10-16 20:45 ` [PATCH 4/7] lttng-tools: skip kernel cases when kernel tests are disabled OOHehir
2026-10-16 20:45 ` [PATCH 5/7] tcl, tcl8: skip binary-40.3 on RISC-V OOHehir
2026-10-17 10:29 ` [OE-core] " Mathieu Dubois-Briand
2026-10-17 11:21 ` Owen O'Hehir
2026-10-16 20:45 ` [PATCH 6/7] ptest-packagelists.inc: re-enable tcl8 for riscv64 OOHehir
2026-10-16 20:45 ` [PATCH 7/7] python3-numpy: call libm for ceil/floor/trunc on riscv64 OOHehir
2026-10-17 11:23 ` [PATCH v2 0/8] riscv64 ptest fixes OOHehir
2026-10-17 11:23 ` [PATCH v2 1/8] strace: skip qual_fault-syscall.test on riscv64 OOHehir
2026-10-17 11:23 ` [PATCH v2 2/8] ptest-packagelists.inc: re-enable strace for riscv64 OOHehir
2026-10-17 11:23 ` [PATCH v2 3/8] ptest-packagelists.inc: re-enable python3 " OOHehir
2026-10-17 11:23 ` [PATCH v2 4/8] lttng-tools: skip kernel cases when kernel tests are disabled OOHehir
2026-10-17 11:23 ` [PATCH v2 5/8] tcl, tcl8: anchor the musl unixInit-3 skip to top-level SKIP lines OOHehir
2026-10-17 11:23 ` [PATCH v2 6/8] tcl, tcl8: skip binary-40.3 on RISC-V OOHehir
2026-10-17 11:23 ` [PATCH v2 7/8] ptest-packagelists.inc: re-enable tcl8 for riscv64 OOHehir
2026-10-17 11:23 ` OOHehir [this message]
2026-10-17 17:53 ` [PATCH v2 0/8] riscv64 ptest fixes Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261017112358.77434-9-oo.hehir@gmail.com \
--to=oo.hehir@gmail.com \
--cc=mathieu.dubois-briand@bootlin.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=raj.khem@gmail.com \
--cc=tgamblin@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.