From 2b7be1efa1ba363778057d4e42fccab8afe3046b Mon Sep 17 00:00:00 2001 From: Dmitrii Ishcheikin Date: Wed, 12 Oct 2022 14:15:31 +0000 Subject: Merge libart and libart-compiler into a single library Rename old libart into libart-runtime Build libart-runtime and libart-compiler separately as static libraries This is required to support PGO (compiler) and AFDO (runtime) without mixing them Combine libart-runtime and libart-compiler into libart with whole-archive linking This change negates all size savings from libart-compiler version script, it will be restored in a follow-up CL Bug: 186902856 Test: m test-art-host-gtest Test: m libart libartd dex2oat dex2oatd oatdump oatdumps Test: art/build/apex/runtests.sh Test: art/tools/run-gtests.sh Test: art/test/testrunner/testrunner.py --target --64 Test: art/tools/run-libcore-tests.sh --mode=device --variant=X64 Test: art/tools/run-libjdwp-tests.sh --mode=device --variant=X64 Change-Id: I6b9717cf49007e77691d49a2dca18a8064749154 --- compiler/optimizing/graph_visualizer.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/graph_visualizer.cc') diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index e1199dfb72..1e41a22e91 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -115,7 +115,9 @@ std::ostream& operator<<(std::ostream& os, const StringList& list) { } } -#ifndef ART_STATIC_LIBART_COMPILER +// On target: load `libart-disassembler` only when required (to save on memory) +// On host: `libart-disassembler` should be linked directly (either as a static or dynamic lib) +#ifdef ART_TARGET using create_disasm_prototype = Disassembler*(InstructionSet, DisassemblerOptions*); #endif @@ -125,7 +127,7 @@ class HGraphVisualizerDisassembler { const uint8_t* base_address, const uint8_t* end_address) : instruction_set_(instruction_set), disassembler_(nullptr) { -#ifndef ART_STATIC_LIBART_COMPILER +#ifdef ART_TARGET constexpr const char* libart_disassembler_so_name = kIsDebugBuild ? "libartd-disassembler.so" : "libart-disassembler.so"; libart_disassembler_handle_ = dlopen(libart_disassembler_so_name, RTLD_NOW); @@ -159,7 +161,7 @@ class HGraphVisualizerDisassembler { ~HGraphVisualizerDisassembler() { // We need to call ~Disassembler() before we close the library. disassembler_.reset(); -#ifndef ART_STATIC_LIBART_COMPILER +#ifdef ART_TARGET if (libart_disassembler_handle_ != nullptr) { dlclose(libart_disassembler_handle_); } @@ -184,7 +186,7 @@ class HGraphVisualizerDisassembler { InstructionSet instruction_set_; std::unique_ptr disassembler_; -#ifndef ART_STATIC_LIBART_COMPILER +#ifdef ART_TARGET void* libart_disassembler_handle_; #endif }; -- cgit v1.2.3-59-g8ed1b