Re: C++ and STM32
Posted: Fri Jan 13, 2012 3:49 pm
One more thought:
If you can identify the exact optimization flag, it might help you find out more about what is going on, but moreover you might be able to use -O0 with only the exact flag needed for the link fix.
First see if it builds OK with -O1 or not.
Then, instead of specifying -O1 or -O2, etc., start with no optimization options at all and add the specific optimization flags that are part of -O1 or -O2, one at a time until the compile/link succeeds. (You will find it most efficient to use a “binary search†or bisection approach, in fact, rather than actually adding one flag at a time: add half the flags, see if it works; if it succeeds, add half of the remaining flags; if it fails, remove half of the flags you added, etc., until you identify the exact flag the is causing link to succeed.)
It would be ideal to figure out why abort() is being referenced, but this might be the most benefit for the least work in your case, since it's apparently only necessary in debugging mode.
If you can identify the exact optimization flag, it might help you find out more about what is going on, but moreover you might be able to use -O0 with only the exact flag needed for the link fix.
First see if it builds OK with -O1 or not.
Then, instead of specifying -O1 or -O2, etc., start with no optimization options at all and add the specific optimization flags that are part of -O1 or -O2, one at a time until the compile/link succeeds. (You will find it most efficient to use a “binary search†or bisection approach, in fact, rather than actually adding one flag at a time: add half the flags, see if it works; if it succeeds, add half of the remaining flags; if it fails, remove half of the flags you added, etc., until you identify the exact flag the is causing link to succeed.)
It would be ideal to figure out why abort() is being referenced, but this might be the most benefit for the least work in your case, since it's apparently only necessary in debugging mode.