summaryrefslogtreecommitdiff
path: root/user/spack/archspec-fix-cpu-family-detection.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/spack/archspec-fix-cpu-family-detection.patch')
-rw-r--r--user/spack/archspec-fix-cpu-family-detection.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/user/spack/archspec-fix-cpu-family-detection.patch b/user/spack/archspec-fix-cpu-family-detection.patch
new file mode 100644
index 000000000..a3979ec95
--- /dev/null
+++ b/user/spack/archspec-fix-cpu-family-detection.patch
@@ -0,0 +1,16 @@
+See also: https://github.com/archspec/archspec/issues/102
+
+diff --git a/lib/spack/external/archspec/cpu/detect.py b/lib/spack/external/archspec/cpu/detect.py
+index a7cc4481f6..cadd593ca2 100644
+--- a/lib/spack/external/archspec/cpu/detect.py
++++ b/lib/spack/external/archspec/cpu/detect.py
+@@ -92,7 +92,8 @@ def _machine():
+
+ # If we are not on Darwin, trust what Python tells us
+ if operating_system != "Darwin":
+- return platform.machine()
++ machine = platform.machine()
++ return TARGETS[machine].family.name if machine in TARGETS else machine
+
+ # On Darwin it might happen that we are on M1, but using an interpreter
+ # built for x86_64. In that case "platform.machine() == 'x86_64'", so we