From patchwork Sat Oct 21 18:47:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 828955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KgCqKy5W"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yKBVn1RPjz9sRn for ; Sun, 22 Oct 2017 05:47:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 49FF025D5D; Sat, 21 Oct 2017 18:47:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S1t0SKYN5eGA; Sat, 21 Oct 2017 18:47:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 46EA625D57; Sat, 21 Oct 2017 18:47:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AADB71C2252 for ; Sat, 21 Oct 2017 18:47:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9F95A88DB8 for ; Sat, 21 Oct 2017 18:47:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8KIrUsMPxpZt for ; Sat, 21 Oct 2017 18:47:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9C0A288DB2 for ; Sat, 21 Oct 2017 18:47:33 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id l8so945295wre.12 for ; Sat, 21 Oct 2017 11:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=iUSAxZ2ftzUBt/YgcSdRPgXfELtXwmANb+lDfYCfSPI=; b=KgCqKy5WkbcxCP6lN1tPxYQ37hT3qpxOAPey0C386lajXX8NI02CQqk2+EyJweeZpN 7dEmGuJ1PldO5ZHvbNcyCeiX5Kp/ILPtrQMo1VdyI/Oj198LvYMj5zJIvPsdBLp8MxJg K0rShzo3LdeAjiteiy+KaZg1mQU6Vv6X4jxTYc128hCz4p8Iu19ESCpq9JXYPFYhwO3x 9KTholLLtOlIjyzZ8UWLrRSTPX+tFsYLi0PXDBypSyuLnU6kQMLw3MW164+FzZfGa5ts KiKKXAtB/GNHxgl5rYMkBIxmUZgkHCoSzmIEIaSPun5CC8UY5BdB7s7iCCL2wHSYi9cV aWog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iUSAxZ2ftzUBt/YgcSdRPgXfELtXwmANb+lDfYCfSPI=; b=ibvYONs1ClTwh0GMCRjfF3rLXcf29S8PwFs+WtW+kWZ/3VqxrLwfJzAbZC94jmPxkS Rz2KgNZRIIuhux0qR6Rcb/3MNGmq0jMsBXbkeAk3roL7I8VTETmfPt8J/6iORojSAFEP 2SKyTJBuUDqEfYaCJiMy2DtBPpP50039hnvZIxtMfnkYWeYp7jbqs8KR9OrF5Nmlm7Zq 6eIt/vXOm8j+f6pT4F3F5t+fGyNCTLkZqRSZJJ9D7Wdx3ao7Gb78/qpgSNCRWexCrNHL Z+8achZp1K8JxPOlsU10DMPn+F1n84aGKBZitYQRir8E6H8t/m+Zxstm5cQTwyxgBjjA 8EMg== X-Gm-Message-State: AMCzsaXLm6iuXnfnnzT2v1IQxehLORdSNn2UwRep1b/mT3ieAaZr/Nzd Mc3yHPNs2/76K73EHJYIIrWd+xqsl20= X-Google-Smtp-Source: ABhQp+QzkLyDK2yIr6aLnjJOGxAKROqcGzzs3eE1nvWAwYP0gRumqutLbkKJjc2gImlzGq4rNwO45A== X-Received: by 10.223.161.210 with SMTP id v18mr4065725wrv.211.1508611651591; Sat, 21 Oct 2017 11:47:31 -0700 (PDT) Received: from localhost.localdomain (nat.sh.cvut.cz. [213.195.201.2]) by smtp.gmail.com with ESMTPSA id e8sm1480667wmc.46.2017.10.21.11.47.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Oct 2017 11:47:30 -0700 (PDT) From: Alexey Brodkin X-Google-Original-From: Alexey Brodkin To: buildroot@busybox.net Date: Sat, 21 Oct 2017 21:47:26 +0300 Message-Id: <1508611646-16386-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.7.5 Cc: Thomas Petazzoni , Alexey Brodkin , Alexey Brodkin Subject: [Buildroot] [PATCH v2] python-numpy: Add support of ARC architecture X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Alexey Brodkin This enables support for ARC cores in numpy. Cherry-picked from https://github.com/numpy/numpy/commit/8edd610ffa3499eea3580f98f296ec80578fba73 Hopefully becomes a part of the next major release (like 1.14). Signed-off-by: Alexey Brodkin --- Changes v1 -> v2: * Cosmetics for the added patch [added SoB, removed "2/2"] package/python-numpy/0002-Add-support-of-ARC.patch | 68 ++++++++++++++++++++++ package/python-numpy/Config.in | 2 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 package/python-numpy/0002-Add-support-of-ARC.patch diff --git a/package/python-numpy/0002-Add-support-of-ARC.patch b/package/python-numpy/0002-Add-support-of-ARC.patch new file mode 100644 index 000000000000..c022487c7f3f --- /dev/null +++ b/package/python-numpy/0002-Add-support-of-ARC.patch @@ -0,0 +1,68 @@ +From 9a225e7d4fb1de5c99c6b5b17cae2fc4c2d1c59a Mon Sep 17 00:00:00 2001 +From: Alexey Brodkin +Date: Fri, 15 Sep 2017 11:59:14 +0300 +Subject: [PATCH] Add support of ARC + +Synopsys DesignWare ARC Processors are a family of 32-bit CPUs +which in some configurations may run Linux kernel and full stack +of applications on top of it. Among other things is Python. + +With that change we allow building and usage of Numpy on ARC. + +Signed-off-by: Alexey Brodkin +--- + numpy/core/include/numpy/npy_cpu.h | 6 ++++++ + numpy/core/include/numpy/npy_endian.h | 6 ++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h +index 60abae4e0b0e..84653ea183ce 100644 +--- a/numpy/core/include/numpy/npy_cpu.h ++++ b/numpy/core/include/numpy/npy_cpu.h +@@ -15,6 +15,8 @@ + * NPY_CPU_ARMEB + * NPY_CPU_SH_LE + * NPY_CPU_SH_BE ++ * NPY_CPU_ARCEL ++ * NPY_CPU_ARCEB + */ + #ifndef _NPY_CPUARCH_H_ + #define _NPY_CPUARCH_H_ +@@ -76,6 +78,10 @@ + #define NPY_CPU_AARCH64 + #elif defined(__mc68000__) + #define NPY_CPU_M68K ++#elif defined(__arc__) && defined(__LITTLE_ENDIAN__) ++ #define NPY_CPU_ARCEL ++#elif defined(__arc__) && defined(__BIG_ENDIAN__) ++ #define NPY_CPU_ARCEB + #else + #error Unknown CPU, please report this to numpy maintainers with \ + information about your platform (OS, CPU and compiler) +diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h +index e34b1d97e655..1a42121db92e 100644 +--- a/numpy/core/include/numpy/npy_endian.h ++++ b/numpy/core/include/numpy/npy_endian.h +@@ -45,7 +45,8 @@ + || defined(NPY_CPU_AARCH64) \ + || defined(NPY_CPU_SH_LE) \ + || defined(NPY_CPU_MIPSEL) \ +- || defined(NPY_CPU_PPC64LE) ++ || defined(NPY_CPU_PPC64LE) \ ++ || defined(NPY_CPU_ARCEL) + #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN + #elif defined(NPY_CPU_PPC) \ + || defined(NPY_CPU_SPARC) \ +@@ -56,7 +57,8 @@ + || defined(NPY_CPU_SH_BE) \ + || defined(NPY_CPU_MIPSEB) \ + || defined(NPY_CPU_OR1K) \ +- || defined(NPY_CPU_M68K) ++ || defined(NPY_CPU_M68K) \ ++ || defined(NPY_CPU_ARCEB) + #define NPY_BYTE_ORDER NPY_BIG_ENDIAN + #else + #error Unknown CPU: can not set endianness +-- +2.7.5 + diff --git a/package/python-numpy/Config.in b/package/python-numpy/Config.in index f7822efc796c..859542f58425 100644 --- a/package/python-numpy/Config.in +++ b/package/python-numpy/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS bool # Numpy has some CPU specific code - default y if BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 \ + default y if BR2_arc || BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 \ || BR2_mips || BR2_mipsel || BR2_powerpc || BR2_powerpc64 \ || BR2_sh || BR2_x86_64