Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make exceptions a configurable menu #5434

Merged
merged 5 commits into from
Dec 5, 2018
Merged

Conversation

earlephilhower
Copy link
Collaborator

Add a menu, Exceptions, which allows exceptions to be disabled for ROM
sensitive scripts. Default is enabled.

Add a menu, Exceptions, which allows exceptions to be disabled for ROM
sensitive scripts.  Default is enabled.
@andrethomas
Copy link

Excuse my ignorance, but why is this enabled by default? :)

@earlephilhower earlephilhower self-assigned this Dec 4, 2018
@devyte
Copy link
Collaborator

devyte commented Dec 4, 2018

@andrethomas because Exceptions are a standard C++ language feature, because they're needed to gracefully handle error conditions in class constructors, because we want to replace some custom code with STL standard calls, some of which rely on Exceptions, and because we want to bring in a subset of boost, some of which relies on Exceptions.
Also, migration to a newer C++ standard is on the horizon, and Exceptions are a part of that as well.

@andrethomas
Copy link

andrethomas commented Dec 4, 2018

@devyte Thanks for the clarity, makes sense now! The reason I was asking is that the current codebase fails for me which I guess is because libstdc++-nox.a does not exist yet. I'm weighing up the flash utilization against 2.4.2.

@devyte devyte merged commit e44bcfe into esp8266:master Dec 5, 2018
@earlephilhower earlephilhower deleted the disexc branch December 5, 2018 01:40
@andrethomas2
Copy link

Hi

Compiling from command line

arduino -v --board esp8266:esp8266:generic:xtal=80,CrystalFreq=26,FlashFreq=40,FlashMode=dout,ResetMethod=nodemcu,exception=disabled,ip=hb2f,eesz=1M,wipe=none --verify sonoff.ino

It does not seem to make any difference whether exception=enabled or disabled

It still produced the same binary for me and it is confirmed by the ld script in the build folder

*libstdc++.a:( .literal .text .literal.* .text.*)

This only seems to happen when compiling from command line - when compiling using the Arduino IDE it appears to work as expected.

Any ideas?

@andrethomas
Copy link

Even if I manually edit the boards.txt to disable it irrespective of the selection it still seems to result in an exception enabled binary

generic.menu.exception.enabled=Enabled
generic.menu.exception.enabled.build.exception_flags=-fno-exceptions
generic.menu.exception.enabled.build.stdcpp_lib=-lstdc++-nox
generic.menu.exception.disabled=Disabled
generic.menu.exception.disabled.build.exception_flags=-fno-exceptions
generic.menu.exception.disabled.build.stdcpp_lib=-lstdc++-nox

@andrethomas
Copy link

Hmm, sorry false alarm! My json package build script did not update platform.txt :|

@earlephilhower
Copy link
Collaborator Author

Thanks for the update. On closed bugs/merges sometimes comments get overlooked, so sorry for not replying before you figured it out yourself!

@andrethomas
Copy link

@earlephilhower No sweat - I still think I'm missing something there but I'll figure it out. Great work... can only dream to have as much time and dedication to a single project as you guys have!

Here's hoping for a bug-free release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants