Force all compilation units initialize cout (...etc) global objects before use.

Consider the case and assume we use libstlport_static.a:

(log.cc)
Logger log_instance(&cerr); // global object
log_instance.init_and_print_sth_before_main();

(main.cc)
int main() {...}

This is a potential bug since cerr may not been initialized before use.

Change-Id: I1ed250aecbe055ec353d51900ba70a34bbb57af5
Signed-off-by: WenHan Gu <Wenhan.gu@mediatek.com>
diff --git a/sources/cxx-stl/stlport/src/locale_impl.cpp b/sources/cxx-stl/stlport/src/locale_impl.cpp
index 71e0864..33454ea 100644
--- a/sources/cxx-stl/stlport/src/locale_impl.cpp
+++ b/sources/cxx-stl/stlport/src/locale_impl.cpp
@@ -618,8 +618,6 @@
 #  pragma init_seg(lib)
 #endif
 
-static ios_base::Init _IosInit;
-
 void _Locale_impl::make_classic_locale() {
   // This funcion will be called once: during build classic _Locale_impl
 
diff --git a/sources/cxx-stl/stlport/stlport/stl/_ios_base.h b/sources/cxx-stl/stlport/stlport/stl/_ios_base.h
index 8c7a65b..30425d2 100644
--- a/sources/cxx-stl/stlport/stlport/stl/_ios_base.h
+++ b/sources/cxx-stl/stlport/stlport/stl/_ios_base.h
@@ -261,6 +261,8 @@
 # endif
 };
 
+static ios_base::Init _IosInit;
+
 // ----------------------------------------------------------------------
 // ios_base manipulator functions, from section 27.4.5 of the C++ standard.
 // All of them are trivial one-line wrapper functions.