blob: 64542da538fab9802c0b486037c64355f5b46a79 [file] [log] [blame]
Roland Levillain38a938e2018-09-21 10:55:51 +01001// Android Runtime APEX module.
2
3// Modules listed in LOCAL_REQUIRED_MODULES for module art-runtime in art/Android.mk.
4// - Base requirements (binaries for which both 32- and 64-bit versions are built, if relevant).
5art_runtime_base_binaries_both = [
6 "dalvikvm",
7]
8// - Base requirements (binaries for which a 32-bit version is preferred).
9art_runtime_base_binaries_prefer32 = [
10 "dex2oat",
11 "dexoptanalyzer",
12 "profman",
13]
14// - Base requirements (libraries).
15art_runtime_base_native_shared_libs = [
Martin Stjernholmc2f8b502019-01-17 14:51:35 +000016 "libadbconnection",
Roland Levillain38a938e2018-09-21 10:55:51 +010017 "libart",
18 "libart-compiler",
Martin Stjernholm84bf6982019-02-05 15:07:57 +000019 "libdexfile_external",
Martin Stjernholmc2f8b502019-01-17 14:51:35 +000020 "libnativebridge",
21 "libnativehelper",
22 "libnativeloader",
Roland Levillain38a938e2018-09-21 10:55:51 +010023 "libopenjdkjvm",
24 "libopenjdkjvmti",
Roland Levillain38a938e2018-09-21 10:55:51 +010025]
Jiyong Park3296fb12018-12-13 18:32:21 +090026bionic_native_shared_libs = [
27 "libc",
28 "libm",
29 "libdl",
30]
Jiyong Parke2bc9fe2018-12-26 11:36:39 +090031bionic_binaries_both = [
32 "linker",
33]
Roland Levillain38a938e2018-09-21 10:55:51 +010034// - Debug variants (binaries for which a 32-bit version is preferred).
Roland Levillain38a938e2018-09-21 10:55:51 +010035art_runtime_debug_binaries_prefer32 = [
Roland Levillain38a938e2018-09-21 10:55:51 +010036 "dexoptanalyzerd",
37 "profmand",
38]
Alex Light572a0962019-01-18 14:48:37 -080039art_runtime_debug_binaries_prefer32_device = [
40 "dex2oatd",
41]
42art_runtime_debug_binaries_both_host = [
43 "dex2oatd",
44]
45
Roland Levillaincb82d092018-11-02 18:50:15 +000046// - Debug variants (libraries).
Roland Levillain38a938e2018-09-21 10:55:51 +010047art_runtime_debug_native_shared_libs = [
Martin Stjernholmc2f8b502019-01-17 14:51:35 +000048 "libadbconnectiond",
Roland Levillain38a938e2018-09-21 10:55:51 +010049 "libartd",
50 "libartd-compiler",
Roland Levillain38a938e2018-09-21 10:55:51 +010051 "libopenjdkjvmd",
52 "libopenjdkjvmtid",
Roland Levillain38a938e2018-09-21 10:55:51 +010053]
Roland Levillaincb82d092018-11-02 18:50:15 +000054libcore_debug_native_shared_libs = [
55 "libopenjdkd",
56]
Roland Levillain38a938e2018-09-21 10:55:51 +010057
Neil Fuller5ab4a562018-12-11 20:33:46 +000058// Data files associated with bionic / managed core library APIs.
59art_runtime_data_file_prebuilts = [
Neil Fullera886dab2018-12-06 15:12:52 +000060 "apex_tz_version",
61 "apex_tzdata",
62 "apex_tzlookup.xml",
Neil Fuller5ab4a562018-12-11 20:33:46 +000063 "apex_icu.dat",
Neil Fullera886dab2018-12-06 15:12:52 +000064]
65
Roland Levillain38a938e2018-09-21 10:55:51 +010066// Modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
Alex Lightda948ce2018-12-06 17:05:41 +000067art_tools_common_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010068 "dexdiag",
69 "dexdump",
70 "dexlist",
Alex Lightda948ce2018-12-06 17:05:41 +000071]
72
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000073// Device-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
74art_tools_device_only_binaries = [
75 // oatdump cannot link with host linux_bionic due to not using clang lld;
76 // TODO: Make it work with clang lld.
Roland Levillain38a938e2018-09-21 10:55:51 +010077 "oatdump",
78]
79
80// Host-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000081art_tools_host_only_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010082 // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk
83 // (same issue as for `libart_fake` above).
84 //"ahat",
85 "hprof-conv",
86 // ...
87]
88
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000089art_tools_device_binaries = art_tools_common_binaries + art_tools_device_only_binaries
90art_tools_host_binaries = art_tools_common_binaries + art_tools_host_only_binaries
Alex Lightda948ce2018-12-06 17:05:41 +000091
Alex Light6585ecb2019-02-08 14:13:22 -080092// Libraries needed to use com.android.runtime.host for zipapex run-tests
93art_runtime_host_run_test_libs = [
94 "libartd-disassembler"
95]
96
Roland Levillaina0b19032019-02-08 15:59:56 +000097// Core Java libraries.
98libcore_java_libs = [
99 "core-oj",
100 "core-libart",
101 "okhttp",
102 "bouncycastle",
103 "apache-xml",
104]
105
106// Native libraries that support the core Java libraries.
Roland Levillaincb82d092018-11-02 18:50:15 +0000107libcore_native_shared_libs = [
Victor Chang2f0008a2019-01-15 14:10:34 +0000108 "libandroidicu",
109 "libexpat",
110 "libicui18n",
111 "libicuuc",
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000112 "libjavacore",
Roland Levillaincb82d092018-11-02 18:50:15 +0000113 "libopenjdk",
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000114 "libz",
Victor Chang2f0008a2019-01-15 14:10:34 +0000115 "libziparchive",
116]
117
118libcore_native_device_only_shared_libs = libcore_native_shared_libs + [
119 // TODO(b/122876336): Remove libpac.so once it's migrated to Webview.
120 // libpac is used by frameworks, not by ART host.
121 "libpac",
Roland Levillaincb82d092018-11-02 18:50:15 +0000122]
123
Alex Lightf7f31522019-02-01 11:14:41 -0800124// Temporary library includes for b/123591866 as all libraries are moved into the main art-apex.
125art_runtime_libraries_zipapex = [
126 "libnativebridge",
127 "libnativeloader",
128 "libnativehelper",
129 "libcutils",
130]
131
Roland Levillain38a938e2018-09-21 10:55:51 +0100132apex_key {
133 name: "com.android.runtime.key",
Jiyong Park11a2df32018-11-22 16:25:08 +0900134 public_key: "com.android.runtime.avbpubkey",
135 private_key: "com.android.runtime.pem",
Roland Levillain38a938e2018-09-21 10:55:51 +0100136}
137
Roland Levillain3be7afe2018-12-04 19:35:03 +0000138prebuilt_etc {
139 name: "com.android.runtime.ld.config.txt",
140 src: "ld.config.txt",
141 filename: "ld.config.txt",
142 installable: false,
143}
144
Roland Levillain53058802018-11-14 17:32:18 +0000145// TODO: Introduce `apex_defaults` to factor common parts of `apex`
146// module definitions below?
147
148// Release version of the Runtime APEX module (not containing debug
149// variants nor tools), included in user builds. Also used for
150// storage-constrained devices in userdebug and eng builds.
Roland Levillain38a938e2018-09-21 10:55:51 +0100151apex {
Roland Levillain53058802018-11-14 17:32:18 +0000152 name: "com.android.runtime.release",
153 compile_multilib: "both",
154 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000155 java_libs: libcore_java_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000156 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000157 + bionic_native_shared_libs
Victor Chang2f0008a2019-01-15 14:10:34 +0000158 + libcore_native_device_only_shared_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000159 multilib: {
160 both: {
161 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
162 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Jiyong Parke2bc9fe2018-12-26 11:36:39 +0900163 binaries: art_runtime_base_binaries_both
164 + bionic_binaries_both,
Roland Levillain53058802018-11-14 17:32:18 +0000165 },
166 prefer32: {
167 binaries: art_runtime_base_binaries_prefer32,
168 },
169 first: {
170 binaries: [],
171 }
172 },
Neil Fuller5ab4a562018-12-11 20:33:46 +0000173 prebuilts: art_runtime_data_file_prebuilts
Neil Fullera886dab2018-12-06 15:12:52 +0000174 + ["com.android.runtime.ld.config.txt"],
Roland Levillain53058802018-11-14 17:32:18 +0000175 key: "com.android.runtime.key",
Roland Levillain53058802018-11-14 17:32:18 +0000176}
177
178// "Debug" version of the Runtime APEX module (containing both release and
179// debug variants, as well as additional tools), included in userdebug and
180// eng build.
181apex {
182 name: "com.android.runtime.debug",
Roland Levillain38a938e2018-09-21 10:55:51 +0100183 compile_multilib: "both",
184 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000185 java_libs: libcore_java_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100186 native_shared_libs: art_runtime_base_native_shared_libs
Jiyong Park3296fb12018-12-13 18:32:21 +0900187 + art_runtime_debug_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000188 + bionic_native_shared_libs
Victor Chang2f0008a2019-01-15 14:10:34 +0000189 + libcore_native_device_only_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000190 + libcore_debug_native_shared_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100191 multilib: {
192 both: {
193 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
194 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Jiyong Parke2bc9fe2018-12-26 11:36:39 +0900195 binaries: art_runtime_base_binaries_both
196 + bionic_binaries_both,
Roland Levillain38a938e2018-09-21 10:55:51 +0100197 },
198 prefer32: {
199 binaries: art_runtime_base_binaries_prefer32
Alex Light572a0962019-01-18 14:48:37 -0800200 + art_runtime_debug_binaries_prefer32
201 + art_runtime_debug_binaries_prefer32_device,
Roland Levillain38a938e2018-09-21 10:55:51 +0100202 },
203 first: {
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000204 binaries: art_tools_device_binaries,
Roland Levillain38a938e2018-09-21 10:55:51 +0100205 }
206 },
Neil Fuller5ab4a562018-12-11 20:33:46 +0000207 prebuilts: art_runtime_data_file_prebuilts
Neil Fullera886dab2018-12-06 15:12:52 +0000208 + ["com.android.runtime.ld.config.txt"],
Roland Levillain38a938e2018-09-21 10:55:51 +0100209 key: "com.android.runtime.key",
Roland Levillain38a938e2018-09-21 10:55:51 +0100210}
Alex Lightda948ce2018-12-06 17:05:41 +0000211
212// TODO: Do this better. art_apex will disable host builds when
213// HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug
214// because binaries have different multilib classes and 'multilib: {}' isn't
215// supported by target: { ... }.
216// See b/120617876 for more information.
Alex Light0239f2f2019-02-07 13:38:50 -0800217art_apex_test {
Alex Lightda948ce2018-12-06 17:05:41 +0000218 name: "com.android.runtime.host",
219 compile_multilib: "both",
220 payload_type: "zip",
221 host_supported: true,
222 device_supported: false,
223 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000224 java_libs: libcore_java_libs,
Alex Light55a9bad2019-01-29 18:34:09 -0800225 ignore_system_library_special_case: true,
Alex Lightda948ce2018-12-06 17:05:41 +0000226 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000227 + art_runtime_debug_native_shared_libs
228 + libcore_native_shared_libs
Alex Lightf7f31522019-02-01 11:14:41 -0800229 + libcore_debug_native_shared_libs
Alex Light6585ecb2019-02-08 14:13:22 -0800230 + art_runtime_libraries_zipapex
231 + art_runtime_host_run_test_libs,
Alex Lightda948ce2018-12-06 17:05:41 +0000232 multilib: {
233 both: {
234 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
235 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Alex Light572a0962019-01-18 14:48:37 -0800236 binaries: art_runtime_base_binaries_both
237 + art_runtime_debug_binaries_both_host,
Alex Lightda948ce2018-12-06 17:05:41 +0000238 },
239 first: {
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000240 binaries: art_tools_host_binaries
Alex Lightda948ce2018-12-06 17:05:41 +0000241 + art_runtime_base_binaries_prefer32
242 + art_runtime_debug_binaries_prefer32,
243 }
244 },
245 key: "com.android.runtime.key",
Alex Lighte3521522018-12-06 22:51:18 -0800246 target: {
247 darwin: {
248 enabled: false,
249 },
Alex Light55a9bad2019-01-29 18:34:09 -0800250 linux_bionic: {
251 enabled: true,
252 multilib: {
253 both: {
254 native_shared_libs: bionic_native_shared_libs,
255 binaries: bionic_binaries_both,
256 }
257 }
258 },
Alex Lighte3521522018-12-06 22:51:18 -0800259 },
Alex Lightda948ce2018-12-06 17:05:41 +0000260}
Jiyong Park1410e9f2019-02-02 04:18:23 +0000261
262python_binary_host {
263 name: "art-apex-tester",
264 srcs: ["art_apex_test.py"],
265 main: "art_apex_test.py",
266 version: {
267 py2: {
268 enabled: false,
269 },
270 py3: {
271 enabled: true,
272 },
273 },
274}
275
276// Genrules so we can run the checker, and empty Java library so that it gets executed.
277
278genrule {
279 name: "art-check-release-apex-gen",
280 srcs: [":com.android.runtime.release"],
281 tools: [
282 "art-apex-tester",
283 "debugfs",
284 ],
285 cmd: "$(location art-apex-tester)"
286 + " --debugfs $(location debugfs)"
287 + " --tmpdir $(genDir)"
288 + " $(in)"
289 + " && touch $(out)",
290 out: ["art-check-release-apex-gen.dummy"],
291}
292cc_prebuilt_binary {
293 name: "art-check-release-apex-gen-fakebin",
294 srcs: [":art-check-release-apex-gen"],
295 host_supported: true,
296 device_supported: false,
297 target: {
298 darwin: {
299 enabled: false, // No python3.
300 },
301 },
302}
303
304genrule {
305 name: "art-check-debug-apex-gen",
306 srcs: [":com.android.runtime.debug"],
307 tools: [
308 "art-apex-tester",
309 "debugfs",
310 ],
311 cmd: "$(location art-apex-tester)"
312 + " --debugfs $(location debugfs)"
313 + " --tmpdir $(genDir)"
314 + " --debug"
315 + " $(in)"
316 + " && touch $(out)",
317 out: ["art-check-debug-apex-gen.dummy"],
318}
319cc_prebuilt_binary {
320 name: "art-check-debug-apex-gen-fakebin",
321 srcs: [":art-check-debug-apex-gen"],
322 host_supported: true,
323 device_supported: false,
324 target: {
325 darwin: {
326 enabled: false, // No python3.
327 },
328 },
329}