From patchwork Fri Sep 18 09:51:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 519208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id A0BB01401F0 for ; Fri, 18 Sep 2015 19:52:22 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=VghvTtiF; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DAA709563A; Fri, 18 Sep 2015 09:52:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eNo9UZ29enzv; Fri, 18 Sep 2015 09:52:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E8DF99562F; Fri, 18 Sep 2015 09:52:20 +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 1726E1C0CB7 for ; Fri, 18 Sep 2015 09:52:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0FD66922B4 for ; Fri, 18 Sep 2015 09:52:20 +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 sdZw+0k1B-wy for ; Fri, 18 Sep 2015 09:52:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by whitealder.osuosl.org (Postfix) with ESMTPS id D664D922AF for ; Fri, 18 Sep 2015 09:52:18 +0000 (UTC) Received: by padhk3 with SMTP id hk3so47014347pad.3 for ; Fri, 18 Sep 2015 02:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OwROkKjyscYP2EMu3e+8uTzz5dPxeY0Nk7mFPuO8IfI=; b=VghvTtiFzexeJBWKVyAWiCKHoEnPu/ZRCRPA7217jGPA7VZcJ4qv9NqnDZdrjdK7GM FKsk5vJTsFBYGDa+8f3ubpdviZCqxgXIAr8CrrFH8jnsAF/KwMKH9DvFICowNGXMl7Kc /z8YptfpTNoSsDkHsq7isUYcGGzZVWJv4678h2kylZrWdFhtuc1VBUI3fnoiICJQ9chk I6/5cBegUE2hXq11qy1PKyUxPETjZoJOA0bBuQEjSHrCAc4CXrroi2N0sXC2+U57Uv8A SOh7bk+5KQ9TwoxZRtfFBN97Kwc8SqyTfLywo9AAg2hgNSq1YBPlfdhOgxUW1AsJ15eB 5QNQ== X-Received: by 10.68.110.132 with SMTP id ia4mr6154541pbb.165.1442569938352; Fri, 18 Sep 2015 02:52:18 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc (2-163-36-202-static.alliedtelesis.co.nz. [202.36.163.2]) by smtp.gmail.com with ESMTPSA id xv1sm8035029pbb.25.2015.09.18.02.52.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 02:52:17 -0700 (PDT) From: Chris Packham To: buildroot@buildroot.org Date: Fri, 18 Sep 2015 21:51:52 +1200 Message-Id: <1442569912-13452-1-git-send-email-judge.packham@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: Cc: thomas.petazzoni@free-electrons.com Subject: [Buildroot] [PATCH] micropython: Set MPZ_DIG_SIZE=32 for 64 bit targets 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 the micropython source: This mpz module implements arbitrary precision integers. The storage for each digit is defined by mpz_dig_t. The actual number of bits in mpz_dig_t that are used is defined by MPZ_DIG_SIZE. The machine must also provide a type that is twice as wide as mpz_dig_t, in both signed and unsigned versions MPZ_DIG_SIZE can be between 4 and 8*sizeof(mpz_dig_t), but it makes most sense to have it as large as possible. Micropython detects x86_64 targets and sets MPZ_DIG_SIZE appropriately but for other 64-bit targets we need to explicitly pass -DMPZ_DIG_SIZE=32 in CFLAGS. Signed-off-by: Chris Packham --- package/micropython/micropython.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/micropython/micropython.mk b/package/micropython/micropython.mk index 6266882..1ac2e8d 100644 --- a/package/micropython/micropython.mk +++ b/package/micropython/micropython.mk @@ -16,6 +16,10 @@ ifeq ($(BR2_powerpc)$(BR2_sh)$(BR2_xtensa),y) MICROPYTHON_CFLAGS = -DMICROPY_GCREGS_SETJMP=1 endif +ifeq ($(BR2_ARCH_IS_64),y) +MICROPYTHON_CFLAGS += -DMPZ_DIG_SIZE=32 +endif + define MICROPYTHON_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/unix \ CROSS_COMPILE=$(TARGET_CROSS) \