From 766c1b24a57aa8702a8a3bac1cd2b729a376de4e Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Thu, 4 Nov 2021 17:51:04 +0800 Subject: [PATCH] build: support loongarch64 build Signed-off-by: Liwei Ge --- 1000-numpy-anolis-support-loongarch64.patch | 23 +++++++++++++++++++++ numpy.spec | 8 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 1000-numpy-anolis-support-loongarch64.patch diff --git a/1000-numpy-anolis-support-loongarch64.patch b/1000-numpy-anolis-support-loongarch64.patch new file mode 100644 index 0000000..3589900 --- /dev/null +++ b/1000-numpy-anolis-support-loongarch64.patch @@ -0,0 +1,23 @@ +diff -Nurp numpy-1.17.3.orig/numpy/core/include/numpy/npy_cpu.h numpy-1.17.3/numpy/core/include/numpy/npy_cpu.h +--- numpy-1.17.3.orig/numpy/core/include/numpy/npy_cpu.h 2019-08-30 23:11:42.000000000 +0000 ++++ numpy-1.17.3/numpy/core/include/numpy/npy_cpu.h 2021-01-25 04:42:36.910156250 +0000 +@@ -102,6 +102,8 @@ + #define NPY_CPU_ARCEB + #elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 + #define NPY_CPU_RISCV64 ++#elif defined(__loongarch64) ++ #define NPY_CPU_LOONGARCH64 + #else + #error Unknown CPU, please report this to numpy maintainers with \ + information about your platform (OS, CPU and compiler) +diff -Nurp numpy-1.17.3.orig/numpy/core/include/numpy/npy_endian.h numpy-1.17.3/numpy/core/include/numpy/npy_endian.h +--- numpy-1.17.3.orig/numpy/core/include/numpy/npy_endian.h 2019-08-30 23:11:42.000000000 +0000 ++++ numpy-1.17.3/numpy/core/include/numpy/npy_endian.h 2021-01-25 04:42:36.910156250 +0000 +@@ -48,6 +48,7 @@ + || defined(NPY_CPU_MIPSEL) \ + || defined(NPY_CPU_PPC64LE) \ + || defined(NPY_CPU_ARCEL) \ ++ || defined(NPY_CPU_LOONGARCH64) \ + || defined(NPY_CPU_RISCV64) + #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN + #elif defined(NPY_CPU_PPC) \ diff --git a/numpy.spec b/numpy.spec index 4c083ff..20038d4 100644 --- a/numpy.spec +++ b/numpy.spec @@ -1,6 +1,7 @@ +%define anolis_release .0.1 Name: numpy Version: 1.14.3 -Release: 10%{?dist} +Release: 10%{anolis_release}%{?dist} Epoch: 1 Summary: A fast multidimensional array facility for Python @@ -12,6 +13,7 @@ Source1: https://docs.scipy.org/doc/numpy/numpy-html-1.14.2.zip Patch0: f2py-setup.patch Patch1: numpy-1.14.3-float128.patch Patch2: numpy-1.14.3-CVE-2019-6446.patch +Patch1000: 1000-numpy-anolis-support-loongarch64.patch BuildRequires: python3-devel python3-setuptools python3-nose python3-Cython BuildRequires: lapack-devel gcc-gfortran @@ -89,6 +91,7 @@ This package provides the complete documentation for NumPy. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch1000 -p1 # workaround for rhbz#849713 # http://mail.scipy.org/pipermail/numpy-discussion/2012-July/063530.html @@ -202,6 +205,9 @@ fi %changelog +* Thu Nov 4 2021 Liwei Ge - 1:1.14.3-10.0.1 +- Support loongarch64 platform + * Fri Jul 30 2021 Tomas Orsava - 1:1.14.3-10 - Adjusted the postun scriptlets to enable upgrading to RHEL 9 - Resolves: rhbz#1933055 -- Gitee