Xtensa LX7/RISCv32 (ESP) toolchain: picolibc.specs location

From: A FreeBSD User <freebsd_at_walstatt-de.de>
Date: Mon, 06 Jul 2026 05:34:12 UTC
Hello,

first of all I am a absolute beginner in embedded development! So, my knowledge about certain
toolchains and library specifica is limited.

I use FreeBSD (15/1-STABLE and CURRENT) a the development platform and for some ESP32
projects I'd like to utilize the ESP32 toolchain provided here

https://github.com/trombik/xtensa-esp32-elf

The port/toolchain does build for almost all espressif provided ESP-IDF (see
https://github.com/espressif/esp-idf), except esp-idf-v55 (espressif did change somehow the
requirements within a minor release update). I'm with ESP-IDF v6.0.2 using both Xtensa- and
RISCv32 toolchains with success on some small self-brewn code and on examples.

But: I can't use the default picolibc library! The compiler (gcc14-xtensa or gcc14-riscv32)
bails out with an error not capable of finding any "-spec=picolibc.specs" file.

It seems that such a picolibc.spec file is provided by the port/sources of piclib itself,, but
not installed by the port's framework. So I started fiddling around where the compiler might
search for this default specs file. There is not much information available about the correct
place to put the file, it is said that the file should reside within the toolchain's path -
which is beginning with /usr/local/xtensa-esp-elf-idf60/bin. 
But I failed. Putting picolibc.specs anywhere within this base search path doesn't prevent me
being gifted by the error described above.

So, I guess I lack in fundamental understandings of how this ominous picolibc.spec file works
and what it is intended for and therefor there might someone be willing to enlighten me.

At the moment a workaround is to use old newlib by putting an appropriate sdkconfig.defaults
tag within the tree of the project:

CONFIG_LIBC_NEWLIB=y

Thanks in advance,

Oliver

-- 

A FreeBSD user