From a066323bd6dc71542b3b7c612099d4a3f38e272c Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 23 Oct 2015 08:54:05 -0700 Subject: [PATCH] Fix Android build RTLD_SELF doesn't appear to be defined on Android. --- sky/engine/core/script/dart_init.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sky/engine/core/script/dart_init.cc b/sky/engine/core/script/dart_init.cc index 8047c733d3b..4fb00355ef7 100644 --- a/sky/engine/core/script/dart_init.cc +++ b/sky/engine/core/script/dart_init.cc @@ -82,8 +82,6 @@ static const char* kDartArgs[] = { #endif }; -static const char* kInstructionsSnapshotSymbolName = "kInstructionsSnapshot"; - static const char* kDartPrecompilationArgs[] { "--precompilation", }; @@ -110,7 +108,11 @@ bool IsServiceIsolateURL(const char* url_name) { static const uint8_t* PrecompiledInstructionsSymbolIfPresent() { dlerror(); // clear previous errors on thread - void * sym = dlsym(RTLD_SELF, kInstructionsSnapshotSymbolName); + void* sym = nullptr; +#ifdef RTLD_SELF + static const char kInstructionsSnapshotSymbolName[] = "kInstructionsSnapshot"; + sym = dlsym(RTLD_SELF, kInstructionsSnapshotSymbolName); +#endif return (dlerror() != nullptr) ? nullptr : reinterpret_cast(sym); }