blob: 529662608e2caaa8d11e178aa450e8d81ac30c01 [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).
Roland Levillain1617f8c2019-03-26 17:52:30 +000015//
16// Note: ART on-device chroot-based testing and benchmarking is not yet using
17// the Runtime APEX, meaning that copies of some of these libraries have to be
18// installed in `/system` for the ART Buildbot set-up to work properly. This is
19// done by the `standalone-apex-files` Make phony target, used by the ART
20// Buildbot and Golem (see `art/Android.mk`). If you add libraries to this list,
21// you may have to also add them to `PRIVATE_RUNTIME_DEPENDENCY_LIBS` in
22// `art/Android.mk`.
23// TODO(b/121117762): Remove this note when both the ART Buildbot and Golem use
24// the Runtime APEX.
Roland Levillain38a938e2018-09-21 10:55:51 +010025art_runtime_base_native_shared_libs = [
Martin Stjernholm023c2182019-03-28 15:52:32 +000026 // External API (having APEX stubs).
Martin Stjernholm84bf6982019-02-05 15:07:57 +000027 "libdexfile_external",
Martin Stjernholmc2f8b502019-01-17 14:51:35 +000028 "libnativebridge",
29 "libnativehelper",
30 "libnativeloader",
Martin Stjernholm023c2182019-03-28 15:52:32 +000031 // libadbconnection is internal and loaded with dlopen(), but it cannot use
32 // "required" because of cyclic dependency (b/124505714).
33 "libadbconnection",
34 // TODO(b/124476339): Clean up the following libraries once "required"
Martin Stjernholm0c15b822019-02-14 17:24:19 +000035 // dependencies work with APEX libraries.
Martin Stjernholm023c2182019-03-28 15:52:32 +000036 "libart",
37 "libart-compiler",
Martin Stjernholm0c15b822019-02-14 17:24:19 +000038 "libdt_fd_forward",
39 "libdt_socket",
40 "libjdwp",
41 "libnpt",
Martin Stjernholm023c2182019-03-28 15:52:32 +000042 "libopenjdkjvm",
43 "libopenjdkjvmti",
Roland Levillain38a938e2018-09-21 10:55:51 +010044]
Jiyong Park3296fb12018-12-13 18:32:21 +090045bionic_native_shared_libs = [
Martin Stjernholm023c2182019-03-28 15:52:32 +000046 // External API (having APEX stubs).
Jiyong Park3296fb12018-12-13 18:32:21 +090047 "libc",
48 "libm",
49 "libdl",
50]
Jiyong Park408f7d02019-04-02 23:04:42 +090051
Roland Levillain89867bf2019-06-24 15:09:01 +010052bionic_native_device_only_shared_libs = [
Jiyong Park408f7d02019-04-02 23:04:42 +090053 // ... and their internal dependencies
54 // These are available only on device
55 "libc_malloc_debug",
56 "libc_malloc_hooks",
57]
58
Jiyong Parke2bc9fe2018-12-26 11:36:39 +090059bionic_binaries_both = [
60 "linker",
61]
Roland Levillain38a938e2018-09-21 10:55:51 +010062// - Debug variants (binaries for which a 32-bit version is preferred).
Roland Levillain38a938e2018-09-21 10:55:51 +010063art_runtime_debug_binaries_prefer32 = [
Roland Levillain38a938e2018-09-21 10:55:51 +010064 "dexoptanalyzerd",
65 "profmand",
66]
Alex Light572a0962019-01-18 14:48:37 -080067art_runtime_debug_binaries_prefer32_device = [
68 "dex2oatd",
69]
70art_runtime_debug_binaries_both_host = [
71 "dex2oatd",
72]
73
Roland Levillaincb82d092018-11-02 18:50:15 +000074// - Debug variants (libraries).
Roland Levillain38a938e2018-09-21 10:55:51 +010075art_runtime_debug_native_shared_libs = [
Martin Stjernholmc2f8b502019-01-17 14:51:35 +000076 "libadbconnectiond",
Roland Levillain38a938e2018-09-21 10:55:51 +010077 "libartd",
78 "libartd-compiler",
Martin Stjernholm356864a2019-04-30 16:22:17 +010079 "libdexfiled_external",
Roland Levillain38a938e2018-09-21 10:55:51 +010080 "libopenjdkjvmd",
81 "libopenjdkjvmtid",
Roland Levillain38a938e2018-09-21 10:55:51 +010082]
83
Neil Fuller5ab4a562018-12-11 20:33:46 +000084// Data files associated with bionic / managed core library APIs.
85art_runtime_data_file_prebuilts = [
Neil Fuller5ab4a562018-12-11 20:33:46 +000086 "apex_icu.dat",
Neil Fullera886dab2018-12-06 15:12:52 +000087]
88
Orion Hodson5cb98a92019-03-25 15:07:16 +000089// Tools common to both device APEX and host APEX. Derived from art-tools in art/Android.mk.
Alex Lightda948ce2018-12-06 17:05:41 +000090art_tools_common_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010091 "dexdump",
92 "dexlist",
Alex Lightda948ce2018-12-06 17:05:41 +000093]
94
Martin Stjernholm77f17662019-04-03 17:08:21 +010095// Tools common to both device and host debug APEXes.
96art_tools_debug_binaries = [
Roland Levillain6dd62122019-06-18 19:10:21 +010097 "dexanalyze",
Martin Stjernholm77f17662019-04-03 17:08:21 +010098 "dexdiag",
Roland Levillain6dd62122019-06-18 19:10:21 +010099 "dexlayout",
100 "dexlayoutd",
101]
102
103art_tools_debug_binaries_both = [
104 "imgdiag",
105 "imgdiagd",
Martin Stjernholm77f17662019-04-03 17:08:21 +0100106]
107
Orion Hodson5cb98a92019-03-25 15:07:16 +0000108// Tools exclusively for the device APEX derived from art-tools in art/Android.mk.
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000109art_tools_device_only_binaries = [
110 // oatdump cannot link with host linux_bionic due to not using clang lld;
111 // TODO: Make it work with clang lld.
Roland Levillain38a938e2018-09-21 10:55:51 +0100112 "oatdump",
113]
Roland Levillain02998cf2019-03-21 14:27:02 +0000114// Same, but for only for debug packages.
115art_tools_debug_device_only_binaries = [
116 // oatdumpd cannot link with host linux_bionic due to not using clang lld;
117 // TODO: Make it work with clang lld.
118 "oatdumpd",
119]
Roland Levillain38a938e2018-09-21 10:55:51 +0100120
Orion Hodson5cb98a92019-03-25 15:07:16 +0000121// Tools exclusively for the host APEX derived from art-tools in art/Android.mk.
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000122art_tools_host_only_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +0100123 // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk
124 // (same issue as for `libart_fake` above).
125 //"ahat",
126 "hprof-conv",
Roland Levillain38a938e2018-09-21 10:55:51 +0100127]
128
Alex Light6585ecb2019-02-08 14:13:22 -0800129// Libraries needed to use com.android.runtime.host for zipapex run-tests
130art_runtime_host_run_test_libs = [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700131 "libartd-disassembler",
Alex Light6585ecb2019-02-08 14:13:22 -0800132]
133
Roland Levillaina0b19032019-02-08 15:59:56 +0000134// Core Java libraries.
135libcore_java_libs = [
136 "core-oj",
137 "core-libart",
138 "okhttp",
139 "bouncycastle",
140 "apache-xml",
141]
142
143// Native libraries that support the core Java libraries.
Roland Levillain1617f8c2019-03-26 17:52:30 +0000144//
145// Note: ART on-device chroot-based testing and benchmarking is not yet using
146// the Runtime APEX, meaning that copies of some of these libraries have to be
147// installed in `/system` for the ART Buildbot set-up to work properly. This is
148// done by the `standalone-apex-files` Make phony target, used by the ART
149// Buildbot and Golem (see `art/Android.mk`). If you add libraries to this list,
150// you may have to also add them to `PRIVATE_RUNTIME_DEPENDENCY_LIBS` in
151// `art/Android.mk`.
152// TODO(b/121117762): Remove this note when both the ART Buildbot and Golem use
153// the Runtime APEX.
Roland Levillaincb82d092018-11-02 18:50:15 +0000154libcore_native_shared_libs = [
Martin Stjernholm023c2182019-03-28 15:52:32 +0000155 // External API (having APEX stubs).
Victor Chang2f0008a2019-01-15 14:10:34 +0000156 "libandroidicu",
Pete Bentley79f56622019-03-21 17:09:56 +0000157 "libandroidio",
Martin Stjernholm023c2182019-03-28 15:52:32 +0000158 // TODO(b/124476339): Clean up the following libraries once "required"
159 // dependencies work with APEX libraries.
Victor Chang2f0008a2019-01-15 14:10:34 +0000160 "libexpat",
161 "libicui18n",
162 "libicuuc",
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000163 "libjavacore",
Roland Levillaincb82d092018-11-02 18:50:15 +0000164 "libopenjdk",
Martin Stjernholm023c2182019-03-28 15:52:32 +0000165]
166libcore_debug_native_shared_libs = [
167 "libopenjdkd",
Victor Chang2f0008a2019-01-15 14:10:34 +0000168]
169
Martin Stjernholm023c2182019-03-28 15:52:32 +0000170libcore_native_device_only_shared_libs = [
Victor Chang2f0008a2019-01-15 14:10:34 +0000171 // TODO(b/122876336): Remove libpac.so once it's migrated to Webview.
172 // libpac is used by frameworks, not by ART host.
173 "libpac",
Roland Levillaincb82d092018-11-02 18:50:15 +0000174]
175
Alex Lightf7f31522019-02-01 11:14:41 -0800176// Temporary library includes for b/123591866 as all libraries are moved into the main art-apex.
177art_runtime_libraries_zipapex = [
178 "libnativebridge",
179 "libnativeloader",
180 "libnativehelper",
181 "libcutils",
182]
183
Roland Levillain38a938e2018-09-21 10:55:51 +0100184apex_key {
185 name: "com.android.runtime.key",
Jiyong Park11a2df32018-11-22 16:25:08 +0900186 public_key: "com.android.runtime.avbpubkey",
187 private_key: "com.android.runtime.pem",
Roland Levillain38a938e2018-09-21 10:55:51 +0100188}
189
Jiyong Parke9618552019-02-11 10:54:36 +0900190android_app_certificate {
191 name: "com.android.runtime.debug.certificate",
192 certificate: "com.android.runtime.debug",
193}
194
195android_app_certificate {
196 name: "com.android.runtime.release.certificate",
197 certificate: "com.android.runtime.release",
198}
199
Roland Levillain3be7afe2018-12-04 19:35:03 +0000200prebuilt_etc {
201 name: "com.android.runtime.ld.config.txt",
202 src: "ld.config.txt",
203 filename: "ld.config.txt",
204 installable: false,
205}
206
Roland Levillain89867bf2019-06-24 15:09:01 +0100207// Default values shared by device Runtime APEXes.
Andreas Gampee55ea982019-02-26 09:11:20 -0800208apex_defaults {
209 name: "com.android.runtime-defaults",
Roland Levillain53058802018-11-14 17:32:18 +0000210 compile_multilib: "both",
211 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000212 java_libs: libcore_java_libs,
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700213 native_shared_libs: art_runtime_base_native_shared_libs +
214 bionic_native_shared_libs +
Roland Levillain89867bf2019-06-24 15:09:01 +0100215 bionic_native_device_only_shared_libs +
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700216 libcore_native_device_only_shared_libs +
217 libcore_native_shared_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000218 multilib: {
219 both: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700220 binaries: art_runtime_base_binaries_both +
221 bionic_binaries_both,
Roland Levillain53058802018-11-14 17:32:18 +0000222 },
223 prefer32: {
224 binaries: art_runtime_base_binaries_prefer32,
225 },
226 first: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700227 binaries: art_tools_common_binaries +
228 art_tools_device_only_binaries,
229 },
Roland Levillain53058802018-11-14 17:32:18 +0000230 },
Andreas Gampe31782c12019-02-06 09:47:25 -0800231 binaries: [
Andreas Gampe5bb525a2019-02-19 12:26:35 -0800232 "art_postinstall_hook",
Andreas Gampe31782c12019-02-06 09:47:25 -0800233 "art_preinstall_hook",
234 "art_preinstall_hook_boot",
Andreas Gampe29c111e2019-02-28 13:58:07 -0800235 "art_preinstall_hook_system_server",
Andreas Gampe31782c12019-02-06 09:47:25 -0800236 "art_prepostinstall_utils",
237 ],
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700238 prebuilts: art_runtime_data_file_prebuilts +
239 ["com.android.runtime.ld.config.txt"],
Roland Levillain53058802018-11-14 17:32:18 +0000240 key: "com.android.runtime.key",
Andreas Gampe57975682019-03-04 09:27:11 -0800241 required: ["art_apex_boot_integrity"],
Andreas Gampee55ea982019-02-26 09:11:20 -0800242}
243
244// Release version of the Runtime APEX module (not containing debug
245// variants nor tools), included in user builds. Also used for
246// storage-constrained devices in userdebug and eng builds.
247apex {
248 name: "com.android.runtime.release",
249 defaults: ["com.android.runtime-defaults"],
Jiyong Parke9618552019-02-11 10:54:36 +0900250 certificate: ":com.android.runtime.release.certificate",
Roland Levillain53058802018-11-14 17:32:18 +0000251}
252
253// "Debug" version of the Runtime APEX module (containing both release and
254// debug variants, as well as additional tools), included in userdebug and
255// eng build.
256apex {
257 name: "com.android.runtime.debug",
Andreas Gampee55ea982019-02-26 09:11:20 -0800258 defaults: ["com.android.runtime-defaults"],
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700259 native_shared_libs: art_runtime_debug_native_shared_libs +
Roland Levillain89867bf2019-06-24 15:09:01 +0100260 libcore_debug_native_shared_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100261 multilib: {
Roland Levillain6dd62122019-06-18 19:10:21 +0100262 both: {
263 binaries: art_tools_debug_binaries_both,
264 },
Roland Levillain38a938e2018-09-21 10:55:51 +0100265 prefer32: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700266 binaries: art_runtime_debug_binaries_prefer32 +
267 art_runtime_debug_binaries_prefer32_device,
Roland Levillain38a938e2018-09-21 10:55:51 +0100268 },
269 first: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700270 binaries: art_tools_debug_binaries +
271 art_tools_debug_device_only_binaries,
272 },
Roland Levillain38a938e2018-09-21 10:55:51 +0100273 },
Jiyong Parke9618552019-02-11 10:54:36 +0900274 certificate: ":com.android.runtime.debug.certificate",
Roland Levillain38a938e2018-09-21 10:55:51 +0100275}
Alex Lightda948ce2018-12-06 17:05:41 +0000276
277// TODO: Do this better. art_apex will disable host builds when
278// HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug
279// because binaries have different multilib classes and 'multilib: {}' isn't
280// supported by target: { ... }.
281// See b/120617876 for more information.
Alex Light0239f2f2019-02-07 13:38:50 -0800282art_apex_test {
Alex Lightda948ce2018-12-06 17:05:41 +0000283 name: "com.android.runtime.host",
284 compile_multilib: "both",
285 payload_type: "zip",
286 host_supported: true,
287 device_supported: false,
288 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000289 java_libs: libcore_java_libs,
Alex Light55a9bad2019-01-29 18:34:09 -0800290 ignore_system_library_special_case: true,
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700291 native_shared_libs: art_runtime_base_native_shared_libs +
292 art_runtime_debug_native_shared_libs +
293 libcore_native_shared_libs +
294 libcore_debug_native_shared_libs +
295 art_runtime_libraries_zipapex +
296 art_runtime_host_run_test_libs,
Alex Lightda948ce2018-12-06 17:05:41 +0000297 multilib: {
298 both: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700299 binaries: art_runtime_base_binaries_both +
Roland Levillain6dd62122019-06-18 19:10:21 +0100300 art_runtime_debug_binaries_both_host +
301 art_tools_debug_binaries_both,
Alex Lightda948ce2018-12-06 17:05:41 +0000302 },
303 first: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700304 binaries: art_tools_common_binaries + // Host APEX is always debug.
305 art_tools_debug_binaries +
306 art_tools_host_only_binaries +
307 art_runtime_base_binaries_prefer32 +
308 art_runtime_debug_binaries_prefer32,
309 },
Alex Lightda948ce2018-12-06 17:05:41 +0000310 },
311 key: "com.android.runtime.key",
Alex Lighte3521522018-12-06 22:51:18 -0800312 target: {
313 darwin: {
314 enabled: false,
315 },
Alex Light55a9bad2019-01-29 18:34:09 -0800316 linux_bionic: {
317 enabled: true,
318 multilib: {
319 both: {
320 native_shared_libs: bionic_native_shared_libs,
321 binaries: bionic_binaries_both,
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700322 },
323 },
Alex Light55a9bad2019-01-29 18:34:09 -0800324 },
Alex Lighte3521522018-12-06 22:51:18 -0800325 },
Alex Lightda948ce2018-12-06 17:05:41 +0000326}
Jiyong Park1410e9f2019-02-02 04:18:23 +0000327
328python_binary_host {
329 name: "art-apex-tester",
330 srcs: ["art_apex_test.py"],
331 main: "art_apex_test.py",
332 version: {
333 py2: {
334 enabled: false,
335 },
336 py3: {
337 enabled: true,
338 },
339 },
340}
341
342// Genrules so we can run the checker, and empty Java library so that it gets executed.
343
344genrule {
345 name: "art-check-release-apex-gen",
346 srcs: [":com.android.runtime.release"],
347 tools: [
348 "art-apex-tester",
349 "debugfs",
350 ],
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700351 cmd: "$(location art-apex-tester)" +
352 " --debugfs $(location debugfs)" +
353 " --tmpdir $(genDir)" +
354 " $(in)" +
355 " && touch $(out)",
Jiyong Park1410e9f2019-02-02 04:18:23 +0000356 out: ["art-check-release-apex-gen.dummy"],
357}
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700358
Jiyong Park1410e9f2019-02-02 04:18:23 +0000359cc_prebuilt_binary {
360 name: "art-check-release-apex-gen-fakebin",
361 srcs: [":art-check-release-apex-gen"],
362 host_supported: true,
363 device_supported: false,
364 target: {
365 darwin: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700366 enabled: false, // No python3.
Jiyong Park1410e9f2019-02-02 04:18:23 +0000367 },
368 },
369}
370
371genrule {
372 name: "art-check-debug-apex-gen",
373 srcs: [":com.android.runtime.debug"],
374 tools: [
375 "art-apex-tester",
376 "debugfs",
377 ],
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700378 cmd: "$(location art-apex-tester)" +
379 " --debugfs $(location debugfs)" +
380 " --tmpdir $(genDir)" +
381 " --debug" +
382 " $(in)" +
383 " && touch $(out)",
Jiyong Park1410e9f2019-02-02 04:18:23 +0000384 out: ["art-check-debug-apex-gen.dummy"],
385}
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700386
Jiyong Park1410e9f2019-02-02 04:18:23 +0000387cc_prebuilt_binary {
388 name: "art-check-debug-apex-gen-fakebin",
389 srcs: [":art-check-debug-apex-gen"],
390 host_supported: true,
391 device_supported: false,
392 target: {
393 darwin: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700394 enabled: false, // No python3.
Jiyong Park1410e9f2019-02-02 04:18:23 +0000395 },
396 },
397}
Andreas Gampe31782c12019-02-06 09:47:25 -0800398
399// Pre-install scripts.
400
401sh_binary {
402 name: "art_preinstall_hook",
403 src: "art_preinstall_hook.sh",
404}
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700405
Andreas Gampe31782c12019-02-06 09:47:25 -0800406sh_binary {
407 name: "art_preinstall_hook_boot",
408 src: "art_preinstall_hook_boot.sh",
409}
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700410
Andreas Gampe31782c12019-02-06 09:47:25 -0800411sh_binary {
Andreas Gampe29c111e2019-02-28 13:58:07 -0800412 name: "art_preinstall_hook_system_server",
413 src: "art_preinstall_hook_system_server.sh",
414}
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700415
Andreas Gampe29c111e2019-02-28 13:58:07 -0800416sh_binary {
Andreas Gampe31782c12019-02-06 09:47:25 -0800417 name: "art_prepostinstall_utils",
418 src: "art_prepostinstall_utils.sh",
419}
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700420
Andreas Gampe5bb525a2019-02-19 12:26:35 -0800421sh_binary {
422 name: "art_postinstall_hook",
423 src: "art_postinstall_hook.sh",
424}
Andreas Gampe57975682019-03-04 09:27:11 -0800425
426sh_binary {
427 name: "art_apex_boot_integrity",
428 src: "art_apex_boot_integrity.sh",
429 init_rc: ["art_apex_boot_integrity.rc"],
430}