PlatformIO cannot handle exceptions with ESP8266

Well, that was easy. When sifting through the Arduino IDE linker commands it because apparent…

The linker flags in the Arduino IDE, with exceptions enabled, read:

-lhal -lphy -lpp -lnet80211 -llwip2-536-feat -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++-exc -lm -lc -lgcc -Wl,--end-group

Notice the -lstdc++-exc library in there… well PlatformIO does

…just a linking with stdc++ instead of stdc++-exc in all cases.

Replacing stdc++ with stdc++-exc immediately makes the firmware work with PlatformIO (in C:\Users\<user>\.platformio\packages\framework-arduinoespressif8266\tools\platformio-build.py)

I’ll propose a patch into GitHub - platformio/platform-espressif8266: Espressif 8266: development platform for PlatformIO to get this working.

1 Like