You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that when a user selects "Exceptions: Enabled" in the Arduino IDE, it links the firmware against a different C++ standard library which has exceptions enabled: libstdc++-exc.a instead of libstdc++.a. This can be seen in https://github.com/esp8266/Arduino/tree/master/tools/sdk/lib.
The framework's builder code links blindly only against the non-exception-enabled C++ library
Without a modified LIBS value (replace stdc++ with stdc++-exc), the firmware does an immediate abort() when an exception is encountered, even though it is catched.
The documentation (https://docs.platformio.org/en/latest/platforms/espressif8266.html#exceptions) tells us that in order to activate exceptions, we must add
to the
platformio.ini
.This is wrong for Arduino-ESP8266, as documented in this topic: https://community.platformio.org/t/platformio-cannot-handle-exceptions-with-esp8266/16738
The problem is that when a user selects "Exceptions: Enabled" in the Arduino IDE, it links the firmware against a different C++ standard library which has exceptions enabled:
libstdc++-exc.a
instead oflibstdc++.a
. This can be seen in https://github.com/esp8266/Arduino/tree/master/tools/sdk/lib.The framework's builder code links blindly only against the non-exception-enabled C++ library
https://github.com/esp8266/Arduino/blob/7f38e141c7502032af594fdd502c1b1f6049377c/tools/platformio-build.py#L124-L128
This should be adapted so that e.g a macro like
PIO_FRAMEWORK_ARDUINO_EXCEPTIONS_ENABLED
changes theLIBS
correctly.For testing, the code
and
platformio.ini
Without a modified
LIBS
value (replacestdc++
withstdc++-exc
), the firmware does an immediateabort()
when an exception is encountered, even though it is catched.in the fixed version the output is correct.
The text was updated successfully, but these errors were encountered: