Kia ora Frédéric, On 17/12/2025 03:32, Frédéric Fauberteau wrote:
Hi folks,
I have the impression that the cross/xtensa-esp-elf-{binutils,gcc} toolchain doesn't allow building a valid image for an ESP32 chip. I would like to try building a package in wip inspired by https://cgit.freebsd.org/ports/tree/devel/xtensa-esp-elf to provide toochains for {esp32,esp32s2,esp32s3}-based chips.
The FreeBSD port includes both binutils and GCC and it based on the official Espressif toolchain built on top of Crosstool-NG.
I created cross/common-gnu-toolchain that does a lot of heavy lifting for building GNU cross compilers. It's currently used for cross/riscv64-none-elf-* and a number of other hardware targets. I haven't tried making this work with a fork of the GNU toolchain, but I'm happy to help. I have some ESP32 boards somewhere, so having a working toolchain would be nice.
2. For a toolchain for foo-arch-elf, is there a reason to install it in ${PREFIX}/foo-arch-elf?
It should be installed in ${PREFIX}/cross-foo-arch-elf and not ${PREFIX}/foo-arch-elf AFAICT. I suspect that mostly the toolchain is installed in its own directory is because it has a lot of files and nobody wants to manage any filename conflicts. The only conflicts I can see in the packages I have worked on are the info files which are target independent, but version dependent.
Ngā mihi, Lloyd