blob: 0ff1cbdd1351923a6b6942350c039df23b72bcbb [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",
Martin Stjernholm0c15b822019-02-14 17:24:19 +000025 // TODO(b/124439236): Clean up the following libraries once "required"
26 // dependencies work with APEX libraries.
27 "libdt_fd_forward",
28 "libdt_socket",
29 "libjdwp",
30 "libnpt",
Roland Levillain38a938e2018-09-21 10:55:51 +010031]
Jiyong Park3296fb12018-12-13 18:32:21 +090032bionic_native_shared_libs = [
33 "libc",
34 "libm",
35 "libdl",
36]
Jiyong Parke2bc9fe2018-12-26 11:36:39 +090037bionic_binaries_both = [
38 "linker",
39]
Roland Levillain38a938e2018-09-21 10:55:51 +010040// - Debug variants (binaries for which a 32-bit version is preferred).
Roland Levillain38a938e2018-09-21 10:55:51 +010041art_runtime_debug_binaries_prefer32 = [
Roland Levillain38a938e2018-09-21 10:55:51 +010042 "dexoptanalyzerd",
43 "profmand",
44]
Alex Light572a0962019-01-18 14:48:37 -080045art_runtime_debug_binaries_prefer32_device = [
46 "dex2oatd",
47]
48art_runtime_debug_binaries_both_host = [
49 "dex2oatd",
50]
51
Roland Levillaincb82d092018-11-02 18:50:15 +000052// - Debug variants (libraries).
Roland Levillain38a938e2018-09-21 10:55:51 +010053art_runtime_debug_native_shared_libs = [
Martin Stjernholmc2f8b502019-01-17 14:51:35 +000054 "libadbconnectiond",
Roland Levillain38a938e2018-09-21 10:55:51 +010055 "libartd",
56 "libartd-compiler",
Roland Levillain38a938e2018-09-21 10:55:51 +010057 "libopenjdkjvmd",
58 "libopenjdkjvmtid",
Roland Levillain38a938e2018-09-21 10:55:51 +010059]
Roland Levillaincb82d092018-11-02 18:50:15 +000060libcore_debug_native_shared_libs = [
61 "libopenjdkd",
62]
Roland Levillain38a938e2018-09-21 10:55:51 +010063
Neil Fuller5ab4a562018-12-11 20:33:46 +000064// Data files associated with bionic / managed core library APIs.
65art_runtime_data_file_prebuilts = [
Neil Fullera886dab2018-12-06 15:12:52 +000066 "apex_tz_version",
67 "apex_tzdata",
68 "apex_tzlookup.xml",
Neil Fuller5ab4a562018-12-11 20:33:46 +000069 "apex_icu.dat",
Neil Fullera886dab2018-12-06 15:12:52 +000070]
71
Roland Levillain38a938e2018-09-21 10:55:51 +010072// Modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
Alex Lightda948ce2018-12-06 17:05:41 +000073art_tools_common_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010074 "dexdiag",
75 "dexdump",
76 "dexlist",
Alex Lightda948ce2018-12-06 17:05:41 +000077]
78
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000079// Device-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
80art_tools_device_only_binaries = [
81 // oatdump cannot link with host linux_bionic due to not using clang lld;
82 // TODO: Make it work with clang lld.
Roland Levillain38a938e2018-09-21 10:55:51 +010083 "oatdump",
84]
Roland Levillain02998cf2019-03-21 14:27:02 +000085// Same, but for only for debug packages.
86art_tools_debug_device_only_binaries = [
87 // oatdumpd cannot link with host linux_bionic due to not using clang lld;
88 // TODO: Make it work with clang lld.
89 "oatdumpd",
90]
Roland Levillain38a938e2018-09-21 10:55:51 +010091
92// Host-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000093art_tools_host_only_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010094 // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk
95 // (same issue as for `libart_fake` above).
96 //"ahat",
97 "hprof-conv",
98 // ...
99]
100
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000101art_tools_device_binaries = art_tools_common_binaries + art_tools_device_only_binaries
102art_tools_host_binaries = art_tools_common_binaries + art_tools_host_only_binaries
Alex Lightda948ce2018-12-06 17:05:41 +0000103
Alex Light6585ecb2019-02-08 14:13:22 -0800104// Libraries needed to use com.android.runtime.host for zipapex run-tests
105art_runtime_host_run_test_libs = [
106 "libartd-disassembler"
107]
108
Roland Levillaina0b19032019-02-08 15:59:56 +0000109// Core Java libraries.
110libcore_java_libs = [
111 "core-oj",
112 "core-libart",
113 "okhttp",
114 "bouncycastle",
115 "apache-xml",
116]
117
118// Native libraries that support the core Java libraries.
Roland Levillaincb82d092018-11-02 18:50:15 +0000119libcore_native_shared_libs = [
Victor Chang2f0008a2019-01-15 14:10:34 +0000120 "libandroidicu",
Pete Bentley79f56622019-03-21 17:09:56 +0000121 "libandroidio",
Victor Chang2f0008a2019-01-15 14:10:34 +0000122 "libexpat",
123 "libicui18n",
124 "libicuuc",
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000125 "libjavacore",
Roland Levillaincb82d092018-11-02 18:50:15 +0000126 "libopenjdk",
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000127 "libz",
Victor Chang2f0008a2019-01-15 14:10:34 +0000128 "libziparchive",
129]
130
131libcore_native_device_only_shared_libs = libcore_native_shared_libs + [
132 // TODO(b/122876336): Remove libpac.so once it's migrated to Webview.
133 // libpac is used by frameworks, not by ART host.
134 "libpac",
Roland Levillaincb82d092018-11-02 18:50:15 +0000135]
136
Alex Lightf7f31522019-02-01 11:14:41 -0800137// Temporary library includes for b/123591866 as all libraries are moved into the main art-apex.
138art_runtime_libraries_zipapex = [
139 "libnativebridge",
140 "libnativeloader",
141 "libnativehelper",
142 "libcutils",
143]
144
Roland Levillain38a938e2018-09-21 10:55:51 +0100145apex_key {
146 name: "com.android.runtime.key",
Jiyong Park11a2df32018-11-22 16:25:08 +0900147 public_key: "com.android.runtime.avbpubkey",
148 private_key: "com.android.runtime.pem",
Roland Levillain38a938e2018-09-21 10:55:51 +0100149}
150
Jiyong Parke9618552019-02-11 10:54:36 +0900151android_app_certificate {
152 name: "com.android.runtime.debug.certificate",
153 certificate: "com.android.runtime.debug",
154}
155
156android_app_certificate {
157 name: "com.android.runtime.release.certificate",
158 certificate: "com.android.runtime.release",
159}
160
Roland Levillain3be7afe2018-12-04 19:35:03 +0000161prebuilt_etc {
162 name: "com.android.runtime.ld.config.txt",
163 src: "ld.config.txt",
164 filename: "ld.config.txt",
165 installable: false,
166}
167
Andreas Gampee55ea982019-02-26 09:11:20 -0800168apex_defaults {
169 name: "com.android.runtime-defaults",
Roland Levillain53058802018-11-14 17:32:18 +0000170 compile_multilib: "both",
171 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000172 java_libs: libcore_java_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000173 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000174 + bionic_native_shared_libs
Victor Chang2f0008a2019-01-15 14:10:34 +0000175 + libcore_native_device_only_shared_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000176 multilib: {
177 both: {
Jiyong Parke2bc9fe2018-12-26 11:36:39 +0900178 binaries: art_runtime_base_binaries_both
179 + bionic_binaries_both,
Roland Levillain53058802018-11-14 17:32:18 +0000180 },
181 prefer32: {
182 binaries: art_runtime_base_binaries_prefer32,
183 },
184 first: {
Roland Levillain02998cf2019-03-21 14:27:02 +0000185 binaries: art_tools_device_binaries,
Roland Levillain53058802018-11-14 17:32:18 +0000186 }
187 },
Andreas Gampe31782c12019-02-06 09:47:25 -0800188 binaries: [
Andreas Gampe5bb525a2019-02-19 12:26:35 -0800189 "art_postinstall_hook",
Andreas Gampe31782c12019-02-06 09:47:25 -0800190 "art_preinstall_hook",
191 "art_preinstall_hook_boot",
Andreas Gampe29c111e2019-02-28 13:58:07 -0800192 "art_preinstall_hook_system_server",
Andreas Gampe31782c12019-02-06 09:47:25 -0800193 "art_prepostinstall_utils",
194 ],
Neil Fuller5ab4a562018-12-11 20:33:46 +0000195 prebuilts: art_runtime_data_file_prebuilts
Neil Fullera886dab2018-12-06 15:12:52 +0000196 + ["com.android.runtime.ld.config.txt"],
Roland Levillain53058802018-11-14 17:32:18 +0000197 key: "com.android.runtime.key",
Andreas Gampe57975682019-03-04 09:27:11 -0800198 required: ["art_apex_boot_integrity"],
Andreas Gampee55ea982019-02-26 09:11:20 -0800199}
200
201// Release version of the Runtime APEX module (not containing debug
202// variants nor tools), included in user builds. Also used for
203// storage-constrained devices in userdebug and eng builds.
204apex {
205 name: "com.android.runtime.release",
206 defaults: ["com.android.runtime-defaults"],
Jiyong Parke9618552019-02-11 10:54:36 +0900207 certificate: ":com.android.runtime.release.certificate",
Roland Levillain53058802018-11-14 17:32:18 +0000208}
209
210// "Debug" version of the Runtime APEX module (containing both release and
211// debug variants, as well as additional tools), included in userdebug and
212// eng build.
213apex {
214 name: "com.android.runtime.debug",
Andreas Gampee55ea982019-02-26 09:11:20 -0800215 defaults: ["com.android.runtime-defaults"],
216 native_shared_libs: art_runtime_debug_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000217 + libcore_debug_native_shared_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100218 multilib: {
Roland Levillain38a938e2018-09-21 10:55:51 +0100219 prefer32: {
Andreas Gampee55ea982019-02-26 09:11:20 -0800220 binaries: art_runtime_debug_binaries_prefer32
Alex Light572a0962019-01-18 14:48:37 -0800221 + art_runtime_debug_binaries_prefer32_device,
Roland Levillain38a938e2018-09-21 10:55:51 +0100222 },
223 first: {
Roland Levillain02998cf2019-03-21 14:27:02 +0000224 binaries: art_tools_debug_device_only_binaries,
Roland Levillain38a938e2018-09-21 10:55:51 +0100225 }
226 },
Jiyong Parke9618552019-02-11 10:54:36 +0900227 certificate: ":com.android.runtime.debug.certificate",
Roland Levillain38a938e2018-09-21 10:55:51 +0100228}
Alex Lightda948ce2018-12-06 17:05:41 +0000229
230// TODO: Do this better. art_apex will disable host builds when
231// HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug
232// because binaries have different multilib classes and 'multilib: {}' isn't
233// supported by target: { ... }.
234// See b/120617876 for more information.
Alex Light0239f2f2019-02-07 13:38:50 -0800235art_apex_test {
Alex Lightda948ce2018-12-06 17:05:41 +0000236 name: "com.android.runtime.host",
237 compile_multilib: "both",
238 payload_type: "zip",
239 host_supported: true,
240 device_supported: false,
241 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000242 java_libs: libcore_java_libs,
Alex Light55a9bad2019-01-29 18:34:09 -0800243 ignore_system_library_special_case: true,
Alex Lightda948ce2018-12-06 17:05:41 +0000244 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000245 + art_runtime_debug_native_shared_libs
246 + libcore_native_shared_libs
Alex Lightf7f31522019-02-01 11:14:41 -0800247 + libcore_debug_native_shared_libs
Alex Light6585ecb2019-02-08 14:13:22 -0800248 + art_runtime_libraries_zipapex
249 + art_runtime_host_run_test_libs,
Alex Lightda948ce2018-12-06 17:05:41 +0000250 multilib: {
251 both: {
Alex Light572a0962019-01-18 14:48:37 -0800252 binaries: art_runtime_base_binaries_both
253 + art_runtime_debug_binaries_both_host,
Alex Lightda948ce2018-12-06 17:05:41 +0000254 },
255 first: {
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000256 binaries: art_tools_host_binaries
Alex Lightda948ce2018-12-06 17:05:41 +0000257 + art_runtime_base_binaries_prefer32
258 + art_runtime_debug_binaries_prefer32,
259 }
260 },
261 key: "com.android.runtime.key",
Alex Lighte3521522018-12-06 22:51:18 -0800262 target: {
263 darwin: {
264 enabled: false,
265 },
Alex Light55a9bad2019-01-29 18:34:09 -0800266 linux_bionic: {
267 enabled: true,
268 multilib: {
269 both: {
270 native_shared_libs: bionic_native_shared_libs,
271 binaries: bionic_binaries_both,
272 }
273 }
274 },
Alex Lighte3521522018-12-06 22:51:18 -0800275 },
Alex Lightda948ce2018-12-06 17:05:41 +0000276}
Jiyong Park1410e9f2019-02-02 04:18:23 +0000277
278python_binary_host {
279 name: "art-apex-tester",
280 srcs: ["art_apex_test.py"],
281 main: "art_apex_test.py",
282 version: {
283 py2: {
284 enabled: false,
285 },
286 py3: {
287 enabled: true,
288 },
289 },
290}
291
292// Genrules so we can run the checker, and empty Java library so that it gets executed.
293
294genrule {
295 name: "art-check-release-apex-gen",
296 srcs: [":com.android.runtime.release"],
297 tools: [
298 "art-apex-tester",
299 "debugfs",
300 ],
301 cmd: "$(location art-apex-tester)"
302 + " --debugfs $(location debugfs)"
303 + " --tmpdir $(genDir)"
304 + " $(in)"
305 + " && touch $(out)",
306 out: ["art-check-release-apex-gen.dummy"],
307}
308cc_prebuilt_binary {
309 name: "art-check-release-apex-gen-fakebin",
310 srcs: [":art-check-release-apex-gen"],
311 host_supported: true,
312 device_supported: false,
313 target: {
314 darwin: {
315 enabled: false, // No python3.
316 },
317 },
318}
319
320genrule {
321 name: "art-check-debug-apex-gen",
322 srcs: [":com.android.runtime.debug"],
323 tools: [
324 "art-apex-tester",
325 "debugfs",
326 ],
327 cmd: "$(location art-apex-tester)"
328 + " --debugfs $(location debugfs)"
329 + " --tmpdir $(genDir)"
330 + " --debug"
331 + " $(in)"
332 + " && touch $(out)",
333 out: ["art-check-debug-apex-gen.dummy"],
334}
335cc_prebuilt_binary {
336 name: "art-check-debug-apex-gen-fakebin",
337 srcs: [":art-check-debug-apex-gen"],
338 host_supported: true,
339 device_supported: false,
340 target: {
341 darwin: {
342 enabled: false, // No python3.
343 },
344 },
345}
Andreas Gampe31782c12019-02-06 09:47:25 -0800346
347// Pre-install scripts.
348
349sh_binary {
350 name: "art_preinstall_hook",
351 src: "art_preinstall_hook.sh",
352}
353sh_binary {
354 name: "art_preinstall_hook_boot",
355 src: "art_preinstall_hook_boot.sh",
356}
357sh_binary {
Andreas Gampe29c111e2019-02-28 13:58:07 -0800358 name: "art_preinstall_hook_system_server",
359 src: "art_preinstall_hook_system_server.sh",
360}
361sh_binary {
Andreas Gampe31782c12019-02-06 09:47:25 -0800362 name: "art_prepostinstall_utils",
363 src: "art_prepostinstall_utils.sh",
364}
Andreas Gampe5bb525a2019-02-19 12:26:35 -0800365sh_binary {
366 name: "art_postinstall_hook",
367 src: "art_postinstall_hook.sh",
368}
Andreas Gampe57975682019-03-04 09:27:11 -0800369
370sh_binary {
371 name: "art_apex_boot_integrity",
372 src: "art_apex_boot_integrity.sh",
373 init_rc: ["art_apex_boot_integrity.rc"],
374}