Re: Xtensa LX7/RISCv32 (ESP) toolchain: picolibc.specs location
- In reply to: Tomek CEDRO : "Re: Xtensa LX7/RISCv32 (ESP) toolchain: picolibc.specs location"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 10 Jul 2026 16:40:43 UTC
Am Tage des Herren Mon, 6 Jul 2026 15:49:12 +0200
Tomek CEDRO <tomek@cedro.info> schrieb:
> On Mon, Jul 6, 2026 at 5:35 AM A FreeBSD User <freebsd@walstatt-de.de> wrote:
> >
> > 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
>
> Hey there Oliver, have you tried Linux binaries provided by ESP-IDF on
> FeeBSD? I work that way :-)
>
> The order is following:
> 1. `git clone https://github.com/espressif/esp-idf.git`
> 2. `./install.sh` creates the Python venv.
> 3. `./tools/idf_tools.py` using python venv fetches the desired tools.
> 4. `/.export.sh` provides shell env, or you can add manually tools
> that you need.
>
> I patched the upstream so it fetches Linux binaries on FreeBSD that
> work out of the box for me for Xtensa*, RV, etc, when building NuttX
> RTOS firmwares. You just need to have Linuxlator enabled and then add
> these tools to your path :-)
>
> I did not make OpenOCD (ESP-IDF-Linux-Xtensa) running on FreeBSD yet
> but I can live with that I use mostly native FreeBSD binary anyways
> :-)
>
> ps/1: You may want to take a look at Apache NuttX RTOS
> (https://nuttx.apache.org/) Espressif have dedicated team for NuttX so
> their chips coverage is full and ups to date.
>
> ps/2: Yes Espressif is known to flip things upside down all the time,
> even with minor releases (especially when using esp-idf sdk). They
> changed syntax for esptool v5 too! Recently they started obsoleting
> their MCUs just like the software (i.e. ESP32-P4 that I bought fresh
> out of the box from WaveShare was v1.3 while their "recent" chip
> revision is v3.1 that is incompatible with v1.3 lol) beware!!
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>
Hello and my apology for the delay. Thank you very much for answering.
Shortly after I wrote this email and dust has settled, I simply put the file in question,
picolibc.spces, in the only folder I haven't tried, which is ${PREFIX}/xtensa-esp-elf/bin,
after checking which --search-path-dirs the toolchain uses. Well, sometimes emlightenment
stikes when already asked ..
I'm not very fond of having this Linux stuff on FreeBSD, especially the always-be-online-ESP
stuff. In most cases, I'm behind a low bandwith line or with restricted internet access.
ports/packages are a sine condition non qua and I'm happy having some tools made a packge so
far.
Thank you for you hint towards NuttX, I'll look at this RTOS. And sad news about ESP32-P4 - I
bought mine last year and at the beginning of the yeat, they are definitely 1.0 or 1.3. For a
MQTT based idea/project I bought those PoE/ETH type for small money and I hope those bare
ESP32-P4 without that fancy stuff will be a suitable low cost Flight Controller for
Drones/Quadcopter (at the moment, this is my main aim, since betaflight and ArduPilot are
supposed to compile on ES32 usiing the ESP-IDF ...
Kind regards and many thanks,
Oliver
--
A FreeBSD user