python3-numpy: import patch to fix build for non explicitely supported architectures (e.g. riscv)

This commit is contained in:
John 2023-10-11 09:57:45 +02:00
parent 9f2ccc2c04
commit 8a1fe2a4cb

View file

@ -0,0 +1,35 @@
From 38edef779f9cfa353a0f3ceb598895810ce405e6 Mon Sep 17 00:00:00 2001
From: Sayed Adel <seiko@imavr.com>
Date: Mon, 18 Sep 2023 10:12:35 +0400
Subject: [PATCH] BLD, BUG: Fix build failure for host flags e.g.
`-march=native` on unsupported architectures
---
meson_cpu/meson.build | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/meson_cpu/meson.build b/meson_cpu/meson.build
index 97b33c461b9..ed2313bc6a6 100644
--- a/meson_cpu/meson.build
+++ b/meson_cpu/meson.build
@@ -98,7 +98,7 @@ if host_machine.endian() == 'little' and cpu_family == 'ppc64'
min_features = [VSX2]
endif
-# Used by build option 'max'
+# Used by build option 'max/native/detect'
max_features_dict = {
'x86': X86_FEATURES,
'x86_64': X86_FEATURES,
@@ -111,6 +111,11 @@ max_features = []
foreach fet_name, fet_obj : max_features_dict
max_features += [fet_obj]
endforeach
+if max_features.length() == 0
+ message('Disabling CPU feature detection due to unsupported architecture: "' + cpu_family + '"')
+ CPU_CONF_BASELINE = 'none'
+ CPU_CONF_DISPATCH = 'none'
+endif
parse_options = {
'cpu-baseline': CPU_CONF_BASELINE,