Merge "ART: Fix ARM64 long-jump context caller-save smashes"
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 5341136..175cc6e 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -247,7 +247,7 @@
 ART_TARGET_CFLAGS += $(ART_DEFAULT_GC_TYPE_CFLAGS)
 
 # TODO: remove when target no longer implies stlport.
-ART_TARGET_CFLAGS += -DART_WITH_STLPORT=1
+# ART_TARGET_CFLAGS += -DART_WITH_STLPORT=1
 
 # DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES is set in ../build/core/dex_preopt.mk based on
 # the TARGET_CPU_VARIANT
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
index 6aa1c18..683d91d 100644
--- a/build/Android.executable.mk
+++ b/build/Android.executable.mk
@@ -56,7 +56,7 @@
   LOCAL_MODULE_TAGS := optional
   LOCAL_SRC_FILES := $$(art_source)
   LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime $$(art_c_includes)
-  LOCAL_SHARED_LIBRARIES += $$(art_shared_libraries) # libnativehelper
+  LOCAL_SHARED_LIBRARIES += $$(art_shared_libraries)
 
   ifeq ($$(art_ndebug_or_debug),ndebug)
     LOCAL_MODULE := $$(art_executable)
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 1cd528b..8973aab 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -187,7 +187,7 @@
     LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) $(ART_TARGET_DEBUG_CFLAGS)
     LOCAL_CFLAGS_x86 := $(ART_TARGET_CFLAGS_x86)
     LOCAL_SHARED_LIBRARIES += libdl libicuuc libicui18n libnativehelper libz libcutils libvixl
-    LOCAL_STATIC_LIBRARIES += libgtest
+    LOCAL_STATIC_LIBRARIES += libgtest_libc++
     LOCAL_MODULE_PATH_32 := $(ART_NATIVETEST_OUT)/$(ART_TARGET_ARCH_32)
     LOCAL_MODULE_PATH_64 := $(ART_NATIVETEST_OUT)/$(ART_TARGET_ARCH_64)
     LOCAL_MULTILIB := both
diff --git a/build/Android.libcxx.mk b/build/Android.libcxx.mk
index f84e957..9abece5 100644
--- a/build/Android.libcxx.mk
+++ b/build/Android.libcxx.mk
@@ -17,7 +17,7 @@
 LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.libcxx.mk
 
 ifneq ($(LOCAL_IS_HOST_MODULE),true)
-  include external/stlport/libstlport.mk
-  LOCAL_CFLAGS += -DART_WITH_STLPORT=1
-  # include external/libcxx/libcxx.mk
+  # include external/stlport/libstlport.mk
+  # LOCAL_CFLAGS += -DART_WITH_STLPORT=1
+  include external/libcxx/libcxx.mk
 endif
diff --git a/build/Android.oat.mk b/build/Android.oat.mk
index 8240ece..4e8d1cc 100644
--- a/build/Android.oat.mk
+++ b/build/Android.oat.mk
@@ -47,7 +47,7 @@
 2ND_TARGET_CORE_IMG_OUT := $(ART_TEST_OUT)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core.art
 endif
 
-HOST_CORE_IMG_LOCATION := $(realpath $(HOST_OUT_JAVA_LIBRARIES))/core.art
+HOST_CORE_IMG_LOCATION := $(HOST_OUT_JAVA_LIBRARIES)/core.art
 
 TARGET_INSTRUCTION_SET_FEATURES := $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
 
diff --git a/runtime/Android.mk b/runtime/Android.mk
index 4a23263..bb79198 100644
--- a/runtime/Android.mk
+++ b/runtime/Android.mk
@@ -398,7 +398,11 @@
   endif
   LOCAL_C_INCLUDES += $(ART_C_INCLUDES)
   LOCAL_SHARED_LIBRARIES += liblog libnativehelper
-  LOCAL_SHARED_LIBRARIES += libbacktrace # native stack trace support
+  ifeq ($$(art_target_or_host),target)
+    LOCAL_SHARED_LIBRARIES += libbacktrace_libc++
+  else
+    LOCAL_SHARED_LIBRARIES += libbacktrace
+  endif
   ifeq ($$(art_target_or_host),target)
     LOCAL_SHARED_LIBRARIES += libcutils libdl libselinux libutils
     LOCAL_STATIC_LIBRARIES := libziparchive libz
diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc
index 95a2c96..d4e26ab 100644
--- a/runtime/gc/collector/semi_space.cc
+++ b/runtime/gc/collector/semi_space.cc
@@ -590,6 +590,7 @@
     // If it's allocated after the last GC (younger), copy it to the to-space.
     forward_address = to_space_->AllocThreadUnsafe(self_, object_size, &bytes_allocated, nullptr);
   }
+  CHECK(forward_address != nullptr) << "Out of memory in the to-space.";
   ++objects_moved_;
   bytes_moved_ += bytes_allocated;
   // Copy over the object and add it to the mark stack since we still need to update its
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 31d8d60..8046500 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -754,7 +754,7 @@
   if (VLOG_IS_ON(threads)) {
     std::ostringstream oss;
     self->ShortDump(oss);  // We don't hold the mutator_lock_ yet and so cannot call Dump.
-    LOG(INFO) << "ThreadList::Register() " << *self  << "\n" << oss;
+    LOG(INFO) << "ThreadList::Register() " << *self  << "\n" << oss.str();
   }
 
   // Atomically add self to the thread list and make its thread_suspend_count_ reflect ongoing