kentindell / canhack

The Yes We CAN project of Canis Labs
MIT License
326 stars 63 forks source link

Patch V1.18 in macos #15

Closed Miki-AG closed 2 years ago

Miki-AG commented 2 years ago

I have been able to successfully build the new V1.18 firmware in my Ubuntu box. However, when running the same build in my macos machine I run into the below error:

[ 14%] Building C object CMakeFiles/firmware.dir/Users/user55/dev/mpe-firmware/pico/micropython/py/emitnx86.c.obj
[ 14%] Building C object CMakeFiles/firmware.dir/Users/user55/dev/mpe-firmware/pico/micropython/py/emitnxtensa.c.obj
[ 15%] Building C object CMakeFiles/firmware.dir/Users/user55/dev/mpe-firmware/pico/micropython/py/emitnxtensawin.c.obj
[ 15%] Building C object CMakeFiles/firmware.dir/Users/user55/dev/mpe-firmware/pico/micropython/py/formatfloat.c.obj
/Users/user55/dev/mpe-firmware/pico/micropython/py/formatfloat.c:105:5: internal compiler error: Illegal instruction: 4
  105 |     MICROPY_FLOAT_CONST(1e32), MICROPY_FLOAT_CONST(1e16), MICROPY_FLOAT_CONST(1e8), MICROPY_FLOAT_CONST(1e4), MICROPY_FLOAT_CONST(1e2), MICROPY_FLOAT_CONST(1e1)
      |     ^~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.linaro.org/> for instructions.
make[3]: *** [CMakeFiles/firmware.dir/Users/user55/dev/mpe-firmware/pico/micropython/py/formatfloat.c.obj] Error 1
make[2]: *** [CMakeFiles/firmware.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

Any idea what could be wrong?

kentindell commented 2 years ago

I didn't even think you could build MicroPython in macOS (or Windows for that matter).

Miki-AG commented 2 years ago

Seems it can be done, but you are right this is not related to canhack.

Miki-AG commented 2 years ago

Just in case someone else faces the same problem, the issue happens when using version 11.2 of the arm-none-eabi-gcc compiler (there is a bug in the current version). Downgrading to 10.3 solved the issue for me. The issue only occurs on certain machines. See https://bugs.linaro.org/show_bug.cgi?id=5825 for more information.

kentindell commented 2 years ago

Thanks for that. I've added a note to the README.txt pointing at this.