diff options
Diffstat (limited to 'compiler/Android.bp')
-rw-r--r-- | compiler/Android.bp | 237 |
1 files changed, 146 insertions, 91 deletions
diff --git a/compiler/Android.bp b/compiler/Android.bp index 117e8dc6b0..3b44e37e0a 100644 --- a/compiler/Android.bp +++ b/compiler/Android.bp @@ -28,6 +28,124 @@ package { default_applicable_licenses: ["art_license"], } +// Common dependencies for debug/release libart-compiler builds +libart_cc_defaults { + name: "libart-compiler_common_dependencies", + shared_libs: [ + "libbase", + "liblzma", // libelffile(d) dependency; must be repeated here since it's a static lib. + ], +} + +// Collect all required dependencies for build targets that link against libart-compiler +// Workaround for lack of static_libs transitive dependencies propagation (b/169779783) +libart_cc_defaults { + name: "libart-compiler_dependencies", + defaults: ["libart-compiler_common_dependencies"], + + codegen: { + arm: { + // VIXL assembly support for ARM targets. + static_libs: [ + "libvixl", + ], + }, + arm64: { + // VIXL assembly support for ARM64 targets. + static_libs: [ + "libvixl", + ], + }, + }, + shared_libs: [ + "libartbase", + "libartpalette", + "libdexfile", + "libprofile", + ], + static_libs: [ + "libelffile", + ], + + // In order to save memory on device `art::HGraphVisualizerDisassembler` loads `libart-disassembler.so` + // dynamically. Host builds of `libart-compiler` depend on `libart-disassembler` directly with + // `shared_libs` or `static_libs` + target: { + host: { + shared: { + shared_libs: [ + "libart-disassembler", + ], + }, + }, + android: { + runtime_libs: [ + // `art::HGraphVisualizerDisassembler::HGraphVisualizerDisassembler` may dynamically load + // `libart-disassembler.so`. + "libart-disassembler", + ], + }, + }, +} + +libart_cc_defaults { + name: "libartd-compiler_dependencies", + defaults: ["libart-compiler_common_dependencies"], + + codegen: { + arm: { + // VIXL assembly support for ARM targets. + static_libs: [ + "libvixld", + ], + // Export vixl headers as they are included in this library's headers used by tests. + export_static_lib_headers: [ + "libvixld", + ], + }, + arm64: { + // VIXL assembly support for ARM64 targets. + static_libs: [ + "libvixld", + ], + // Export vixl headers as they are included in this library's headers used by tests. + export_static_lib_headers: [ + "libvixld", + ], + }, + }, + shared_libs: [ + "libartbased", + "libartd-disassembler", + "libartpalette", + "libdexfiled", + "libprofiled", + ], + static_libs: [ + "libelffiled", + ], + + // In order to save memory on device `art::HGraphVisualizerDisassembler` loads `libartd-disassembler.so` + // dynamically. Host builds of `libartd-compiler` depend on `libartd-disassembler` directly with + // `shared_libs` or `static_libs` + target: { + host: { + shared: { + shared_libs: [ + "libartd-disassembler", + ], + }, + }, + android: { + runtime_libs: [ + // `art::HGraphVisualizerDisassembler::HGraphVisualizerDisassembler` may dynamically load + // `libartd-disassembler.so`. + "libartd-disassembler", + ], + }, + }, +} + art_cc_defaults { name: "libart-compiler-defaults", defaults: ["art_defaults"], @@ -157,29 +275,30 @@ art_cc_defaults { ], }, }, - static: { - cflags: ["-DART_STATIC_LIBART_COMPILER"], - }, generated_sources: ["art_compiler_operator_srcs"], - shared_libs: [ - "libbase", - "liblzma", // libelffile(d) dependency; must be repeated here since it's a static lib. - ], + export_include_dirs: ["."], header_libs: [ "art_cmdlineparser_headers", // For compiler_options. "art_disassembler_headers", "libnativehelper_header_only", ], - - export_include_dirs: ["."], + // TODO: since libart-compiler is a static lib now + // replace version script with EXPORT/HIDDEN attributes // Not using .map.txt because this is an internal API version_script: "libart-compiler.map", } -cc_defaults { - name: "libart-compiler_static_base_defaults", - whole_static_libs: [ - "libbase", +// Export headers required by `libart-runtime` to use JIT from `libart-compiler` +cc_library_headers { + name: "libart-compiler_jit_headers", + defaults: ["art_defaults"], + host_supported: true, + + export_include_dirs: ["export"], + + apex_available: [ + "com.android.art", + "com.android.art.debug", ], } @@ -198,41 +317,18 @@ gensrcs { output_extension: "operator_out.cc", } -art_cc_library { +art_cc_library_static { name: "libart-compiler", defaults: [ - "libart-compiler-defaults", - "dex2oat-pgo-defaults", "art_hugepage_defaults", + "dex2oat-pgo-defaults", + "libart-compiler-defaults", + "libart-compiler_dependencies", ], - codegen: { - arm: { - // VIXL assembly support for ARM targets. - static_libs: [ - "libvixl", - ], - }, - arm64: { - // VIXL assembly support for ARM64 targets. - static_libs: [ - "libvixl", - ], - }, - }, - shared_libs: [ - "libart", - "libartbase", - "libartpalette", - "libprofile", - "libdexfile", - ], - static_libs: ["libelffile"], - runtime_libs: [ - // `art::HGraphVisualizerDisassembler::HGraphVisualizerDisassembler` may dynamically load - // `libart-disassembler.so`. - "libart-disassembler", + header_libs: [ + "libart_headers", + "libart_generated_headers", ], - target: { android: { lto: { @@ -249,58 +345,25 @@ art_cc_library { cc_defaults { name: "libart-compiler_static_defaults", defaults: [ - "libart-compiler_static_base_defaults", + "libart-compiler_dependencies", "libart-disassembler_static_defaults", - "libart_static_defaults", "libartbase_static_defaults", "libdexfile_static_defaults", "libprofile_static_defaults", ], - whole_static_libs: ["libart-compiler"], } -art_cc_library { +art_cc_library_static { name: "libartd-compiler", defaults: [ "art_debug_defaults", "libart-compiler-defaults", + "libartd-compiler_dependencies", ], - codegen: { - arm: { - // VIXL assembly support for ARM targets. - static_libs: [ - "libvixld", - ], - // Export vixl headers as they are included in this library's headers used by tests. - export_static_lib_headers: [ - "libvixld", - ], - }, - arm64: { - // VIXL assembly support for ARM64 targets. - static_libs: [ - "libvixld", - ], - // Export vixl headers as they are included in this library's headers used by tests. - export_static_lib_headers: [ - "libvixld", - ], - }, - }, - shared_libs: [ - "libartbased", - "libartd", - "libartpalette", - "libprofiled", - "libdexfiled", - ], - static_libs: ["libelffiled"], - runtime_libs: [ - // `art::HGraphVisualizerDisassembler::HGraphVisualizerDisassembler` may dynamically load - // `libartd-disassembler.so`. - "libartd-disassembler", + header_libs: [ + "libart_headers", + "libart_generated_headers", ], - apex_available: [ "com.android.art.debug", // TODO(b/183882457): This lib doesn't go into com.android.art, but @@ -313,14 +376,12 @@ art_cc_library { cc_defaults { name: "libartd-compiler_static_defaults", defaults: [ - "libart-compiler_static_base_defaults", "libartbased_static_defaults", + "libartd-compiler_dependencies", "libartd-disassembler_static_defaults", - "libartd_static_defaults", "libdexfiled_static_defaults", "libprofiled_static_defaults", ], - whole_static_libs: ["libartd-compiler"], } // Properties common to `libart-compiler-gtest` and `libartd-compiler-gtest`. @@ -341,7 +402,6 @@ art_cc_library { "libart-compiler-gtest-common", ], shared_libs: [ - "libart-compiler", "libart-disassembler", "libartbase-art-gtest", "libart-runtime-gtest", @@ -355,7 +415,6 @@ art_cc_library { "libart-compiler-gtest-common", ], shared_libs: [ - "libartd-compiler", "libartd-disassembler", "libartbased-art-gtest", "libartd-runtime-gtest", @@ -490,7 +549,6 @@ art_cc_test { "liblzma", ], static_libs: [ - "libartd-compiler", "libelffiled", "libvixld", ], @@ -516,7 +574,6 @@ art_cc_test { // TODO(b/192070541): Consider linking `libart-simulator-container` // dynamically. "libart-simulator-container", - "libart-compiler", "libelffile", "libvixl", ], @@ -554,8 +611,6 @@ art_cc_test { "liblzma", ], static_libs: [ - "libartd-compiler", "libelffiled", - "libvixld", ], } |