From: Chris Packham <judge.packham@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] micropython: Set MPZ_DIG_SIZE=32 for 64 bit targets
Date: Fri, 18 Sep 2015 21:51:52 +1200 [thread overview]
Message-ID: <1442569912-13452-1-git-send-email-judge.packham@gmail.com> (raw)
In-Reply-To: <CAFOYHZDSreZL_4FWoF7WzyChSx=Me1QO8NqtK25w8Js9NWyH8A@mail.gmail.com>
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 <judge.packham@gmail.com>
---
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) \
--
2.5.0
next prev parent reply other threads:[~2015-09-18 9:51 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 10:21 [Buildroot] [PATCH] micropython: new package Chris Packham
2015-09-14 13:06 ` Vicente Olivert Riera
2015-09-14 23:14 ` Chris Packham
2015-09-14 13:40 ` Vicente Olivert Riera
2015-09-14 22:44 ` Chris Packham
2015-09-14 13:58 ` Thomas Petazzoni
2015-09-14 14:12 ` Vicente Olivert Riera
2015-09-14 23:03 ` Chris Packham
2015-09-15 8:24 ` Thomas Petazzoni
2015-09-15 19:49 ` Jörg Krause
2015-09-14 23:01 ` Chris Packham
2015-09-15 8:23 ` Thomas Petazzoni
2015-09-15 0:01 ` [Buildroot] [PATCHv2] " Chris Packham
2015-09-15 10:14 ` Vicente Olivert Riera
2015-09-15 10:19 ` Vicente Olivert Riera
2015-09-15 21:30 ` Chris Packham
2015-09-15 22:03 ` Thomas Petazzoni
2015-09-15 21:54 ` Chris Packham
2015-09-15 22:49 ` [Buildroot] [PATCHv3] " Chris Packham
2015-09-16 6:25 ` Jerzy Grzegorek
2015-09-16 21:12 ` Thomas Petazzoni
2015-09-16 23:28 ` Chris Packham
2015-09-16 23:29 ` [Buildroot] [PATCH v4 0/2] Micropython package Chris Packham
2015-09-16 23:29 ` [Buildroot] [PATCH v4 1/2] micropython: new package Chris Packham
2015-09-17 8:56 ` Vicente Olivert Riera
2015-09-18 4:54 ` Chris Packham
2015-09-16 23:29 ` [Buildroot] [PATCH v4 2/2] micropython-lib: new packages Chris Packham
2015-09-17 8:56 ` Vicente Olivert Riera
2015-09-17 21:48 ` [Buildroot] [PATCH v4 0/2] Micropython package Thomas Petazzoni
2015-09-18 7:32 ` Thomas Petazzoni
2015-09-18 8:22 ` Chris Packham
2015-09-18 9:19 ` [Buildroot] [PATCH] micropython: Set MICROPY_GCREGS_SETJMP=1 for xtensa and sh Chris Packham
2015-09-19 12:00 ` Thomas Petazzoni
2015-09-18 9:29 ` [Buildroot] [PATCH v4 0/2] Micropython package Vicente Olivert Riera
2015-09-18 9:43 ` Chris Packham
2015-09-18 9:51 ` Chris Packham [this message]
2015-09-18 10:02 ` [Buildroot] [PATCH] micropython: Set MPZ_DIG_SIZE=32 for 64 bit targets Vicente Olivert Riera
2015-09-19 9:19 ` Chris Packham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442569912-13452-1-git-send-email-judge.packham@gmail.com \
--to=judge.packham@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox