Open slorquet opened 4 years ago
I confirm that I could build the toolchain with these flags in CT-NG .config :
CT_EXTRA_CFLAGS_FOR_HOST="-march=armv7-a -mfloat-abi=hard -mtune=cortex-a5"
The raspberry pi toolchain can be downloaded here: http://www.lorquet.fr/toolchain-esp32-pi/ can you please store it in your github releases and make it available for download when building nodemcu on a pi?
After quite some investigation I traced the build failure of this toolchain to gmp. This happens because the raspi 3 and 4 have a 64-bit CPU but Raspbian (Raspberry pi OS) is still a 32 bit build, which freaks out gmp because optimized assembly routines.
A simple fix in the crosstool configuration file allows to toolchain to be built, documented here: https://github.com/crosstool-ng/crosstool-ng/issues/1288
I suggest that the current patch applied before running the build should include the modification required to add the extra cflags that fix the build:
CT_EXTRA_CFLAGS_FOR_HOST="-march=armv7-a -mfloat-abi=hard -mtune=cortex-a5"
I am not sure yet this is enough for a full build, which has been running for 36 minutes at this moment and will likely not complete for many more hours. I will report additional issues on this topic, but as of now it is sure that this change is absolutely required to make it work.
/proc/cpuinfo can detect the pi version. Here is what I get on a raspberry pi 2:
and on the failing machine:
ooops... so the build also fails on a raspi 2. I updated the title of the issue, and I think that the required patch can be applied as soon as grep on /proc/cpuinfo reports a Raspberry Pi!
edit: seems wrong. I am not sure of anything now! dmesg reports: