How to disable all exceptions code when building with g++
I'm using GNU ARM GCC bare bones toolchain, arm-none-eabi., version 5.4.1.
I'm using C++, and want to disable all exceptions from the code, and having some difficulties with it.
I basically just pass one option while building, the -fno-exceptions, and while it looks like does do some changes (i see binary
marginally smaller after enabling this), it does not remove exceptions completely.
One issue I'm having, is very early during runtime initialization. Looking at stack trace, the call to __libc_init_array() calls
_GLOBAL_
exactly what it is but looks like some exception data trying to allocate something for self.
So that -fno-exceptions doesn't remove all exception handling code, i also see in the map file bunch of _cxa methods.
What is proper way to disable all exceptions code? I saw a thread here from 2012 someone mentioned that a special library build
is required to cleanly remove all exceptions. Is this available?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Andre Vieira
- Solved:
- Last query:
- Last reply: