[android] Override __cxa_demangle() in PRODUCT mode

Saves at least 90KB of binary size.

Change-Id: I9f40cc9fbd3a80421ed5f4b751e47f593cb8d1d5
Reviewed-on: https://dart-review.googlesource.com/11344
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Zachary Anderson 2017-10-05 16:56:16 +00:00 committed by Zach Anderson
parent cdbd085119
commit 9fce277b7e

View file

@ -10,6 +10,21 @@
#include <cxxabi.h> // NOLINT
#include <dlfcn.h> // NOLINT
// Even though it's not used in a PRODUCT build, __cxa_demangle() still ends up
// in the resulting binary for Android. Blowing it away by redefining it like
// so saves >90KB of binary size.
#if defined(PRODUCT)
extern "C" char* __cxa_demangle(const char* mangled_name,
char* buf,
size_t* n,
int* status) {
if (status) {
*status = -1;
}
return NULL;
}
#endif
namespace dart {
void NativeSymbolResolver::InitOnce() {}