blob: 42e8a38db7d07ace9c25885665b3f1f46b610709 [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]
85
86// Host-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000087art_tools_host_only_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010088 // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk
89 // (same issue as for `libart_fake` above).
90 //"ahat",
91 "hprof-conv",
92 // ...
93]
94
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000095art_tools_device_binaries = art_tools_common_binaries + art_tools_device_only_binaries
96art_tools_host_binaries = art_tools_common_binaries + art_tools_host_only_binaries
Alex Lightda948ce2018-12-06 17:05:41 +000097
Alex Light6585ecb2019-02-08 14:13:22 -080098// Libraries needed to use com.android.runtime.host for zipapex run-tests
99art_runtime_host_run_test_libs = [
100 "libartd-disassembler"
101]
102
Roland Levillaina0b19032019-02-08 15:59:56 +0000103// Core Java libraries.
104libcore_java_libs = [
105 "core-oj",
106 "core-libart",
107 "okhttp",
108 "bouncycastle",
109 "apache-xml",
110]
111
112// Native libraries that support the core Java libraries.
Roland Levillaincb82d092018-11-02 18:50:15 +0000113libcore_native_shared_libs = [
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000114 "libjavacore",
Roland Levillaincb82d092018-11-02 18:50:15 +0000115 "libopenjdk",
Pete Bentley51ffdbe2019-01-11 15:25:40 +0000116 "libexpat",
117 "libz",
118 "libziparchive"
Roland Levillaincb82d092018-11-02 18:50:15 +0000119]
120
Alex Lightf7f31522019-02-01 11:14:41 -0800121// Temporary library includes for b/123591866 as all libraries are moved into the main art-apex.
122art_runtime_libraries_zipapex = [
123 "libnativebridge",
124 "libnativeloader",
125 "libnativehelper",
126 "libcutils",
127]
128
Roland Levillain38a938e2018-09-21 10:55:51 +0100129apex_key {
130 name: "com.android.runtime.key",
Jiyong Park11a2df32018-11-22 16:25:08 +0900131 public_key: "com.android.runtime.avbpubkey",
132 private_key: "com.android.runtime.pem",
Roland Levillain38a938e2018-09-21 10:55:51 +0100133}
134
Roland Levillain3be7afe2018-12-04 19:35:03 +0000135prebuilt_etc {
136 name: "com.android.runtime.ld.config.txt",
137 src: "ld.config.txt",
138 filename: "ld.config.txt",
139 installable: false,
140}
141
Roland Levillain53058802018-11-14 17:32:18 +0000142// TODO: Introduce `apex_defaults` to factor common parts of `apex`
143// module definitions below?
144
145// Release version of the Runtime APEX module (not containing debug
146// variants nor tools), included in user builds. Also used for
147// storage-constrained devices in userdebug and eng builds.
Roland Levillain38a938e2018-09-21 10:55:51 +0100148apex {
Roland Levillain53058802018-11-14 17:32:18 +0000149 name: "com.android.runtime.release",
150 compile_multilib: "both",
151 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000152 java_libs: libcore_java_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000153 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000154 + bionic_native_shared_libs
155 + libcore_native_shared_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000156 multilib: {
157 both: {
158 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
159 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Jiyong Parke2bc9fe2018-12-26 11:36:39 +0900160 binaries: art_runtime_base_binaries_both
161 + bionic_binaries_both,
Roland Levillain53058802018-11-14 17:32:18 +0000162 },
163 prefer32: {
164 binaries: art_runtime_base_binaries_prefer32,
165 },
166 first: {
167 binaries: [],
168 }
169 },
Neil Fuller5ab4a562018-12-11 20:33:46 +0000170 prebuilts: art_runtime_data_file_prebuilts
Neil Fullera886dab2018-12-06 15:12:52 +0000171 + ["com.android.runtime.ld.config.txt"],
Roland Levillain53058802018-11-14 17:32:18 +0000172 key: "com.android.runtime.key",
Roland Levillain53058802018-11-14 17:32:18 +0000173}
174
175// "Debug" version of the Runtime APEX module (containing both release and
176// debug variants, as well as additional tools), included in userdebug and
177// eng build.
178apex {
179 name: "com.android.runtime.debug",
Roland Levillain38a938e2018-09-21 10:55:51 +0100180 compile_multilib: "both",
181 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000182 java_libs: libcore_java_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100183 native_shared_libs: art_runtime_base_native_shared_libs
Jiyong Park3296fb12018-12-13 18:32:21 +0900184 + art_runtime_debug_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000185 + bionic_native_shared_libs
186 + libcore_native_shared_libs
187 + libcore_debug_native_shared_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100188 multilib: {
189 both: {
190 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
191 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Jiyong Parke2bc9fe2018-12-26 11:36:39 +0900192 binaries: art_runtime_base_binaries_both
193 + bionic_binaries_both,
Roland Levillain38a938e2018-09-21 10:55:51 +0100194 },
195 prefer32: {
196 binaries: art_runtime_base_binaries_prefer32
Alex Light572a0962019-01-18 14:48:37 -0800197 + art_runtime_debug_binaries_prefer32
198 + art_runtime_debug_binaries_prefer32_device,
Roland Levillain38a938e2018-09-21 10:55:51 +0100199 },
200 first: {
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000201 binaries: art_tools_device_binaries,
Roland Levillain38a938e2018-09-21 10:55:51 +0100202 }
203 },
Neil Fuller5ab4a562018-12-11 20:33:46 +0000204 prebuilts: art_runtime_data_file_prebuilts
Neil Fullera886dab2018-12-06 15:12:52 +0000205 + ["com.android.runtime.ld.config.txt"],
Roland Levillain38a938e2018-09-21 10:55:51 +0100206 key: "com.android.runtime.key",
Roland Levillain38a938e2018-09-21 10:55:51 +0100207}
Alex Lightda948ce2018-12-06 17:05:41 +0000208
209// TODO: Do this better. art_apex will disable host builds when
210// HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug
211// because binaries have different multilib classes and 'multilib: {}' isn't
212// supported by target: { ... }.
213// See b/120617876 for more information.
Alex Light0239f2f2019-02-07 13:38:50 -0800214art_apex_test {
Alex Lightda948ce2018-12-06 17:05:41 +0000215 name: "com.android.runtime.host",
216 compile_multilib: "both",
217 payload_type: "zip",
218 host_supported: true,
219 device_supported: false,
220 manifest: "manifest.json",
Roland Levillaina0b19032019-02-08 15:59:56 +0000221 java_libs: libcore_java_libs,
Alex Light55a9bad2019-01-29 18:34:09 -0800222 ignore_system_library_special_case: true,
Alex Lightda948ce2018-12-06 17:05:41 +0000223 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000224 + art_runtime_debug_native_shared_libs
225 + libcore_native_shared_libs
Alex Lightf7f31522019-02-01 11:14:41 -0800226 + libcore_debug_native_shared_libs
Alex Light6585ecb2019-02-08 14:13:22 -0800227 + art_runtime_libraries_zipapex
228 + art_runtime_host_run_test_libs,
Alex Lightda948ce2018-12-06 17:05:41 +0000229 multilib: {
230 both: {
231 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
232 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Alex Light572a0962019-01-18 14:48:37 -0800233 binaries: art_runtime_base_binaries_both
234 + art_runtime_debug_binaries_both_host,
Alex Lightda948ce2018-12-06 17:05:41 +0000235 },
236 first: {
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000237 binaries: art_tools_host_binaries
Alex Lightda948ce2018-12-06 17:05:41 +0000238 + art_runtime_base_binaries_prefer32
239 + art_runtime_debug_binaries_prefer32,
240 }
241 },
242 key: "com.android.runtime.key",
Alex Lighte3521522018-12-06 22:51:18 -0800243 target: {
244 darwin: {
245 enabled: false,
246 },
Alex Light55a9bad2019-01-29 18:34:09 -0800247 linux_bionic: {
248 enabled: true,
249 multilib: {
250 both: {
251 native_shared_libs: bionic_native_shared_libs,
252 binaries: bionic_binaries_both,
253 }
254 }
255 },
Alex Lighte3521522018-12-06 22:51:18 -0800256 },
Alex Lightda948ce2018-12-06 17:05:41 +0000257}
Jiyong Park1410e9f2019-02-02 04:18:23 +0000258
259python_binary_host {
260 name: "art-apex-tester",
261 srcs: ["art_apex_test.py"],
262 main: "art_apex_test.py",
263 version: {
264 py2: {
265 enabled: false,
266 },
267 py3: {
268 enabled: true,
269 },
270 },
271}
272
273// Genrules so we can run the checker, and empty Java library so that it gets executed.
274
275genrule {
276 name: "art-check-release-apex-gen",
277 srcs: [":com.android.runtime.release"],
278 tools: [
279 "art-apex-tester",
280 "debugfs",
281 ],
282 cmd: "$(location art-apex-tester)"
283 + " --debugfs $(location debugfs)"
284 + " --tmpdir $(genDir)"
285 + " $(in)"
286 + " && touch $(out)",
287 out: ["art-check-release-apex-gen.dummy"],
288}
289cc_prebuilt_binary {
290 name: "art-check-release-apex-gen-fakebin",
291 srcs: [":art-check-release-apex-gen"],
292 host_supported: true,
293 device_supported: false,
294 target: {
295 darwin: {
296 enabled: false, // No python3.
297 },
298 },
299}
300
301genrule {
302 name: "art-check-debug-apex-gen",
303 srcs: [":com.android.runtime.debug"],
304 tools: [
305 "art-apex-tester",
306 "debugfs",
307 ],
308 cmd: "$(location art-apex-tester)"
309 + " --debugfs $(location debugfs)"
310 + " --tmpdir $(genDir)"
311 + " --debug"
312 + " $(in)"
313 + " && touch $(out)",
314 out: ["art-check-debug-apex-gen.dummy"],
315}
316cc_prebuilt_binary {
317 name: "art-check-debug-apex-gen-fakebin",
318 srcs: [":art-check-debug-apex-gen"],
319 host_supported: true,
320 device_supported: false,
321 target: {
322 darwin: {
323 enabled: false, // No python3.
324 },
325 },
326}