No matter what I try, like adding the compiler flags -fno-exceptions -fno-rtti
, I always get these exception-handling functions in my shared objects:
This happens whether I compile as C or C++.
It happens with these includes (compiled as C++ - haven't tried to compile as C):
#include <jni.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
Here are all of my includes for the one I have compiled as both C and C++ (most/all of them aren't needed for the problem to occur):
#include <jni.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif
#include <math.h>
#ifdef __ANDROID__
#include <GLES2/gl2.h>
#else
#error "No graphics implementation for the target platform"
#endif
#ifdef __ANDROID__
#include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h>
#include <pthread.h>
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>
#else
#error "No audio implementation for the target platform"
#endif
#include <time.h>
typedef struct timespec timespec;
// for malloc, free and memset
#include <stdlib.h>
#include <string.h>
How can I get rid of these exception handling functions once and for all? Is the NDK toolchain overriding my compiler flags somewhere?