ports/math/py-numpy/files/patch-numpy_distutils_ccompiler__opt.py
Piotr Kubaj 7b822dde35 math/py-numpy: fix runtime on powerpc64*
Currently powerpc64* is not properly detected by numpy, due to python
returning just "powerpc" as architecture name. This commit fixes architecture
detection with numpy and properly checks for CPU features on FreeBSD.
2022-12-29 00:41:28 +00:00

17 lines
1 KiB
Python

--- numpy/distutils/ccompiler_opt.py.orig 2022-11-19 22:40:58 UTC
+++ numpy/distutils/ccompiler_opt.py
@@ -959,8 +959,12 @@ class _CCompiler:
detect_arch = (
("cc_on_x64", ".*(x|x86_|amd)64.*", ""),
("cc_on_x86", ".*(win32|x86|i386|i686).*", ""),
- ("cc_on_ppc64le", ".*(powerpc|ppc)64(el|le).*", ""),
- ("cc_on_ppc64", ".*(powerpc|ppc)64.*", ""),
+ ("cc_on_ppc64le", ".*(powerpc|ppc)64(el|le).*|.*powerpc.*", ""
+ "defined(__LP64__) && "
+ "defined(__LITTLE_ENDIAN__)"),
+ ("cc_on_ppc64", ".*(powerpc|ppc).*|.*powerpc.*", ""
+ "defined(__LP64__) && "
+ "defined(__BIG_ENDIAN__)"),
("cc_on_aarch64", ".*(aarch64|arm64).*", ""),
("cc_on_armhf", ".*arm.*", "defined(__ARM_ARCH_7__) || "
"defined(__ARM_ARCH_7A__)"),