diff options
author | 2018-05-15 08:59:32 -0700 | |
---|---|---|
committer | 2018-05-16 13:01:34 -0700 | |
commit | 1f010164bea4714e9f653c52e8948c5d5305040b (patch) | |
tree | e69b2c3f4d2645d4097655f8914325945fe5dbbd | |
parent | a7d37cf735f05cfc3a3585a5c44eb65d8a279874 (diff) |
Move ArtDexFileLoader to libdexfile
Adds a dependency from libdexfile on libartbase, but allows the use of
MemMap loaders, etc.
Bug: 78652467
Test: make -j 40 checkbuild
Change-Id: I15cf33893ca9192050762f8350a3cc1e39f88dc5
27 files changed, 80 insertions, 24 deletions
diff --git a/adbconnection/Android.bp b/adbconnection/Android.bp index 441b706556..95fc274286 100644 --- a/adbconnection/Android.bp +++ b/adbconnection/Android.bp @@ -65,6 +65,7 @@ art_cc_library { defaults: ["adbconnection-defaults"], shared_libs: [ "libart", + "libartbase", ], } @@ -76,5 +77,6 @@ art_cc_library { ], shared_libs: [ "libartd", + "libartbased", ], } diff --git a/compiler/Android.bp b/compiler/Android.bp index 5884a548be..be963fbbdb 100644 --- a/compiler/Android.bp +++ b/compiler/Android.bp @@ -246,6 +246,7 @@ art_cc_library { "libart", "libprofile", "libdexfile", + "libartbase", ], target: { @@ -295,6 +296,7 @@ art_cc_library { "libartd", "libprofiled", "libdexfiled", + "libartbased", ], } diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp index 18548baf7f..e74947ad6a 100644 --- a/dex2oat/Android.bp +++ b/dex2oat/Android.bp @@ -202,6 +202,7 @@ art_cc_binary { "libart-dexlayout", "libart", "libdexfile", + "libartbase", "libbase", "liblz4", "libsigchain", @@ -239,6 +240,7 @@ art_cc_binary { "libartd-dexlayout", "libartd", "libdexfiled", + "libartbased", "libbase", "liblz4", "libsigchain", @@ -267,12 +269,13 @@ art_cc_binary { "-z muldefs", ], static_libs: [ - "libprofile", "libart-dex2oat", "libart-compiler", "libart-dexlayout", "libart", + "libartbase", "libdexfile", + "libprofile", "libvixl-arm", "libvixl-arm64", ] + art_static_dependencies, @@ -309,6 +312,7 @@ art_cc_binary { "libartd-compiler", "libartd-dexlayout", "libartd", + "libartbased", "libprofiled", "libdexfiled", "libvixld-arm", diff --git a/dexdump/Android.bp b/dexdump/Android.bp index c63d6c319e..2f0962c19a 100644 --- a/dexdump/Android.bp +++ b/dexdump/Android.bp @@ -35,6 +35,7 @@ art_cc_binary { host_supported: true, shared_libs: [ "libdexfile", + "libartbase", "libbase", ], } @@ -46,6 +47,7 @@ art_cc_binary { device_supported: false, static_libs: [ "libdexfile", + "libartbase", ] + art_static_dependencies, target: { darwin: { diff --git a/dexlayout/Android.bp b/dexlayout/Android.bp index b009774582..bf56239397 100644 --- a/dexlayout/Android.bp +++ b/dexlayout/Android.bp @@ -41,6 +41,7 @@ art_cc_library { shared_libs: [ "libart", "libdexfile", + "libartbase", "libprofile", ], @@ -62,6 +63,7 @@ art_cc_library { shared_libs: [ "libartd", "libdexfiled", + "libartbased", "libprofiled", ], } @@ -82,6 +84,7 @@ art_cc_binary { shared_libs: [ "libprofile", "libart", + "libartbase", "libart-dexlayout", ], } @@ -95,6 +98,7 @@ art_cc_binary { shared_libs: [ "libprofiled", "libartd", + "libartbased", "libartd-dexlayout", ], } @@ -117,6 +121,7 @@ art_cc_binary { cflags: ["-Wall"], shared_libs: [ "libart", + "libartbase", "libart-dexlayout", "libbase", ], diff --git a/dexlist/Android.bp b/dexlist/Android.bp index 2703732db6..bd521acbc0 100644 --- a/dexlist/Android.bp +++ b/dexlist/Android.bp @@ -17,7 +17,11 @@ art_cc_binary { host_supported: true, srcs: ["dexlist.cc"], cflags: ["-Wall", "-Werror"], - shared_libs: ["libdexfile", "libbase"], + shared_libs: [ + "libdexfile", + "libartbase", + "libbase" + ], // TODO: fix b/72216369 and remove the need for this. include_dirs: [ "art/runtime" // dex utils. diff --git a/dexoptanalyzer/Android.bp b/dexoptanalyzer/Android.bp index 33366ad371..99a11cd59b 100644 --- a/dexoptanalyzer/Android.bp +++ b/dexoptanalyzer/Android.bp @@ -38,6 +38,7 @@ art_cc_binary { defaults: ["dexoptanalyzer-defaults"], shared_libs: [ "libart", + "libartbase", ], } @@ -49,6 +50,7 @@ art_cc_binary { ], shared_libs: [ "libartd", + "libartbased", ], } diff --git a/imgdiag/Android.bp b/imgdiag/Android.bp index 2b89497e8e..972c8f7189 100644 --- a/imgdiag/Android.bp +++ b/imgdiag/Android.bp @@ -57,6 +57,7 @@ art_cc_binary { defaults: ["imgdiag-defaults"], shared_libs: [ "libart", + "libartbase", "libart-compiler", ], } @@ -69,6 +70,7 @@ art_cc_binary { ], shared_libs: [ "libartd", + "libartbased", "libartd-compiler", ], } diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp index 9d49f371f8..3818624d7a 100644 --- a/libdexfile/Android.bp +++ b/libdexfile/Android.bp @@ -19,6 +19,7 @@ cc_defaults { defaults: ["art_defaults"], host_supported: true, srcs: [ + "dex/art_dex_file_loader.cc", "dex/compact_dex_file.cc", "dex/compact_offset_table.cc", "dex/descriptors_names.cc", @@ -55,25 +56,20 @@ cc_defaults { }, generated_sources: ["dexfile_operator_srcs"], shared_libs: [ + // For MemMap. "libartbase", - // Important note: relying on libartbase's header_lib is perfectly acceptable. - // However, relying on the libartbase shared library introduces further, possibly cyclic, - // dependencies for clients outside of ART. "liblog", + // For atrace. + "libcutils", // For common macros. "libbase", "libz", ], - header_libs: [ - "art_libartbase_headers", - ], export_include_dirs: ["."], export_shared_lib_headers: [ + "libartbase", "libbase", ], - export_header_lib_headers: [ - "art_libartbase_headers", - ], } gensrcs { @@ -115,6 +111,7 @@ art_cc_test { "art_gtest_defaults", ], srcs: [ + "dex/art_dex_file_loader_test.cc", "dex/code_item_accessors_test.cc", "dex/compact_dex_file_test.cc", "dex/compact_offset_table_test.cc", diff --git a/runtime/dex/art_dex_file_loader.cc b/libdexfile/dex/art_dex_file_loader.cc index 392ce1e7f5..392ce1e7f5 100644 --- a/runtime/dex/art_dex_file_loader.cc +++ b/libdexfile/dex/art_dex_file_loader.cc diff --git a/runtime/dex/art_dex_file_loader.h b/libdexfile/dex/art_dex_file_loader.h index 7577945632..a460aee60f 100644 --- a/runtime/dex/art_dex_file_loader.h +++ b/libdexfile/dex/art_dex_file_loader.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ART_RUNTIME_DEX_ART_DEX_FILE_LOADER_H_ -#define ART_RUNTIME_DEX_ART_DEX_FILE_LOADER_H_ +#ifndef ART_LIBDEXFILE_DEX_ART_DEX_FILE_LOADER_H_ +#define ART_LIBDEXFILE_DEX_ART_DEX_FILE_LOADER_H_ #include <cstdint> #include <memory> @@ -137,4 +137,4 @@ class ArtDexFileLoader : public DexFileLoader { } // namespace art -#endif // ART_RUNTIME_DEX_ART_DEX_FILE_LOADER_H_ +#endif // ART_LIBDEXFILE_DEX_ART_DEX_FILE_LOADER_H_ diff --git a/runtime/dex/art_dex_file_loader_test.cc b/libdexfile/dex/art_dex_file_loader_test.cc index d353c26b35..d353c26b35 100644 --- a/runtime/dex/art_dex_file_loader_test.cc +++ b/libdexfile/dex/art_dex_file_loader_test.cc diff --git a/libprofile/Android.bp b/libprofile/Android.bp index bcb90cb680..b9883f658d 100644 --- a/libprofile/Android.bp +++ b/libprofile/Android.bp @@ -45,6 +45,7 @@ cc_defaults { shared_libs: [ "libartbase", "libdexfile", + "libartbase", // For atrace. "libcutils", ], @@ -97,6 +98,7 @@ art_cc_test { shared_libs: [ "libartbased", "libdexfiled", + "libartbased", "libziparchive", ], } diff --git a/oatdump/Android.bp b/oatdump/Android.bp index 535acdff62..77dede3e10 100644 --- a/oatdump/Android.bp +++ b/oatdump/Android.bp @@ -39,6 +39,7 @@ art_cc_binary { "libart-compiler", "libart-disassembler", "libdexfile", + "libartbase", "libprofile", "libbase", ], @@ -55,6 +56,7 @@ art_cc_binary { "libartd-compiler", "libartd-disassembler", "libdexfiled", + "libartbased", "libprofiled", "libbase", ], @@ -82,6 +84,7 @@ art_cc_binary { "libart", "libdexfile", "libprofile", + "libartbase", "libart-compiler", "libart-disassembler", "libvixl-arm", @@ -117,6 +120,7 @@ art_cc_binary { "libartd", "libdexfiled", "libprofiled", + "libartbased", "libartd-compiler", "libartd-disassembler", "libvixld-arm", diff --git a/openjdkjvm/Android.bp b/openjdkjvm/Android.bp index a17899358c..907315e4e0 100644 --- a/openjdkjvm/Android.bp +++ b/openjdkjvm/Android.bp @@ -29,7 +29,10 @@ cc_defaults { art_cc_library { name: "libopenjdkjvm", defaults: ["libopenjdkjvm_defaults"], - shared_libs: ["libart"], + shared_libs: [ + "libart", + "libartbase", + ], } art_cc_library { @@ -38,5 +41,8 @@ art_cc_library { "art_debug_defaults", "libopenjdkjvm_defaults", ], - shared_libs: ["libartd"], + shared_libs: [ + "libartd", + "libartbased", + ], } diff --git a/openjdkjvmti/Android.bp b/openjdkjvmti/Android.bp index 81b69e8c95..d8902d60d1 100644 --- a/openjdkjvmti/Android.bp +++ b/openjdkjvmti/Android.bp @@ -71,6 +71,7 @@ art_cc_library { "libart-compiler", "libart-dexlayout", "libdexfile", + "libartbase", ], } @@ -85,5 +86,6 @@ art_cc_library { "libartd-compiler", "libartd-dexlayout", "libdexfiled", + "libartbased", ], } diff --git a/patchoat/Android.bp b/patchoat/Android.bp index 1e2f328ffd..13c8f475f5 100644 --- a/patchoat/Android.bp +++ b/patchoat/Android.bp @@ -59,7 +59,6 @@ art_cc_test { "patchoat_test.cc", ], shared_libs: [ - "libartd", "libcrypto", // For computing the digest of image file ], } diff --git a/profman/Android.bp b/profman/Android.bp index 3c8c72c34a..5aaccb0cef 100644 --- a/profman/Android.bp +++ b/profman/Android.bp @@ -42,6 +42,7 @@ art_cc_binary { "libart", "libprofile", "libdexfile", + "libartbase", ], } @@ -55,6 +56,7 @@ art_cc_binary { "libartd", "libprofiled", "libdexfiled", + "libartbased", ], } diff --git a/runtime/Android.bp b/runtime/Android.bp index 0540b2087e..92607f51a0 100644 --- a/runtime/Android.bp +++ b/runtime/Android.bp @@ -45,7 +45,6 @@ libart_cc_defaults { "compiler_filter.cc", "debug_print.cc", "debugger.cc", - "dex/art_dex_file_loader.cc", "dex/dex_file_annotations.cc", "dex_to_dex_decompiler.cc", "elf_file.cc", @@ -464,9 +463,9 @@ art_cc_library { keep_symbols: true, }, whole_static_libs: [ - "libartbase", ], shared_libs: [ + "libartbase", "libdexfile", "libprofile", ], @@ -489,9 +488,9 @@ art_cc_library { "libart_defaults", ], whole_static_libs: [ - "libartbased", ], shared_libs: [ + "libartbased", "libdexfiled", "libprofiled", ], @@ -545,7 +544,6 @@ art_cc_test { "class_loader_context_test.cc", "class_table_test.cc", "compiler_filter_test.cc", - "dex/art_dex_file_loader_test.cc", "entrypoints/math_entrypoints_test.cc", "entrypoints/quick/quick_trampoline_entrypoints_test.cc", "entrypoints_order_test.cc", diff --git a/simulator/Android.bp b/simulator/Android.bp index 74b5a900b4..8690426466 100644 --- a/simulator/Android.bp +++ b/simulator/Android.bp @@ -44,6 +44,7 @@ art_cc_library { defaults: ["libart_simulator_defaults"], shared_libs: [ "libart", + "libartbase", "libvixl-arm64", ], } @@ -56,6 +57,7 @@ art_cc_library { ], shared_libs: [ "libartd", + "libartbased", "libvixld-arm64", ], } @@ -80,6 +82,7 @@ art_cc_library { name: "libart-simulator-container", defaults: ["libart_simulator_container_defaults"], shared_libs: [ + "libartbase", "libart", ], } @@ -91,6 +94,7 @@ art_cc_library { "libart_simulator_container_defaults", ], shared_libs: [ + "libartbased", "libartd", ], } diff --git a/test/Android.bp b/test/Android.bp index 84f2e224d5..7909bf897a 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -64,6 +64,7 @@ art_cc_defaults { "libart-gtest", "libdexfiled", "libprofiled", + "libartbased", "libbase", "libicuuc", @@ -117,6 +118,7 @@ art_cc_defaults { "libartd-compiler", "libdexfiled", "libprofiled", + "libartbased", ], static_libs: [ "libgtest", @@ -156,6 +158,7 @@ art_cc_library { "libartd-compiler", "libdexfiled", "libprofiled", + "libartbased", "libbase", "libbacktrace", ], @@ -187,6 +190,7 @@ art_cc_test_library { "libart", "libdexfile", "libprofile", + "libartbase", ], } @@ -201,6 +205,7 @@ art_cc_test_library { "libartd", "libdexfiled", "libprofiled", + "libartbased", ], } @@ -322,6 +327,7 @@ art_cc_test_library { "libart", "libdexfile", "libprofile", + "libartbase", ], } @@ -335,6 +341,7 @@ art_cc_test_library { "libartd", "libdexfiled", "libprofiled", + "libartbased", ], } @@ -496,6 +503,7 @@ art_cc_test_library { "libart", "libdexfile", "libprofile", + "libartbase", ], } @@ -509,6 +517,7 @@ art_cc_test_library { "libartd", "libdexfiled", "libprofiled", + "libartbased", ], } diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index fad801192a..1ba433e974 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -861,9 +861,9 @@ if [ "$HOST" = "n" ]; then # System libraries needed by libarttestd.so PUBLIC_LIBS=libc++.so:libbacktrace.so:libbase.so:libnativehelper.so if [ "$TEST_IS_NDEBUG" = "y" ]; then - PUBLIC_LIBS=$PUBLIC_LIBS:libart.so:libdexfile.so:libprofile.so + PUBLIC_LIBS=$PUBLIC_LIBS:libart.so:libdexfile.so:libprofile.so:libartbase.so else - PUBLIC_LIBS=$PUBLIC_LIBS:libartd.so:libdexfiled.so:libprofiled.so + PUBLIC_LIBS=$PUBLIC_LIBS:libartd.so:libdexfiled.so:libprofiled.so:libartbased.so fi # Create a script with the command. The command can get longer than the longest diff --git a/tools/cpp-define-generator/Android.bp b/tools/cpp-define-generator/Android.bp index 39e57bd667..23cc917f1d 100644 --- a/tools/cpp-define-generator/Android.bp +++ b/tools/cpp-define-generator/Android.bp @@ -31,6 +31,7 @@ cc_binary { // Do not use art_cc_binary because HOST_PREFER_32_BIT is incompatib include_dirs: [ "art/libartbase", "art/libdexfile", + "art/libartbase", "art/runtime", ], srcs: ["main.cc"], diff --git a/tools/dexanalyze/Android.bp b/tools/dexanalyze/Android.bp index 2754e6445e..a229d73d01 100644 --- a/tools/dexanalyze/Android.bp +++ b/tools/dexanalyze/Android.bp @@ -37,6 +37,7 @@ art_cc_binary { defaults: ["dexanalyze-defaults"], shared_libs: [ "libdexfile", + "libartbase", "libbase", ], } diff --git a/tools/hiddenapi/Android.bp b/tools/hiddenapi/Android.bp index af87d31e53..3b364b67c3 100644 --- a/tools/hiddenapi/Android.bp +++ b/tools/hiddenapi/Android.bp @@ -40,6 +40,7 @@ art_cc_binary { shared_libs: [ "libart", "libdexfile", + "libartbase", ], } @@ -52,6 +53,7 @@ art_cc_binary { shared_libs: [ "libartd", "libdexfiled", + "libartbased", ], } diff --git a/tools/public.libraries.buildbot.txt b/tools/public.libraries.buildbot.txt index 6c8114558e..9b171a2502 100644 --- a/tools/public.libraries.buildbot.txt +++ b/tools/public.libraries.buildbot.txt @@ -1,5 +1,7 @@ libart.so libartd.so +libartbase.so +libartbased.so libdexfile.so libdexfiled.so libbacktrace.so diff --git a/tools/veridex/Android.bp b/tools/veridex/Android.bp index 570960c4da..5186c43ca2 100644 --- a/tools/veridex/Android.bp +++ b/tools/veridex/Android.bp @@ -24,7 +24,11 @@ cc_binary { "veridex.cc", ], cflags: ["-Wall", "-Werror"], - shared_libs: ["libdexfile", "libbase"], + shared_libs: [ + "libdexfile", + "libartbase", + "libbase", + ], header_libs: [ "art_libartbase_headers", ], |