Skip to content

Micropython package

Vicente Olivert Riera buildroot 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 0 repliesNew
  2. v2 posting 2/21 patch 0 repliesSuperseded
  3. v2 posting 1/21 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2micropython: new package+0 -01 reply
2/2micropython-lib: new packages+0 -00 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchVicente Olivert Riera
1/2R-b T-b
2/2R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [Buildroot] [PATCH v4 0/2] Micropython package

Dear Chris Packham,

Quoted 22 lines · Chris Packham
Quoted 20 lines · Thomas Petazzoni

Chris,

Quoted 3 lines · Chris Packham

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

Quoted 8 lines
Quoted 4 lines

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.

Regards,

Vincent.

Quoted 14 lines
Quoted 9 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot