Make static versions of libutils and libbinder.
Fix some small static-initialization-order issues (and a static-
initializers-missing issue) that result from doing so. The static
libraries don't actually get used for anything real at the moment --
they're used for perf tests of bug 2660235.
Bug: 2660235
Change-Id: Iee2f38f79cc93b395e8d0a5a144ed92461f5ada0
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp
index 0dd7622..9945f91 100644
--- a/libs/binder/Binder.cpp
+++ b/libs/binder/Binder.cpp
@@ -69,8 +69,6 @@
// ---------------------------------------------------------------------------
-String16 BBinder::sEmptyDescriptor;
-
BBinder::BBinder()
: mExtras(NULL)
{
@@ -88,6 +86,9 @@
const String16& BBinder::getInterfaceDescriptor() const
{
+ // This is a local static rather than a global static,
+ // to avoid static initializer ordering issues.
+ static String16 sEmptyDescriptor;
LOGW("reached BBinder::getInterfaceDescriptor (this=%p)", this);
return sEmptyDescriptor;
}