flasher_stub: pass -mabi=ilp32, add EXTRA_CFLAGS, to allow building with a stock compiler (ESPTOOL-643) #856
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
I'm trying to resume work that I started a few years ago (see #499, #500, #501, Debian bug #948096) to try to have Debian ship the esptool flasher stubs.
The TL;DR is that packages in Debian need to build from source and cannot ship binary blobs, and that includes both the stub binaries, as well as precompiled toolchains. Therefore the current Debian maintainer has opted into removing the stubs entirely. (The package is also a bit stagnated, currently at v2.8, and I'm trying to fix that).
For the RISC-V chips, there is no riscv32-esp-elf-gcc compiler in Debian (obviously :), but riscv64-unknown-elf-gcc (
riscv64-unknown-elf-gcc (12.1.0-7+11) 12.1.0
) exists, and picolibc supports RISC-V as well. What is required on a recent Debian system is:...plus the two commits in this PR, and then:
After this, the resulting stub for a ESP32-C3 that I have in my disposal seemed to work fine for me. I don't have any other RISCV hardware to test this with.
Yes, I realize this will be entirely unsupported by Espressif. The two changes here are miniscule and no-ops for the Espressif toolchain -- the in-tree precompiled blobs remain unchanged.
Side note
The ESP8266 stub also builds and works on another test board that I have. No modifications are necessary. All that's needed is to:
For the record, these are
xtensa-lx106-elf-gcc (12.2.0-9+12) 12.2.0
and picolibc 1.8.Sadly, there is no compiler for the ESP32/ESP32-S2/ESP32-S3 in Debian, nor there is support for them in picolibc. Currently I have local patches to remove
$(STUB_ELF_32) $(STUB_ELF_32S2) $(STUB_ELF_32S3_BETA_2) $(STUB_ELF_32S3)
fromall
andembed
. It'd be nice to have some generalized way to build for specific chips.