blob: 9abf3fecf44df0cdb2c03831ba366951721fdf2f [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 = [
16 "libart",
17 "libart-compiler",
18 "libopenjdkjvm",
19 "libopenjdkjvmti",
Martin Stjernholm7e7ab232019-02-01 12:58:08 +000020 "libadbconnection",
Roland Levillain38a938e2018-09-21 10:55:51 +010021]
Jiyong Park3296fb12018-12-13 18:32:21 +090022bionic_native_shared_libs = [
23 "libc",
24 "libm",
25 "libdl",
26]
Jiyong Parke2bc9fe2018-12-26 11:36:39 +090027bionic_binaries_both = [
28 "linker",
29]
Roland Levillain38a938e2018-09-21 10:55:51 +010030// - Debug variants (binaries for which a 32-bit version is preferred).
Roland Levillain38a938e2018-09-21 10:55:51 +010031art_runtime_debug_binaries_prefer32 = [
Roland Levillain38a938e2018-09-21 10:55:51 +010032 "dexoptanalyzerd",
33 "profmand",
34]
Alex Light572a0962019-01-18 14:48:37 -080035art_runtime_debug_binaries_prefer32_device = [
36 "dex2oatd",
37]
38art_runtime_debug_binaries_both_host = [
39 "dex2oatd",
40]
41
Roland Levillaincb82d092018-11-02 18:50:15 +000042// - Debug variants (libraries).
Roland Levillain38a938e2018-09-21 10:55:51 +010043art_runtime_debug_native_shared_libs = [
44 "libartd",
45 "libartd-compiler",
Roland Levillain38a938e2018-09-21 10:55:51 +010046 "libopenjdkjvmd",
47 "libopenjdkjvmtid",
Martin Stjernholm7e7ab232019-02-01 12:58:08 +000048 "libadbconnectiond",
Roland Levillain38a938e2018-09-21 10:55:51 +010049]
Roland Levillaincb82d092018-11-02 18:50:15 +000050libcore_debug_native_shared_libs = [
51 "libopenjdkd",
52]
Roland Levillain38a938e2018-09-21 10:55:51 +010053
Neil Fuller5ab4a562018-12-11 20:33:46 +000054// Data files associated with bionic / managed core library APIs.
55art_runtime_data_file_prebuilts = [
Neil Fullera886dab2018-12-06 15:12:52 +000056 "apex_tz_version",
57 "apex_tzdata",
58 "apex_tzlookup.xml",
Neil Fuller5ab4a562018-12-11 20:33:46 +000059 "apex_icu.dat",
Neil Fullera886dab2018-12-06 15:12:52 +000060]
61
Roland Levillain38a938e2018-09-21 10:55:51 +010062// Modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
Alex Lightda948ce2018-12-06 17:05:41 +000063art_tools_common_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010064 "dexdiag",
65 "dexdump",
66 "dexlist",
Alex Lightda948ce2018-12-06 17:05:41 +000067]
68
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000069// Device-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
70art_tools_device_only_binaries = [
71 // oatdump cannot link with host linux_bionic due to not using clang lld;
72 // TODO: Make it work with clang lld.
Roland Levillain38a938e2018-09-21 10:55:51 +010073 "oatdump",
74]
75
76// Host-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk.
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000077art_tools_host_only_binaries = [
Roland Levillain38a938e2018-09-21 10:55:51 +010078 // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk
79 // (same issue as for `libart_fake` above).
80 //"ahat",
81 "hprof-conv",
82 // ...
83]
84
Roland Levillaine9f0ccc2019-01-07 16:45:58 +000085art_tools_device_binaries = art_tools_common_binaries + art_tools_device_only_binaries
86art_tools_host_binaries = art_tools_common_binaries + art_tools_host_only_binaries
Alex Lightda948ce2018-12-06 17:05:41 +000087
Alex Light6585ecb2019-02-08 14:13:22 -080088// Libraries needed to use com.android.runtime.host for zipapex run-tests
89art_runtime_host_run_test_libs = [
90 "libartd-disassembler"
91]
92
Pete Bentley51ffdbe2019-01-11 15:25:40 +000093// Libcore native libraries.
Roland Levillaincb82d092018-11-02 18:50:15 +000094libcore_native_shared_libs = [
Pete Bentley51ffdbe2019-01-11 15:25:40 +000095 "libjavacore",
Roland Levillaincb82d092018-11-02 18:50:15 +000096 "libopenjdk",
Pete Bentley51ffdbe2019-01-11 15:25:40 +000097 "libexpat",
98 "libz",
99 "libziparchive"
Roland Levillaincb82d092018-11-02 18:50:15 +0000100]
101
Nicolas Geoffraycc64d082019-01-25 09:43:18 +0000102// Java libraries
103libcore_target_java_libs = [
104 "core-oj",
105 "core-libart",
106 "okhttp",
107 "bouncycastle",
108 "apache-xml",
109]
110
Alex Lightf7f31522019-02-01 11:14:41 -0800111// Temporary library includes for b/123591866 as all libraries are moved into the main art-apex.
112art_runtime_libraries_zipapex = [
113 "libnativebridge",
114 "libnativeloader",
115 "libnativehelper",
116 "libcutils",
117]
118
Roland Levillain38a938e2018-09-21 10:55:51 +0100119apex_key {
120 name: "com.android.runtime.key",
Jiyong Park11a2df32018-11-22 16:25:08 +0900121 public_key: "com.android.runtime.avbpubkey",
122 private_key: "com.android.runtime.pem",
Roland Levillain38a938e2018-09-21 10:55:51 +0100123}
124
Roland Levillain3be7afe2018-12-04 19:35:03 +0000125prebuilt_etc {
126 name: "com.android.runtime.ld.config.txt",
127 src: "ld.config.txt",
128 filename: "ld.config.txt",
129 installable: false,
130}
131
Roland Levillain53058802018-11-14 17:32:18 +0000132// TODO: Introduce `apex_defaults` to factor common parts of `apex`
133// module definitions below?
134
135// Release version of the Runtime APEX module (not containing debug
136// variants nor tools), included in user builds. Also used for
137// storage-constrained devices in userdebug and eng builds.
Roland Levillain38a938e2018-09-21 10:55:51 +0100138apex {
Roland Levillain53058802018-11-14 17:32:18 +0000139 name: "com.android.runtime.release",
140 compile_multilib: "both",
141 manifest: "manifest.json",
Nicolas Geoffraycc64d082019-01-25 09:43:18 +0000142 java_libs: libcore_target_java_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000143 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000144 + bionic_native_shared_libs
145 + libcore_native_shared_libs,
Roland Levillain53058802018-11-14 17:32:18 +0000146 multilib: {
147 both: {
148 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
149 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Jiyong Parke2bc9fe2018-12-26 11:36:39 +0900150 binaries: art_runtime_base_binaries_both
151 + bionic_binaries_both,
Roland Levillain53058802018-11-14 17:32:18 +0000152 },
153 prefer32: {
154 binaries: art_runtime_base_binaries_prefer32,
155 },
156 first: {
157 binaries: [],
158 }
159 },
Neil Fuller5ab4a562018-12-11 20:33:46 +0000160 prebuilts: art_runtime_data_file_prebuilts
Neil Fullera886dab2018-12-06 15:12:52 +0000161 + ["com.android.runtime.ld.config.txt"],
Roland Levillain53058802018-11-14 17:32:18 +0000162 key: "com.android.runtime.key",
Roland Levillain53058802018-11-14 17:32:18 +0000163}
164
165// "Debug" version of the Runtime APEX module (containing both release and
166// debug variants, as well as additional tools), included in userdebug and
167// eng build.
168apex {
169 name: "com.android.runtime.debug",
Roland Levillain38a938e2018-09-21 10:55:51 +0100170 compile_multilib: "both",
171 manifest: "manifest.json",
Nicolas Geoffraycc64d082019-01-25 09:43:18 +0000172 java_libs: libcore_target_java_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100173 native_shared_libs: art_runtime_base_native_shared_libs
Jiyong Park3296fb12018-12-13 18:32:21 +0900174 + art_runtime_debug_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000175 + bionic_native_shared_libs
176 + libcore_native_shared_libs
177 + libcore_debug_native_shared_libs,
Roland Levillain38a938e2018-09-21 10:55:51 +0100178 multilib: {
179 both: {
180 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
181 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Jiyong Parke2bc9fe2018-12-26 11:36:39 +0900182 binaries: art_runtime_base_binaries_both
183 + bionic_binaries_both,
Roland Levillain38a938e2018-09-21 10:55:51 +0100184 },
185 prefer32: {
186 binaries: art_runtime_base_binaries_prefer32
Alex Light572a0962019-01-18 14:48:37 -0800187 + art_runtime_debug_binaries_prefer32
188 + art_runtime_debug_binaries_prefer32_device,
Roland Levillain38a938e2018-09-21 10:55:51 +0100189 },
190 first: {
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000191 binaries: art_tools_device_binaries,
Roland Levillain38a938e2018-09-21 10:55:51 +0100192 }
193 },
Neil Fuller5ab4a562018-12-11 20:33:46 +0000194 prebuilts: art_runtime_data_file_prebuilts
Neil Fullera886dab2018-12-06 15:12:52 +0000195 + ["com.android.runtime.ld.config.txt"],
Roland Levillain38a938e2018-09-21 10:55:51 +0100196 key: "com.android.runtime.key",
Roland Levillain38a938e2018-09-21 10:55:51 +0100197}
Alex Lightda948ce2018-12-06 17:05:41 +0000198
199// TODO: Do this better. art_apex will disable host builds when
200// HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug
201// because binaries have different multilib classes and 'multilib: {}' isn't
202// supported by target: { ... }.
203// See b/120617876 for more information.
Alex Light0239f2f2019-02-07 13:38:50 -0800204art_apex_test {
Alex Lightda948ce2018-12-06 17:05:41 +0000205 name: "com.android.runtime.host",
206 compile_multilib: "both",
207 payload_type: "zip",
208 host_supported: true,
209 device_supported: false,
210 manifest: "manifest.json",
Alex Lighta6ea6022019-01-29 11:02:03 -0800211 java_libs: libcore_target_java_libs,
Alex Light55a9bad2019-01-29 18:34:09 -0800212 ignore_system_library_special_case: true,
Alex Lightda948ce2018-12-06 17:05:41 +0000213 native_shared_libs: art_runtime_base_native_shared_libs
Roland Levillaincb82d092018-11-02 18:50:15 +0000214 + art_runtime_debug_native_shared_libs
215 + libcore_native_shared_libs
Alex Lightf7f31522019-02-01 11:14:41 -0800216 + libcore_debug_native_shared_libs
Alex Light6585ecb2019-02-08 14:13:22 -0800217 + art_runtime_libraries_zipapex
218 + art_runtime_host_run_test_libs,
Alex Lightda948ce2018-12-06 17:05:41 +0000219 multilib: {
220 both: {
221 // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64`
222 // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp).
Alex Light572a0962019-01-18 14:48:37 -0800223 binaries: art_runtime_base_binaries_both
224 + art_runtime_debug_binaries_both_host,
Alex Lightda948ce2018-12-06 17:05:41 +0000225 },
226 first: {
Roland Levillaine9f0ccc2019-01-07 16:45:58 +0000227 binaries: art_tools_host_binaries
Alex Lightda948ce2018-12-06 17:05:41 +0000228 + art_runtime_base_binaries_prefer32
229 + art_runtime_debug_binaries_prefer32,
230 }
231 },
232 key: "com.android.runtime.key",
Alex Lighte3521522018-12-06 22:51:18 -0800233 target: {
234 darwin: {
235 enabled: false,
236 },
Alex Light55a9bad2019-01-29 18:34:09 -0800237 linux_bionic: {
238 enabled: true,
239 multilib: {
240 both: {
241 native_shared_libs: bionic_native_shared_libs,
242 binaries: bionic_binaries_both,
243 }
244 }
245 },
Alex Lighte3521522018-12-06 22:51:18 -0800246 },
Alex Lightda948ce2018-12-06 17:05:41 +0000247}
Jiyong Park1410e9f2019-02-02 04:18:23 +0000248
249python_binary_host {
250 name: "art-apex-tester",
251 srcs: ["art_apex_test.py"],
252 main: "art_apex_test.py",
253 version: {
254 py2: {
255 enabled: false,
256 },
257 py3: {
258 enabled: true,
259 },
260 },
261}
262
263// Genrules so we can run the checker, and empty Java library so that it gets executed.
264
265genrule {
266 name: "art-check-release-apex-gen",
267 srcs: [":com.android.runtime.release"],
268 tools: [
269 "art-apex-tester",
270 "debugfs",
271 ],
272 cmd: "$(location art-apex-tester)"
273 + " --debugfs $(location debugfs)"
274 + " --tmpdir $(genDir)"
275 + " $(in)"
276 + " && touch $(out)",
277 out: ["art-check-release-apex-gen.dummy"],
278}
279cc_prebuilt_binary {
280 name: "art-check-release-apex-gen-fakebin",
281 srcs: [":art-check-release-apex-gen"],
282 host_supported: true,
283 device_supported: false,
284 target: {
285 darwin: {
286 enabled: false, // No python3.
287 },
288 },
289}
290
291genrule {
292 name: "art-check-debug-apex-gen",
293 srcs: [":com.android.runtime.debug"],
294 tools: [
295 "art-apex-tester",
296 "debugfs",
297 ],
298 cmd: "$(location art-apex-tester)"
299 + " --debugfs $(location debugfs)"
300 + " --tmpdir $(genDir)"
301 + " --debug"
302 + " $(in)"
303 + " && touch $(out)",
304 out: ["art-check-debug-apex-gen.dummy"],
305}
306cc_prebuilt_binary {
307 name: "art-check-debug-apex-gen-fakebin",
308 srcs: [":art-check-debug-apex-gen"],
309 host_supported: true,
310 device_supported: false,
311 target: {
312 darwin: {
313 enabled: false, // No python3.
314 },
315 },
316}