diff mbox series

python3-numpy: Always use libgcc for unwinder on aarch64

Message ID 20250807043554.1825077-1-raj.khem@gmail.com
State New
Headers show
Series python3-numpy: Always use libgcc for unwinder on aarch64 | expand

Commit Message

Khem Raj Aug. 7, 2025, 4:35 a.m. UTC
With libgcc (working):

Result: inf
Warnings: ['overflow encountered in cast']

With compiler-rt (failing):

Result: inf (probably still correct)
Warnings: [] (no warnings generated)

The issue is likely that compiler-rt on AArch64 doesn't trigger
the floating-point exceptions that NumPy expects for overflow
detection in type casting operations.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/python/python3-numpy_2.3.1.bb | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-numpy_2.3.1.bb b/meta/recipes-devtools/python/python3-numpy_2.3.1.bb
index c6ab326990d..7ecb9521ca1 100644
--- a/meta/recipes-devtools/python/python3-numpy_2.3.1.bb
+++ b/meta/recipes-devtools/python/python3-numpy_2.3.1.bb
@@ -26,6 +26,9 @@  PACKAGECONFIG[svml] = "-Ddisable-svml=false,-Ddisable-svml=true"
 TOOLCHAIN_OPTIONS:append:toolchain-clang:riscv64 = " -march=rv64gcv"
 TOOLCHAIN_OPTIONS:append:toolchain-clang:riscv32 = " -march=rv32gcv"
 
+# the overflow tests fail with compiler-rt on aarch64
+LDFLAGS:append:toolchain-clang:aarch64 = " -rtlib=libgcc -unwindlib=libgcc"
+
 # Remove references to buildpaths from numpy's __config__.py
 do_install:append() {
     sed -i \