All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 0/2] Micropython package
Date: Fri, 18 Sep 2015 21:43:10 +1200	[thread overview]
Message-ID: <CAFOYHZDSreZL_4FWoF7WzyChSx=Me1QO8NqtK25w8Js9NWyH8A@mail.gmail.com> (raw)
In-Reply-To: <55FBD989.7020102@imgtec.com>

On Fri, Sep 18, 2015 at 9:29 PM, Vicente Olivert Riera
<Vincent.Riera@imgtec.com> wrote:
> Dear Chris Packham,
>
> On 09/18/2015 09:22 AM, Chris Packham wrote:
>> On Fri, Sep 18, 2015 at 7:32 PM, Thomas Petazzoni
>> <thomas.petazzoni@free-electrons.com> wrote:
>>> Chris,
>>>
>>> On Thu, 17 Sep 2015 11:29:57 +1200, Chris Packham wrote:
>>>
>>>> Chris Packham (2):
>>>>   micropython: new package
>>>>   micropython-lib: new packages
>>>
>>> There are a number of build failures caused by Micropython in the
>>> autobuilders:
>>>
>>>  * On MIPS64
>>>    http://autobuild.buildroot.org/results/99a/99a610c72877fef53d93e1a923bd5c71b3376618/build-end.log
>>>
>>>  * On Xtensa
>>>    http://autobuild.buildroot.org/results/670/670907760d6b3e7eb46b433647b392cec3bafdcd/build-end.log
>>>
>>>  * On SH4A
>>>    http://autobuild.buildroot.org/results/f5a/f5a2c563b8bdab9e345960a5b92d31f3f92dba00/build-end.log
>>>
>>> See http://autobuild.buildroot.org/?reason=micropython-v1.4.5 for the
>>> complete list of build failures.
>>>
>>> If you could look into these, it would be helpful.
>>
>> Xtensa and SH4A look like they need MICROPY_GCREGS_SETJMP I'll send a
>> patch for them shortly. The MIPS64 one looks different so might need
>> some investigation.
>
> as the build error says, a right shift is being performed in the
> py/objint_mpz.c file, and the offending one is at line #54:
>
> MP_SSIZE_MAX >> MPZ_DIG_SIZE * 4
>
> in MIPS64 n64 the MP_SSIZE_MAX is 64-bit wide and the value of
> MPZ_DIG_SIZE 16, so MPZ_DIG_SIZE * 4 is 64. That shift causes a warning
> because its trying to shift 64 bits of a 64-bit variable:
>
> py/objint_mpz.c:54:5: error: right shift count >= width of type [-Werror]
>
> MIPS32 and MIPS64 n32 are fine because MP_SSIZE_MAX is 32-bit wide and
> the #if clauses in the py/objint_mpz.c protect that to happen.
>
> Look at this test for MIPS32:
>
> $ mips-linux-gnu-gcc -mips32r2 -EB ssize_t.c -o ssize_t
> $ qemu-mips ssize_t
> MP_SSIZE_MAX: 32 bits
> MPZ_DIG_SIZE: 16
> right-shifting 0 bits
> right-shifting 16 bits
>
> And now look at the same test for MIPS64 n64:
>
> $ mips-linux-gnu-gcc -mips64r2 -mabi=64 -EB ssize_t.c -o ssize_t
> ssize_t.c: In function 'main':
> ssize_t.c:24:2: warning: right shift count >= width of type
>   (MP_SSIZE_MAX >> MPZ_DIG_SIZE * 4) & DIG_MASK;
>   ^
> $ qemu-mips64 ssize_t
> MP_SSIZE_MAX: 64 bits
> MPZ_DIG_SIZE: 16
> right-shifting 0 bits
> right-shifting 16 bits
> right-shifting 32 bits
> right-shifting 48 bits
> right-shifting 64 bits
>
> I don't know what's the purpose of the code in py/objint_mpz.c and I
> don't know if they really want to do a 64-bit shift of a 64-bit
> variable. But the thing is that since it's compiled with the -Werror
> flag, that warning makes the compilation to fail.
>
> If they really want to do such a shift, then they should remove the
> -Werror. But if they don't want to do such a shift, then more #if
> clauses are needed in order to prevent that to happen. Perhaps you could
> talk with upstream about this.
>

I raised an issue [1]. But in the meantime I think I've found the
right setting to pass for a 64 bit target. Patch to follow.

[1] - https://github.com/micropython/micropython/issues/1465

  reply	other threads:[~2015-09-18  9:43 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 [this message]
2015-09-18  9:51                     ` [Buildroot] [PATCH] micropython: Set MPZ_DIG_SIZE=32 for 64 bit targets Chris Packham
2015-09-18 10:02                       ` 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='CAFOYHZDSreZL_4FWoF7WzyChSx=Me1QO8NqtK25w8Js9NWyH8A@mail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.