diff options
-rw-r--r-- | Android.bp | 56 | ||||
-rw-r--r-- | build/art.go | 28 | ||||
-rw-r--r-- | compiler/Android.bp | 33 | ||||
-rw-r--r-- | dex2oat/Android.bp | 90 | ||||
-rw-r--r-- | dexdump/Android.bp | 10 | ||||
-rw-r--r-- | dexlayout/Android.bp | 30 | ||||
-rw-r--r-- | libartbase/Android.bp | 24 | ||||
-rw-r--r-- | libdexfile/Android.bp | 30 | ||||
-rw-r--r-- | libprofile/Android.bp | 31 | ||||
-rw-r--r-- | oatdump/Android.bp | 30 | ||||
-rw-r--r-- | runtime/Android.bp | 43 | ||||
-rw-r--r-- | test/Android.bp | 7 | ||||
-rw-r--r-- | tools/art_verifier/Android.bp | 12 |
13 files changed, 317 insertions, 107 deletions
diff --git a/Android.bp b/Android.bp deleted file mode 100644 index 34a646915f..0000000000 --- a/Android.bp +++ /dev/null @@ -1,56 +0,0 @@ -// TODO: These should be handled with transitive static library dependencies -art_static_dependencies = [ - // Note: the order is important because of static linking resolution. - "libziparchive", - "libnativehelper", - "libnativebridge", - "libnativeloader", - "libsigchain_dummy", - "liblog", - "libz", - "libbacktrace", - "libcutils", - "libunwindstack", - "libutils", - "libbase", - "liblz4", - "liblzma", - "libmetricslogger_static", -] - -subdirs = [ - "adbconnection", - "benchmark", - "build", - "cmdline", - "compiler", - "dalvikvm", - "dex2oat", - "dexdump", - "dexlayout", - "dexlist", - "dexoptanalyzer", - "disassembler", - "dt_fd_forward", - "dt_fd_forward/export", - "imgdiag", - "libartbase", - "libdexfile", - "libprofile", - "oatdump", - "openjdkjvm", - "openjdkjvmti", - "patchoat", - "profman", - "runtime", - "sigchainlib", - "simulator", - "test", - "tools", - "tools/breakpoint-logger", - "tools/cpp-define-generator", - "tools/dmtracedump", - "tools/hiddenapi", - "tools/titrace", - "tools/wrapagentproperties", -] diff --git a/build/art.go b/build/art.go index 61b1a4e501..6c084867a7 100644 --- a/build/art.go +++ b/build/art.go @@ -283,6 +283,7 @@ func init() { android.RegisterModuleType("art_cc_test_library", artTestLibrary) android.RegisterModuleType("art_cc_defaults", artDefaultsFactory) android.RegisterModuleType("libart_cc_defaults", libartDefaultsFactory) + android.RegisterModuleType("libart_static_cc_defaults", libartStaticDefaultsFactory) android.RegisterModuleType("art_global_defaults", artGlobalDefaultsFactory) android.RegisterModuleType("art_debug_defaults", artDebugDefaultsFactory) } @@ -336,6 +337,33 @@ func libartDefaultsFactory() android.Module { return module } +func libartStaticDefaultsFactory() android.Module { + c := &codegenProperties{} + module := cc.DefaultsFactory(c) + android.AddLoadHook(module, func(ctx android.LoadHookContext) { + codegen(ctx, c, true) + + type props struct { + Target struct { + Android struct { + Static_libs []string + } + } + } + + p := &props{} + // TODO: express this in .bp instead b/79671158 + if !envTrue(ctx, "ART_TARGET_LINUX") { + p.Target.Android.Static_libs = []string{ + "libmetricslogger_static", + } + } + ctx.AppendProperties(p) + }) + + return module +} + func artLibrary() android.Module { m, _ := cc.NewLibrary(android.HostAndDeviceSupported) module := m.Init() diff --git a/compiler/Android.bp b/compiler/Android.bp index c36553779e..c2f8e3c66e 100644 --- a/compiler/Android.bp +++ b/compiler/Android.bp @@ -191,6 +191,15 @@ art_cc_defaults { export_include_dirs: ["."], } +cc_defaults { + name: "libart-compiler_static_base_defaults", + static_libs: [ + "libbase", + "libcutils", + "liblzma", + ], +} + gensrcs { name: "art_compiler_operator_srcs", cmd: "$(location generate_operator_out) art/compiler $(in) > $(out)", @@ -260,6 +269,18 @@ art_cc_library { }, } +cc_defaults { + name: "libart-compiler_static_defaults", + defaults: [ + "libart-compiler_static_base_defaults", + "libart_static_defaults", + "libartbase_static_defaults", + "libdexfile_static_defaults", + "libprofile_static_defaults", + ], + static_libs: ["libart-compiler"], +} + art_cc_library { name: "libartd-compiler", defaults: [ @@ -302,6 +323,18 @@ art_cc_library { ], } +cc_defaults { + name: "libartd-compiler_static_defaults", + defaults: [ + "libart-compiler_static_base_defaults", + "libartd_static_defaults", + "libartbased_static_defaults", + "libdexfiled_static_defaults", + "libprofiled_static_defaults", + ], + static_libs: ["libartd-compiler"], +} + art_cc_library { name: "libart-compiler-gtest", defaults: ["libart-gtest-defaults"], diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp index 88e69cdb2a..666db425bd 100644 --- a/dex2oat/Android.bp +++ b/dex2oat/Android.bp @@ -89,6 +89,20 @@ art_cc_defaults { }, } +cc_defaults { + name: "libart-dex2oat_static_base_defaults", + target: { + android: { + static_libs: ["libcutils"], + }, + }, + static_libs: [ + "libbase", + "liblz4", + "liblzma", + ], +} + gensrcs { name: "art_dex2oat_operator_srcs", cmd: "$(location generate_operator_out) art/dex2oat $(in) > $(out)", @@ -110,6 +124,20 @@ art_cc_static_library { ], } +cc_defaults { + name: "libart-dex2oat_static_defaults", + defaults: [ + "libart-dex2oat_static_base_defaults", + "libart_static_defaults", + "libprofile_static_defaults", + ], + static_libs: [ + "libart-compiler", + "libart-dexlayout", + "libart-dex2oat", + ], +} + art_cc_static_library { name: "libartd-dex2oat", defaults: [ @@ -124,6 +152,20 @@ art_cc_static_library { ], } +cc_defaults { + name: "libartd-dex2oat_static_defaults", + defaults: [ + "libart-dex2oat_static_base_defaults", + "libartd_static_defaults", + "libprofiled_static_defaults", + ], + static_libs: [ + "libartd-compiler", + "libartd-dexlayout", + "libartd-dex2oat", + ], +} + cc_library_headers { name: "dex2oat_headers", host_supported: true, @@ -255,7 +297,9 @@ cc_defaults { name: "dex2oats-defaults", device_supported: false, static_executable: true, - defaults: ["dex2oat-defaults"], + defaults: [ + "dex2oat-defaults", + ], target: { darwin: { enabled: false, @@ -269,22 +313,24 @@ cc_defaults { // Try to get rid of it. "-z muldefs", ], - static_libs: art_static_dependencies, + static_libs: [ + "libbase", + "liblz4", + "libsigchain_dummy", + ], } art_cc_binary { name: "dex2oats", - defaults: ["dex2oats-defaults"], - static_libs: [ - "libart-dex2oat", - "libart-compiler", - "libart-dexlayout", - "libart", - "libartbase", - "libdexfile", - "libprofile", - "libvixl-arm", - "libvixl-arm64", + defaults: [ + "dex2oats-defaults", + "libart_static_defaults", + "libart-compiler_static_defaults", + "libart-dexlayout_static_defaults", + "libartbase_static_defaults", + "libdexfile_static_defaults", + "libprofile_static_defaults", + "libart-dex2oat_static_defaults", ], } @@ -293,6 +339,13 @@ art_cc_binary { defaults: [ "art_debug_defaults", "dex2oats-defaults", + "libartd_static_defaults", + "libartd-compiler_static_defaults", + "libartd-dexlayout_static_defaults", + "libartbased_static_defaults", + "libdexfiled_static_defaults", + "libprofiled_static_defaults", + "libartd-dex2oat_static_defaults", ], target: { linux_glibc_x86_64: { @@ -301,17 +354,6 @@ art_cc_binary { }, // b/79417743, oatdump 32-bit tests failed with clang lld use_clang_lld: false, - static_libs: [ - "libartd-dex2oat", - "libartd-compiler", - "libartd-dexlayout", - "libartd", - "libartbased", - "libprofiled", - "libdexfiled", - "libvixld-arm", - "libvixld-arm64", - ], } art_cc_test { diff --git a/dexdump/Android.bp b/dexdump/Android.bp index ac9a9a2932..3e576c82da 100644 --- a/dexdump/Android.bp +++ b/dexdump/Android.bp @@ -38,13 +38,13 @@ art_cc_binary { art_cc_binary { name: "dexdumps", - defaults: ["dexdump_defaults"], + defaults: [ + "dexdump_defaults", + "libartbase_static_defaults", + "libdexfile_static_defaults", + ], host_supported: true, device_supported: false, - static_libs: [ - "libdexfile", - "libartbase", - ] + art_static_dependencies, target: { darwin: { enabled: false, diff --git a/dexlayout/Android.bp b/dexlayout/Android.bp index 147af0c6a9..24ee5f8532 100644 --- a/dexlayout/Android.bp +++ b/dexlayout/Android.bp @@ -32,6 +32,14 @@ art_cc_defaults { static_libs: ["libz"], } +cc_defaults { + name: "libart-dexlayout_static_base_defaults", + static_libs: [ + "libbase", + "libz", + ], +} + art_cc_library { name: "libart-dexlayout", defaults: [ @@ -53,6 +61,17 @@ art_cc_library { }, } +cc_defaults { + name: "libart-dexlayout_static_defaults", + defaults: [ + "libart-dexlayout_static_base_defaults", + "libartbase_static_defaults", + "libdexfile_static_defaults", + "libprofile_static_defaults", + ], + static_libs: ["libart-dexlayout"], +} + art_cc_library { name: "libartd-dexlayout", defaults: [ @@ -67,6 +86,17 @@ art_cc_library { } cc_defaults { + name: "libartd-dexlayout_static_defaults", + defaults: [ + "libart-dexlayout_static_base_defaults", + "libartbased_static_defaults", + "libdexfiled_static_defaults", + "libprofiled_static_defaults", + ], + static_libs: ["libartd-dexlayout"], +} + +cc_defaults { name: "dexlayout-defaults", defaults: ["art_defaults"], host_supported: true, diff --git a/libartbase/Android.bp b/libartbase/Android.bp index 4ee48da5e8..1b603b51e1 100644 --- a/libartbase/Android.bp +++ b/libartbase/Android.bp @@ -79,6 +79,30 @@ cc_defaults { export_shared_lib_headers: ["libbase"], } +cc_defaults { + name: "libartbase_static_base_defaults", + static_libs: [ + "libbase", + "libcutils", + "liblog", + "libutils", + "libz", + "libziparchive", + ], +} + +cc_defaults { + name: "libartbase_static_defaults", + defaults: ["libartbase_static_base_defaults"], + static_libs: ["libartbase"], +} + +cc_defaults { + name: "libartbased_static_defaults", + defaults: ["libartbase_static_base_defaults"], + static_libs: ["libartbased"], +} + gensrcs { name: "art_libartbase_operator_srcs", cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)", diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp index 06fd19e2fe..49b1278fcb 100644 --- a/libdexfile/Android.bp +++ b/libdexfile/Android.bp @@ -72,6 +72,36 @@ cc_defaults { ], } +cc_defaults { + name: "libdexfile_static_base_defaults", + static_libs: [ + "libbase", + "libcutils", + "liblog", + "libutils", + "libz", + "libziparchive", + ], +} + +cc_defaults { + name: "libdexfile_static_defaults", + defaults: [ + "libartbase_static_defaults", + "libdexfile_static_base_defaults", + ], + static_libs: ["libdexfile"], +} + +cc_defaults { + name: "libdexfiled_static_defaults", + defaults: [ + "libartbased_static_defaults", + "libdexfile_static_base_defaults", + ], + static_libs: ["libdexfiled"], +} + gensrcs { name: "dexfile_operator_srcs", cmd: "$(location generate_operator_out) art/libdexfile $(in) > $(out)", diff --git a/libprofile/Android.bp b/libprofile/Android.bp index b9883f658d..edd9fa858b 100644 --- a/libprofile/Android.bp +++ b/libprofile/Android.bp @@ -56,6 +56,37 @@ cc_defaults { export_shared_lib_headers: ["libbase"], } +cc_defaults { + name: "libprofile_static_base_defaults", + static_libs: [ + "libbase", + "libcutils", + "libutils", + "libz", + "libziparchive", + ], +} + +cc_defaults { + name: "libprofile_static_defaults", + defaults: [ + "libprofile_static_base_defaults", + "libartbase_static_defaults", + "libdexfile_static_defaults", + ], + static_libs: ["libprofile"], +} + +cc_defaults { + name: "libprofiled_static_defaults", + defaults: [ + "libprofile_static_base_defaults", + "libartbased_static_defaults", + "libdexfiled_static_defaults", + ], + static_libs: ["libprofiled"], +} + art_cc_library { name: "libprofile", defaults: ["libprofile_defaults"], diff --git a/oatdump/Android.bp b/oatdump/Android.bp index 3cd8ae0f6d..070449967c 100644 --- a/oatdump/Android.bp +++ b/oatdump/Android.bp @@ -66,7 +66,9 @@ cc_defaults { name: "oatdumps-defaults", device_supported: false, static_executable: true, - defaults: ["oatdump-defaults"], + defaults: [ + "oatdump-defaults", + ], target: { darwin: { enabled: false, @@ -80,18 +82,20 @@ cc_defaults { // Try to get rid of it. "-z muldefs", ], - static_libs: art_static_dependencies, + static_libs: ["libsigchain_dummy"], } art_cc_binary { name: "oatdumps", - defaults: ["oatdumps-defaults"], + defaults: [ + "libart_static_defaults", + "libartbase_static_defaults", + "libdexfile_static_defaults", + "libprofile_static_defaults", + "libart-compiler_static_defaults", + "oatdumps-defaults", + ], static_libs: [ - "libart", - "libdexfile", - "libprofile", - "libartbase", - "libart-compiler", "libart-disassembler", "libvixl-arm", "libvixl-arm64", @@ -102,6 +106,11 @@ art_cc_binary { name: "oatdumpds", defaults: [ "art_debug_defaults", + "libartd_static_defaults", + "libartbased_static_defaults", + "libdexfiled_static_defaults", + "libprofiled_static_defaults", + "libartd-compiler_static_defaults", "oatdumps-defaults", ], target: { @@ -110,11 +119,6 @@ art_cc_binary { }, }, static_libs: [ - "libartd", - "libdexfiled", - "libprofiled", - "libartbased", - "libartd-compiler", "libartd-disassembler", "libvixld-arm", "libvixld-arm64", diff --git a/runtime/Android.bp b/runtime/Android.bp index 6ec626591a..1cebb06570 100644 --- a/runtime/Android.bp +++ b/runtime/Android.bp @@ -408,6 +408,49 @@ libart_cc_defaults { export_shared_lib_headers: ["libbase"], } +libart_static_cc_defaults { + name: "libart_static_base_defaults", + target: { + android: { + static_libs: ["libtombstoned_client_static"], + }, + }, + static_libs: [ + "libbacktrace", + "libbase", + "libcutils", + "liblog", + "liblz4", + "liblzma", + "libnativebridge", + "libnativeloader", + "libunwindstack", + "libz", + ], +} + +cc_defaults { + name: "libart_static_defaults", + defaults: [ + "libart_static_base_defaults", + "libartbase_static_defaults", + "libdexfile_static_defaults", + "libprofile_static_defaults", + ], + static_libs: ["libart"], +} + +cc_defaults { + name: "libartd_static_defaults", + defaults: [ + "libart_static_base_defaults", + "libartbased_static_defaults", + "libdexfiled_static_defaults", + "libprofiled_static_defaults", + ], + static_libs: ["libartd"], +} + gensrcs { name: "art_operator_srcs", cmd: "$(location generate_operator_out) art/runtime $(in) > $(out)", diff --git a/test/Android.bp b/test/Android.bp index e2656516ef..4b61463585 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -417,10 +417,11 @@ art_cc_test_library { art_cc_defaults { name: "libtistress-static-defaults", - defaults: ["libtistress-srcs"], - static_libs: art_static_dependencies + [ - "slicer", + defaults: [ + "libtistress-srcs", + "libart_static_defaults", ], + static_libs: ["slicer"], } art_cc_test_library { diff --git a/tools/art_verifier/Android.bp b/tools/art_verifier/Android.bp index afd52fbcaa..6fff27a61a 100644 --- a/tools/art_verifier/Android.bp +++ b/tools/art_verifier/Android.bp @@ -16,7 +16,10 @@ art_cc_defaults { name: "art_verifier-defaults", - defaults: ["art_defaults"], + defaults: [ + "art_defaults", + "libart_static_defaults", + ], host_supported: true, srcs: [ "art_verifier.cc", @@ -24,11 +27,8 @@ art_cc_defaults { header_libs: [ "art_cmdlineparser_headers", ], - static_libs: art_static_dependencies + [ - "libart", - "libartbase", - "libdexfile", - "libprofile", + static_libs: [ + "libsigchain_dummy", ], target: { android: { |