pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ESP32 toolchain



On Mon, Dec 15, 2025 at 10:50:58AM -0500, Greg Troxel wrote:
Frédéric Fauberteau <triaxx%netbsd.org@localhost> writes:

(cross/xtensa-esp-elf-{binutils, gcc}).
Actually, the produced binary is a ELF 32-bit MSB executable. But it seems that ESP32 chips are little endian and the cross GCC should produce a LSB executable.

Therefore I have packaged in wip another cross toolchain: wip/xtensa-esp32-elf-{binutils, gcc} that uses the Espressif overlays. It is based on cross/xtensa-esp-elf-{binutils, gcc}: thank you tnn@ for your initial packaging.

I am theoretically interested but have not gotten to this yet.

The larger situation is seeming messy, at least in my head.  I don't
think it's ok to add a package with a similar name and different
behavior without trying to resolve the confusion.

ESP is a vague name, covering at least esp8266 and esp32 as I hear it.
Do you believe that cross/xtensa-esp-elf-gcc is really for esp8266 only,
and that the esp8266 family really is big endian?  Are you proposing to
change the DESCR for that port?  To rename it to esp8266 or to explain
that 'esp' means 'esp8266'?

AFAIK, it's xtensa-lx106-elf* which is for esp8266.
I tried using xtensa-esp-elf-gcc, before giving up because it's way too
recent for the software I was trying to build (I ended up using the
provided linux binary, which is a gcc 4.8-something). But from what I
remember, xtensa-esp-elf-gcc supports multiple architectures, big and
little-endian. You have to use the right gcc switch for your target.

Perhaps I haven't looked hard enough, but I haven't seen an option to specify the endianness with xtensa-esp-elf-gcc.

I use the PlatformIO framework and I found a similar naming:

% find ~/.platformio/packages -name "xtensa*gcc"
/Users/triaxx/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/bin/xtensa-esp32-elf-gcc
/Users/triaxx/.platformio/packages/toolchain-xtensa-esp32s3@8.4.0+2021r2-patch5/bin/xtensa-esp32s3-elf-gcc
/Users/triaxx/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-gcc
/Users/triaxx/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc
/Users/triaxx/.platformio/packages/toolchain-xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc
/Users/triaxx/.platformio/packages/toolchain-xtensa-esp-elf/bin/xtensa-esp32s2-elf-gcc
/Users/triaxx/.platformio/packages/toolchain-xtensa-esp-elf/bin/xtensa-esp-elf-gcc
/Users/triaxx/.platformio/packages/toolchain-xtensa-esp-elf/bin/xtensa-esp32-elf-gcc

I tested xtensa-esp-elf-gcc from the PlatformIO's packages and it also produced a MSB executable. I though it could be a expected behaviour.

But I think it should be relevant to include both compiler in the same package.

Home | Main Index | Thread Index | Old Index