I am using Raisonance's Ride7/Codesourcery (a.k.a Sourcery CodeBench Lite) with an STM32F4 board developing a bare metal HMI platform.
I will be making use of C++ exceptions in this system, but any exception I throw ends with a "Terminate called recursively" error written to stderr.
Code to reproduce the problem: (main.cpp)
int main(void)
{
try {
throw 1;
}
catch (...) {
printf("caught");
}
}
I've already tried Raisonance and other sources for a resolution, and have not received any actionable help.
Potential problem/solution 1:
I've asked on other forums and they mention I need to call static constructions in my startup assembly file to initialize the unwind tables (at least that's what I think they are talking about), but I have no idea how to do this.
Potential problem/solution 2
I have also discovered a bug in binutils/gas that may be the source of my problems here (http://sourceware.org/bugzilla/show_bug.cgi?id=13449). I've been trying to build my own version of the toolchain with this patch, but that's turning into a project of its own, and have not yet succeeded.
The Question
Do I need to do something in code to make use of C++ exceptions, or is this likely a bug in the toolchain? If the former, please elaborate.