diff options
author | Ian Rogers <irogers@google.com> | 2014-10-30 18:31:27 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-10-30 18:31:28 +0000 |
commit | 263f20b7a04b33f0e4b8f43b9a69ee9a1ddba564 (patch) | |
tree | 00b241fb34665cdf905712d8e1b9892fe2ba8498 | |
parent | 26dcecb0ef620fb225cd5dd39f6e41b07e34c83d (diff) | |
parent | 872dd8208f00c667af8d9e0fd07fdd0ada56d437 (diff) | |
download | art-263f20b7a04b33f0e4b8f43b9a69ee9a1ddba564.tar.gz art-263f20b7a04b33f0e4b8f43b9a69ee9a1ddba564.tar.bz2 art-263f20b7a04b33f0e4b8f43b9a69ee9a1ddba564.zip |
Merge "Tidy and reduce ART library dependencies on the host."
-rw-r--r-- | build/Android.gtest.mk | 8 | ||||
-rw-r--r-- | compiler/Android.mk | 9 | ||||
-rw-r--r-- | dex2oat/Android.mk | 4 | ||||
-rw-r--r-- | disassembler/Android.mk | 4 | ||||
-rw-r--r-- | oatdump/Android.mk | 4 | ||||
-rw-r--r-- | runtime/Android.mk | 14 | ||||
-rw-r--r-- | runtime/debugger.cc | 2 | ||||
-rw-r--r-- | runtime/gc/allocator/dlmalloc.h | 2 | ||||
-rw-r--r-- | runtime/gc/heap.cc | 3 |
9 files changed, 31 insertions, 19 deletions
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk index 0f9e56a640..2939961c01 100644 --- a/build/Android.gtest.mk +++ b/build/Android.gtest.mk @@ -201,7 +201,7 @@ LOCAL_CPP_EXTENSION := cc LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) LOCAL_SRC_FILES := runtime/common_runtime_test.cc compiler/common_compiler_test.cc LOCAL_C_INCLUDES := $(ART_C_INCLUDES) art/runtime art/compiler -LOCAL_SHARED_LIBRARIES := libcutils libartd libartd-compiler libdl +LOCAL_SHARED_LIBRARIES := libartd libartd-compiler libdl LOCAL_STATIC_LIBRARIES += libgtest_libc++ LOCAL_CLANG := $(ART_TARGET_CLANG) LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk @@ -217,8 +217,7 @@ LOCAL_CFLAGS := $(ART_HOST_CFLAGS) LOCAL_SRC_FILES := runtime/common_runtime_test.cc compiler/common_compiler_test.cc LOCAL_C_INCLUDES := $(ART_C_INCLUDES) art/runtime art/compiler LOCAL_SHARED_LIBRARIES := libartd libartd-compiler -LOCAL_STATIC_LIBRARIES := libcutils -LOCAL_STATIC_LIBRARIES += libgtest_libc++_host +LOCAL_STATIC_LIBRARIES := libgtest_libc++_host LOCAL_LDLIBS += -ldl -lpthread LOCAL_MULTILIB := both LOCAL_CLANG := $(ART_HOST_CLANG) @@ -392,8 +391,7 @@ test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_ else # host LOCAL_CLANG := $$(ART_HOST_CLANG) LOCAL_CFLAGS += $$(ART_HOST_CFLAGS) $$(ART_HOST_DEBUG_CFLAGS) - LOCAL_SHARED_LIBRARIES += libicuuc-host libicui18n-host libnativehelper libz-host - LOCAL_STATIC_LIBRARIES += libcutils libvixl + LOCAL_SHARED_LIBRARIES += libicuuc-host libicui18n-host libnativehelper libziparchive-host libz-host libvixl LOCAL_LDLIBS := $(ART_HOST_LDLIBS) -lpthread -ldl LOCAL_IS_HOST_MODULE := true LOCAL_MULTILIB := both diff --git a/compiler/Android.mk b/compiler/Android.mk index 172c96cfde..3edd91380f 100644 --- a/compiler/Android.mk +++ b/compiler/Android.mk @@ -261,15 +261,18 @@ $$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : $(LOCAL_PAT LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime ifeq ($$(art_target_or_host),host) - LOCAL_LDLIBS += -ldl -lpthread + # For compiler driver TLS. + LOCAL_LDLIBS += -lpthread endif LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk + # Vixl assembly support for ARM64 targets. + LOCAL_SHARED_LIBRARIES += libvixl ifeq ($$(art_target_or_host),target) - LOCAL_SHARED_LIBRARIES += libcutils libvixl + # For atrace. + LOCAL_SHARED_LIBRARIES += libcutils include $(BUILD_SHARED_LIBRARY) else # host - LOCAL_STATIC_LIBRARIES += libcutils libvixl LOCAL_MULTILIB := both include $(BUILD_HOST_SHARED_LIBRARY) endif diff --git a/dex2oat/Android.mk b/dex2oat/Android.mk index 2ef826b16a..4f39c4217f 100644 --- a/dex2oat/Android.mk +++ b/dex2oat/Android.mk @@ -38,8 +38,8 @@ endif # We always build dex2oat and dependencies, even if the host build is otherwise disabled, since they are used to cross compile for the target. ifeq ($(ART_BUILD_HOST_NDEBUG),true) - $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libart-compiler,art/compiler,host,ndebug)) + $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libart-compiler libziparchive-host,art/compiler,host,ndebug)) endif ifeq ($(ART_BUILD_HOST_DEBUG),true) - $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libartd-compiler,art/compiler,host,debug)) + $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libartd-compiler libziparchive-host,art/compiler,host,debug)) endif diff --git a/disassembler/Android.mk b/disassembler/Android.mk index eb3b024934..f2dd1eecee 100644 --- a/disassembler/Android.mk +++ b/disassembler/Android.mk @@ -84,11 +84,11 @@ define build-libart-disassembler LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk include external/libcxx/libcxx.mk + # For disassembler_arm64. + LOCAL_SHARED_LIBRARIES += libvixl ifeq ($$(art_target_or_host),target) - LOCAL_SHARED_LIBRARIES += libcutils libvixl include $(BUILD_SHARED_LIBRARY) else # host - LOCAL_STATIC_LIBRARIES += libcutils libvixl include $(BUILD_HOST_SHARED_LIBRARY) endif endef diff --git a/oatdump/Android.mk b/oatdump/Android.mk index 25d10bd006..a8f120f9ca 100644 --- a/oatdump/Android.mk +++ b/oatdump/Android.mk @@ -25,14 +25,14 @@ ifeq ($(ART_BUILD_TARGET_NDEBUG),true) $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libcutils libart-disassembler libart-compiler,art/disassembler art/compiler,target,ndebug)) endif ifeq ($(ART_BUILD_TARGET_DEBUG),true) - $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libcutils libartd-disassembler libart-compiler,art/disassembler art/compiler,target,debug)) + $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libcutils libartd-disassembler libartd-compiler,art/disassembler art/compiler,target,debug)) endif ifeq ($(ART_BUILD_HOST_NDEBUG),true) $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libart-disassembler libart-compiler,art/disassembler art/compiler,host,ndebug)) endif ifeq ($(ART_BUILD_HOST_DEBUG),true) - $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libartd-disassembler libart-compiler,art/disassembler art/compiler,host,debug)) + $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libartd-disassembler libartd-compiler,art/disassembler art/compiler,host,debug)) endif ######################################################################## diff --git a/runtime/Android.mk b/runtime/Android.mk index 6f6dcbcb6c..a2fc24a21c 100644 --- a/runtime/Android.mk +++ b/runtime/Android.mk @@ -457,15 +457,21 @@ $$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : $(LOCAL_PAT LOCAL_C_INCLUDES += $$(ART_C_INCLUDES) LOCAL_C_INCLUDES += art/sigchainlib - LOCAL_SHARED_LIBRARIES += liblog libnativehelper libnativebridge + LOCAL_SHARED_LIBRARIES := libnativehelper libnativebridge libsigchain include external/libcxx/libcxx.mk LOCAL_SHARED_LIBRARIES += libbacktrace_libc++ ifeq ($$(art_target_or_host),target) - LOCAL_SHARED_LIBRARIES += libcutils libdl libutils libsigchain + LOCAL_SHARED_LIBRARIES += libdl + # ZipArchive support, the order matters here to get all symbols. LOCAL_STATIC_LIBRARIES := libziparchive libz + # For android::FileMap used by libziparchive. + LOCAL_SHARED_LIBRARIES += libutils + # For liblog, atrace, properties, ashmem, set_sched_policy and socket_peer_is_trusted. + LOCAL_SHARED_LIBRARIES += libcutils else # host - LOCAL_STATIC_LIBRARIES += libcutils libziparchive-host libz libutils - LOCAL_SHARED_LIBRARIES += libsigchain + LOCAL_SHARED_LIBRARIES += libziparchive-host + # For ashmem_create_region. + LOCAL_STATIC_LIBRARIES += libcutils endif ifeq ($$(ART_USE_PORTABLE_COMPILER),true) include $$(LLVM_GEN_INTRINSICS_MK) diff --git a/runtime/debugger.cc b/runtime/debugger.cc index d9061c8e68..5409d54f0a 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -4373,7 +4373,7 @@ void Dbg::DdmSendHeapSegments(bool native) { // Send a series of heap segment chunks. HeapChunkContext context((what == HPSG_WHAT_MERGED_OBJECTS), native); if (native) { -#ifdef USE_DLMALLOC +#if defined(HAVE_ANDROID_OS) && defined(USE_DLMALLOC) dlmalloc_inspect_all(HeapChunkContext::HeapChunkCallback, &context); #else UNIMPLEMENTED(WARNING) << "Native heap inspection is only supported with dlmalloc"; diff --git a/runtime/gc/allocator/dlmalloc.h b/runtime/gc/allocator/dlmalloc.h index c820b192b9..c7ecbc83ce 100644 --- a/runtime/gc/allocator/dlmalloc.h +++ b/runtime/gc/allocator/dlmalloc.h @@ -30,10 +30,12 @@ #include "../../bionic/libc/upstream-dlmalloc/malloc.h" +#ifdef HAVE_ANDROID_OS // Define dlmalloc routines from bionic that cannot be included directly because of redefining // symbols from the include above. extern "C" void dlmalloc_inspect_all(void(*handler)(void*, void *, size_t, void*), void* arg); extern "C" int dlmalloc_trim(size_t); +#endif // Callback for dlmalloc_inspect_all or mspace_inspect_all that will madvise(2) unused // pages back to the kernel. diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index c0008aac84..6730dfe309 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1017,6 +1017,8 @@ void Heap::Trim() { // We never move things in the native heap, so we can finish the GC at this point. FinishGC(self, collector::kGcTypeNone); size_t native_reclaimed = 0; + +#ifdef HAVE_ANDROID_OS // Only trim the native heap if we don't care about pauses. if (!CareAboutPauseTimes()) { #if defined(USE_DLMALLOC) @@ -1029,6 +1031,7 @@ void Heap::Trim() { UNIMPLEMENTED(WARNING) << "Add trimming support"; #endif } +#endif // HAVE_ANDROID_OS uint64_t end_ns = NanoTime(); VLOG(heap) << "Heap trim of managed (duration=" << PrettyDuration(gc_heap_end_ns - start_ns) << ", advised=" << PrettySize(managed_reclaimed) << ") and native (duration=" |