Missing feature
As noted in #3695, https://github.com/espressif/crosstool-NG and can, without too many changes, be used to build NodeMCU, even on a MacOS host. But it doesn't entirely support ESP8266-based targets.
Justification
The above-mentioned crosstool-NG has everything needed to target ESP8266, except for some runtime libraries. Versions of the runtime libraries that are compatible for at least some purposes are available as part of e.g. https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-macos.tar.gz (one of a collection of prebuilt toolchains that do know about ESP8266 but unfortunately don't know about Apple Silicon).
Ideally this would be fixed by adding those runtime libraries to the crosstool-NG repository, alongside the corresponding libraries for ESP32.
Meanwhile, we can instead have the NodeMCU makefile download the above toolchain in addition to the crosstool-NG toolchain, merely for use as a donor of runtime libraries.
Workarounds
I have a clone of nodemcu-firmware which I have tweaked so that I can build for ESP8266 on MacOS 15.5 on an Apple Silicon machine.
Missing feature
As noted in #3695, https://github.com/espressif/crosstool-NG and can, without too many changes, be used to build NodeMCU, even on a MacOS host. But it doesn't entirely support ESP8266-based targets.
Justification
The above-mentioned crosstool-NG has everything needed to target ESP8266, except for some runtime libraries. Versions of the runtime libraries that are compatible for at least some purposes are available as part of e.g. https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-macos.tar.gz (one of a collection of prebuilt toolchains that do know about ESP8266 but unfortunately don't know about Apple Silicon).
Ideally this would be fixed by adding those runtime libraries to the crosstool-NG repository, alongside the corresponding libraries for ESP32.
Meanwhile, we can instead have the NodeMCU makefile download the above toolchain in addition to the crosstool-NG toolchain, merely for use as a donor of runtime libraries.
Workarounds
I have a clone of nodemcu-firmware which I have tweaked so that I can build for ESP8266 on MacOS 15.5 on an Apple Silicon machine.