@@ -26,6 +26,13 @@ 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 onwards expands ceil/floor/trunc inline on riscv64 but runs the fcvt
+# before the range check, so +-inf raises FE_INVALID & numpy's
+# test_unary_spurious_fpexception fails. Make it call libm instead.
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=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() {
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 | 7 +++++++ 1 file changed, 7 insertions(+)