blob: 15e5c02243d9b578fc04e002a6fdbb0cb9957242 [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 Stjernholmc2f8b502019-01-17 14:51:35 +000026 "libadbconnection",
Roland Levillain38a938e2018-09-21 10:55:51 +010027 "libart",
28 "libart-compiler",
Martin Stjernholm84bf6982019-02-05 15:07:57 +000029 "libdexfile_external",
Martin Stjernholmc2f8b502019-01-17 14:51:35 +000030 "libnativebridge",
31 "libnativehelper",
32 "libnativeloader",
Roland Levillain38a938e2018-09-21 10:55:51 +010033 "libopenjdkjvm",
34 "libopenjdkjvmti",
Martin Stjernholm0c15b822019-02-14 17:24:19 +000035 // TODO(b/124439236): Clean up the following libraries once "required"
36 // dependencies work with APEX libraries.
37 "libdt_fd_forward",
38 "libdt_socket",
39 "libjdwp",
40 "libnpt",
Roland Levillain38a938e2018-09-21 10:55:51 +010041]
Jiyong Park3296fb12018-12-13 18:32:21 +090042bionic_native_shared_libs = [
43 "libc",
44 "libm",
45 "libdl",
46]
Jiyong Parke2bc9fe2018-12-26 11:36:39 +090047bionic_binaries_both = [
48 "linker",
49]
Roland Levillain38a938e2018-09-21 10:55:51 +010050// - Debug variants (binaries for which a 32-bit version is preferred).
Roland Levillain38a938e2018-09-21 10:55:51 +010051art_runtime_debug_binaries_prefer32 = [
Roland Levillain38a938e2018-09-21 10:55:51 +010052 "dexoptanalyzerd",
53 "profmand",
54]
Alex Light572a0962019-01-18 14:48:37 -080055art_runtime_debug_binaries_prefer32_device = [
56 "dex2oatd",
57]
58art_runtime_debug_binaries_both_host = [
59 "dex2oatd",
60]
61
Roland Levillaincb82d092018-11-02 18:50:15 +000062// - Debug variants (libraries).
Roland Levillain38a938e2018-09-21 10:55:51 +010063art_runtime_debug_native_shared_libs = [
Martin Stjernholmc2f8b502019-01-17 14:51:35 +000064 "libadbconnectiond",
Roland Levillain38a938e2018-09-21 10:55:51 +010065 "libartd",
66 "libartd-compiler",
Roland Levillain38a938e2018-09-21 10:55:51 +010067 "libopenjdkjvmd",
68 "libopenjdkjvmtid",
Roland Levillain38a938e2018-09-21 10:55:51 +010069]
Roland Levillaincb82d092018-11-02 18:50:15 +000070libcore_debug_native_shared_libs = [
71 "libopenjdkd",
72]
Roland Levillain38a938e2018-09-21 10:55:51 +010073
Neil Fuller5ab4a562018-12-11 20:33:46 +000074// Data files associated with bionic / managed core library APIs.
75art_runtime_data_file_prebuilts = [
Neil Fullera886dab2018-12-06 15:12:52 +000076 "apex_tz_version",
77 "apex_tzdata",
78 "apex_tzlookup.xml",
Neil Fuller5ab4a562018-12-11 20:33:46 +000079 "apex_icu.dat",
Neil Fullera886dab2018-12-06 15:12:52 +000080]
81
Orion Hodson5cb98a92019-03-25 15:07:16 +000082// Tools common to both device APEX and host APEX. Derived from art-tools in art/Android.mk.
Alex Lightda948ce2018-12-06 17:05:41 +000083art_tools_common_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010084 "dexdiag",
85 "dexdump",
86 "dexlist",
Alex Lightda948ce2018-12-06 17:05:41 +000087]
88
Orion Hodson5cb98a92019-03-25 15:07:16 +000089// Tools exclusively for the device APEX derived from art-tools in art/Android.mk.
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000090art_tools_device_only_binaries = [
91 // oatdump cannot link with host linux_bionic due to not using clang lld;
92 // TODO: Make it work with clang lld.
Roland Levillain38a938e2018-09-21 10:55:51 +010093 "oatdump",
94]
Roland Levillain02998cf2019-03-21 14:27:02 +000095// Same, but for only for debug packages.
96art_tools_debug_device_only_binaries = [
97 // oatdumpd cannot link with host linux_bionic due to not using clang lld;
98 // TODO: Make it work with clang lld.
99 "oatdumpd",
100]
Roland Levillain38a938e2018-09-21 10:55:51 +0100101
Orion Hodson5cb98a92019-03-25 15:07:16 +0000102// Tools exclusively for the host APEX derived from art-tools in art/Android.mk.
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000103art_tools_host_only_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +0100104 // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk
105 // (same issue as for `libart_fake` above).
106 //"ahat",
107 "hprof-conv",
108 // ...
109]
110
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000111art_tools_device_binaries = art_tools_common_binaries + art_tools_device_only_binaries
112art_tools_host_binaries = art_tools_common_binaries + art_tools_host_only_binaries
Alex Lightda948ce2018-12-06 17:05:41 +0000113
Alex Light6585ecb2019-02-08 14:13:22 -0800114// Libraries needed to use com.android.runtime.host for zipapex run-tests
115art_runtime_host_run_test_libs = [
116 "libartd-disassembler"
117]
118
Roland Levillaina0b19032019-02-08 15:59:56 +0000119// Core Java libraries.
120libcore_java_libs = [
121 "core-oj",
122 "core-libart",
123 "okhttp",
124 "bouncycastle",
125 "apache-xml",
126]
127
128// Native libraries that support the core Java libraries.
Roland Levillain1617f8c2019-03-26 17:52:30 +0000129//
130// Note: ART on-device chroot-based testing and benchmarking is not yet using
131// the Runtime APEX, meaning that copies of some of these libraries have to be
132// installed in `/system` for the ART Buildbot set-up to work properly. This is
133// done by the `standalone-apex-files` Make phony target, used by the ART
134// Buildbot and Golem (see `art/Android.mk`). If you add libraries to this list,
135// you may have to also add them to `PRIVATE_RUNTIME_DEPENDENCY_LIBS` in
136// `art/Android.mk`.
137// TODO(b/121117762): Remove this note when both the ART Buildbot and Golem use
138// the Runtime APEX.
Roland Levillaincb82d092018-11-02 18:50:15 +0000139libcore_native_shared_libs = [
Victor Chang2f0008a2019-01-15 14:10:34 +0000140 "libandroidicu",
Pete Bentley79f56622019-03-21 17:09:56 +0000141 "libandroidio",
Victor Chang2f0008a2019-01-15 14:10:34 +0000142 "libexpat",
143 "libicui18n",
144 "libicuuc",
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000145 "libjavacore",
Roland Levillaincb82d092018-11-02 18:50:15 +0000146 "libopenjdk",
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000147 "libz",
Victor Chang2f0008a2019-01-15 14:10:34 +0000148 "libziparchive",
149]
150
151libcore_native_device_only_shared_libs = libcore_native_shared_libs + [
152 // TODO(b/122876336): Remove libpac.so once it's migrated to Webview.
153 // libpac is used by frameworks, not by ART host.
154 "libpac",
Roland Levillaincb82d092018-11-02 18:50:15 +0000155]
156
Alex Lightf7f31522019-02-01 11:14:41 -0800157// Temporary library includes for b/123591866 as all libraries are moved into the main art-apex.
158art_runtime_libraries_zipapex = [
159 "libnativebridge",
160 "libnativeloader",
161 "libnativehelper",
162 "libcutils",
163]
164
Roland Levillain38a938e2018-09-21 10:55:51 +0100165apex_key {
166 name: "com.android.runtime.key",
Jiyong Park11a2df32018-11-22 16:25:08 +0900167 public_key: "com.android.runtime.avbpubkey",
168 private_key: "com.android.runtime.pem",
Roland Levillain38a938e2018-09-21 10:55:51 +0100169}
170
Jiyong Parke9618552019-02-11 10:54:36 +0900171android_app_certificate {
172 name: "com.android.runtime.debug.certificate",
173 certificate: "com.android.runtime.debug",
174}
175
176android_app_certificate {
177 name: "com.android.runtime.release.certificate",
178 certificate: "com.android.runtime.release",
179}
180
Roland Levillain3be7afe2018-12-04 19:35:03 +0000181prebuilt_etc {
182 name: "com.android.runtime.ld.config.txt",
183 src: "ld.config.txt",
184 filename: "ld.config.txt",
185 installable: false,
186}
187
Andreas Gampee55ea982019-02-26 09:11:20 -0800188apex_defaults {
189 name: "com.android.runtime-defaults",
Roland Levillain53058802018-11-14 17:32:18 +0000190 compile_multilib: "both",
191 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000192 java_libs: libcore_java_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000193 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000194 + bionic_native_shared_libs
Victor Chang2f0008a2019-01-15 14:10:34 +0000195 + libcore_native_device_only_shared_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000196 multilib: {
197 both: {
Jiyong Parke2bc9fe2018-12-26 11:36:39 +0900198 binaries: art_runtime_base_binaries_both
199 + bionic_binaries_both,
Roland Levillain53058802018-11-14 17:32:18 +0000200 },
201 prefer32: {
202 binaries: art_runtime_base_binaries_prefer32,
203 },
204 first: {
Roland Levillain02998cf2019-03-21 14:27:02 +0000205 binaries: art_tools_device_binaries,
Roland Levillain53058802018-11-14 17:32:18 +0000206 }
207 },
Andreas Gampe31782c12019-02-06 09:47:25 -0800208 binaries: [
Andreas Gampe5bb525a2019-02-19 12:26:35 -0800209 "art_postinstall_hook",
Andreas Gampe31782c12019-02-06 09:47:25 -0800210 "art_preinstall_hook",
211 "art_preinstall_hook_boot",
Andreas Gampe29c111e2019-02-28 13:58:07 -0800212 "art_preinstall_hook_system_server",
Andreas Gampe31782c12019-02-06 09:47:25 -0800213 "art_prepostinstall_utils",
214 ],
Neil Fuller5ab4a562018-12-11 20:33:46 +0000215 prebuilts: art_runtime_data_file_prebuilts
Neil Fullera886dab2018-12-06 15:12:52 +0000216 + ["com.android.runtime.ld.config.txt"],
Roland Levillain53058802018-11-14 17:32:18 +0000217 key: "com.android.runtime.key",
Andreas Gampe57975682019-03-04 09:27:11 -0800218 required: ["art_apex_boot_integrity"],
Andreas Gampee55ea982019-02-26 09:11:20 -0800219}
220
221// Release version of the Runtime APEX module (not containing debug
222// variants nor tools), included in user builds. Also used for
223// storage-constrained devices in userdebug and eng builds.
224apex {
225 name: "com.android.runtime.release",
226 defaults: ["com.android.runtime-defaults"],
Jiyong Parke9618552019-02-11 10:54:36 +0900227 certificate: ":com.android.runtime.release.certificate",
Roland Levillain53058802018-11-14 17:32:18 +0000228}
229
230// "Debug" version of the Runtime APEX module (containing both release and
231// debug variants, as well as additional tools), included in userdebug and
232// eng build.
233apex {
234 name: "com.android.runtime.debug",
Andreas Gampee55ea982019-02-26 09:11:20 -0800235 defaults: ["com.android.runtime-defaults"],
236 native_shared_libs: art_runtime_debug_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000237 + libcore_debug_native_shared_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100238 multilib: {
Roland Levillain38a938e2018-09-21 10:55:51 +0100239 prefer32: {
Andreas Gampee55ea982019-02-26 09:11:20 -0800240 binaries: art_runtime_debug_binaries_prefer32
Alex Light572a0962019-01-18 14:48:37 -0800241 + art_runtime_debug_binaries_prefer32_device,
Roland Levillain38a938e2018-09-21 10:55:51 +0100242 },
243 first: {
Roland Levillain02998cf2019-03-21 14:27:02 +0000244 binaries: art_tools_debug_device_only_binaries,
Roland Levillain38a938e2018-09-21 10:55:51 +0100245 }
246 },
Jiyong Parke9618552019-02-11 10:54:36 +0900247 certificate: ":com.android.runtime.debug.certificate",
Roland Levillain38a938e2018-09-21 10:55:51 +0100248}
Alex Lightda948ce2018-12-06 17:05:41 +0000249
250// TODO: Do this better. art_apex will disable host builds when
251// HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug
252// because binaries have different multilib classes and 'multilib: {}' isn't
253// supported by target: { ... }.
254// See b/120617876 for more information.
Alex Light0239f2f2019-02-07 13:38:50 -0800255art_apex_test {
Alex Lightda948ce2018-12-06 17:05:41 +0000256 name: "com.android.runtime.host",
257 compile_multilib: "both",
258 payload_type: "zip",
259 host_supported: true,
260 device_supported: false,
261 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000262 java_libs: libcore_java_libs,
Alex Light55a9bad2019-01-29 18:34:09 -0800263 ignore_system_library_special_case: true,
Alex Lightda948ce2018-12-06 17:05:41 +0000264 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000265 + art_runtime_debug_native_shared_libs
266 + libcore_native_shared_libs
Alex Lightf7f31522019-02-01 11:14:41 -0800267 + libcore_debug_native_shared_libs
Alex Light6585ecb2019-02-08 14:13:22 -0800268 + art_runtime_libraries_zipapex
269 + art_runtime_host_run_test_libs,
Alex Lightda948ce2018-12-06 17:05:41 +0000270 multilib: {
271 both: {
Alex Light572a0962019-01-18 14:48:37 -0800272 binaries: art_runtime_base_binaries_both
273 + art_runtime_debug_binaries_both_host,
Alex Lightda948ce2018-12-06 17:05:41 +0000274 },
275 first: {
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000276 binaries: art_tools_host_binaries
Alex Lightda948ce2018-12-06 17:05:41 +0000277 + art_runtime_base_binaries_prefer32
278 + art_runtime_debug_binaries_prefer32,
279 }
280 },
281 key: "com.android.runtime.key",
Alex Lighte3521522018-12-06 22:51:18 -0800282 target: {
283 darwin: {
284 enabled: false,
285 },
Alex Light55a9bad2019-01-29 18:34:09 -0800286 linux_bionic: {
287 enabled: true,
288 multilib: {
289 both: {
290 native_shared_libs: bionic_native_shared_libs,
291 binaries: bionic_binaries_both,
292 }
293 }
294 },
Alex Lighte3521522018-12-06 22:51:18 -0800295 },
Alex Lightda948ce2018-12-06 17:05:41 +0000296}
Jiyong Park1410e9f2019-02-02 04:18:23 +0000297
298python_binary_host {
299 name: "art-apex-tester",
300 srcs: ["art_apex_test.py"],
301 main: "art_apex_test.py",
302 version: {
303 py2: {
304 enabled: false,
305 },
306 py3: {
307 enabled: true,
308 },
309 },
310}
311
312// Genrules so we can run the checker, and empty Java library so that it gets executed.
313
314genrule {
315 name: "art-check-release-apex-gen",
316 srcs: [":com.android.runtime.release"],
317 tools: [
318 "art-apex-tester",
319 "debugfs",
320 ],
321 cmd: "$(location art-apex-tester)"
322 + " --debugfs $(location debugfs)"
323 + " --tmpdir $(genDir)"
324 + " $(in)"
325 + " && touch $(out)",
326 out: ["art-check-release-apex-gen.dummy"],
327}
328cc_prebuilt_binary {
329 name: "art-check-release-apex-gen-fakebin",
330 srcs: [":art-check-release-apex-gen"],
331 host_supported: true,
332 device_supported: false,
333 target: {
334 darwin: {
335 enabled: false, // No python3.
336 },
337 },
338}
339
340genrule {
341 name: "art-check-debug-apex-gen",
342 srcs: [":com.android.runtime.debug"],
343 tools: [
344 "art-apex-tester",
345 "debugfs",
346 ],
347 cmd: "$(location art-apex-tester)"
348 + " --debugfs $(location debugfs)"
349 + " --tmpdir $(genDir)"
350 + " --debug"
351 + " $(in)"
352 + " && touch $(out)",
353 out: ["art-check-debug-apex-gen.dummy"],
354}
355cc_prebuilt_binary {
356 name: "art-check-debug-apex-gen-fakebin",
357 srcs: [":art-check-debug-apex-gen"],
358 host_supported: true,
359 device_supported: false,
360 target: {
361 darwin: {
362 enabled: false, // No python3.
363 },
364 },
365}
Andreas Gampe31782c12019-02-06 09:47:25 -0800366
367// Pre-install scripts.
368
369sh_binary {
370 name: "art_preinstall_hook",
371 src: "art_preinstall_hook.sh",
372}
373sh_binary {
374 name: "art_preinstall_hook_boot",
375 src: "art_preinstall_hook_boot.sh",
376}
377sh_binary {
Andreas Gampe29c111e2019-02-28 13:58:07 -0800378 name: "art_preinstall_hook_system_server",
379 src: "art_preinstall_hook_system_server.sh",
380}
381sh_binary {
Andreas Gampe31782c12019-02-06 09:47:25 -0800382 name: "art_prepostinstall_utils",
383 src: "art_prepostinstall_utils.sh",
384}
Andreas Gampe5bb525a2019-02-19 12:26:35 -0800385sh_binary {
386 name: "art_postinstall_hook",
387 src: "art_postinstall_hook.sh",
388}
Andreas Gampe57975682019-03-04 09:27:11 -0800389
390sh_binary {
391 name: "art_apex_boot_integrity",
392 src: "art_apex_boot_integrity.sh",
393 init_rc: ["art_apex_boot_integrity.rc"],
394}