Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 1 | // 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). |
| 5 | art_runtime_base_binaries_both = [ |
| 6 | "dalvikvm", |
| 7 | ] |
| 8 | // - Base requirements (binaries for which a 32-bit version is preferred). |
| 9 | art_runtime_base_binaries_prefer32 = [ |
| 10 | "dex2oat", |
| 11 | "dexoptanalyzer", |
| 12 | "profman", |
| 13 | ] |
| 14 | // - Base requirements (libraries). |
| 15 | art_runtime_base_native_shared_libs = [ |
Martin Stjernholm | c2f8b50 | 2019-01-17 14:51:35 +0000 | [diff] [blame] | 16 | "libadbconnection", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 17 | "libart", |
| 18 | "libart-compiler", |
Martin Stjernholm | 84bf698 | 2019-02-05 15:07:57 +0000 | [diff] [blame] | 19 | "libdexfile_external", |
Martin Stjernholm | c2f8b50 | 2019-01-17 14:51:35 +0000 | [diff] [blame] | 20 | "libnativebridge", |
| 21 | "libnativehelper", |
| 22 | "libnativeloader", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 23 | "libopenjdkjvm", |
| 24 | "libopenjdkjvmti", |
Martin Stjernholm | 0c15b82 | 2019-02-14 17:24:19 +0000 | [diff] [blame] | 25 | // 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 Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 31 | ] |
Jiyong Park | 3296fb1 | 2018-12-13 18:32:21 +0900 | [diff] [blame] | 32 | bionic_native_shared_libs = [ |
| 33 | "libc", |
| 34 | "libm", |
| 35 | "libdl", |
| 36 | ] |
Jiyong Park | e2bc9fe | 2018-12-26 11:36:39 +0900 | [diff] [blame] | 37 | bionic_binaries_both = [ |
| 38 | "linker", |
| 39 | ] |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 40 | // - Debug variants (binaries for which a 32-bit version is preferred). |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 41 | art_runtime_debug_binaries_prefer32 = [ |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 42 | "dexoptanalyzerd", |
| 43 | "profmand", |
| 44 | ] |
Alex Light | 572a096 | 2019-01-18 14:48:37 -0800 | [diff] [blame] | 45 | art_runtime_debug_binaries_prefer32_device = [ |
| 46 | "dex2oatd", |
| 47 | ] |
| 48 | art_runtime_debug_binaries_both_host = [ |
| 49 | "dex2oatd", |
| 50 | ] |
| 51 | |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 52 | // - Debug variants (libraries). |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 53 | art_runtime_debug_native_shared_libs = [ |
Martin Stjernholm | c2f8b50 | 2019-01-17 14:51:35 +0000 | [diff] [blame] | 54 | "libadbconnectiond", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 55 | "libartd", |
| 56 | "libartd-compiler", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 57 | "libopenjdkjvmd", |
| 58 | "libopenjdkjvmtid", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 59 | ] |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 60 | libcore_debug_native_shared_libs = [ |
| 61 | "libopenjdkd", |
| 62 | ] |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 63 | |
Neil Fuller | 5ab4a56 | 2018-12-11 20:33:46 +0000 | [diff] [blame] | 64 | // Data files associated with bionic / managed core library APIs. |
| 65 | art_runtime_data_file_prebuilts = [ |
Neil Fuller | a886dab | 2018-12-06 15:12:52 +0000 | [diff] [blame] | 66 | "apex_tz_version", |
| 67 | "apex_tzdata", |
| 68 | "apex_tzlookup.xml", |
Neil Fuller | 5ab4a56 | 2018-12-11 20:33:46 +0000 | [diff] [blame] | 69 | "apex_icu.dat", |
Neil Fuller | a886dab | 2018-12-06 15:12:52 +0000 | [diff] [blame] | 70 | ] |
| 71 | |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 72 | // Modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk. |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 73 | art_tools_common_binaries = [ |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 74 | "dexdiag", |
| 75 | "dexdump", |
| 76 | "dexlist", |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 77 | ] |
| 78 | |
Roland Levillain | e9f0ccc | 2019-01-07 16:45:58 +0000 | [diff] [blame] | 79 | // Device-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk. |
| 80 | art_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 Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 83 | "oatdump", |
| 84 | ] |
| 85 | |
| 86 | // Host-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk. |
Roland Levillain | e9f0ccc | 2019-01-07 16:45:58 +0000 | [diff] [blame] | 87 | art_tools_host_only_binaries = [ |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 88 | // 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 Levillain | e9f0ccc | 2019-01-07 16:45:58 +0000 | [diff] [blame] | 95 | art_tools_device_binaries = art_tools_common_binaries + art_tools_device_only_binaries |
| 96 | art_tools_host_binaries = art_tools_common_binaries + art_tools_host_only_binaries |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 97 | |
Alex Light | 6585ecb | 2019-02-08 14:13:22 -0800 | [diff] [blame] | 98 | // Libraries needed to use com.android.runtime.host for zipapex run-tests |
| 99 | art_runtime_host_run_test_libs = [ |
| 100 | "libartd-disassembler" |
| 101 | ] |
| 102 | |
Roland Levillain | a0b1903 | 2019-02-08 15:59:56 +0000 | [diff] [blame] | 103 | // Core Java libraries. |
| 104 | libcore_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 Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 113 | libcore_native_shared_libs = [ |
Victor Chang | 2f0008a | 2019-01-15 14:10:34 +0000 | [diff] [blame] | 114 | "libandroidicu", |
| 115 | "libexpat", |
| 116 | "libicui18n", |
| 117 | "libicuuc", |
Pete Bentley | 51ffdbe | 2019-01-11 15:25:40 +0000 | [diff] [blame] | 118 | "libjavacore", |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 119 | "libopenjdk", |
Pete Bentley | 51ffdbe | 2019-01-11 15:25:40 +0000 | [diff] [blame] | 120 | "libz", |
Victor Chang | 2f0008a | 2019-01-15 14:10:34 +0000 | [diff] [blame] | 121 | "libziparchive", |
| 122 | ] |
| 123 | |
| 124 | libcore_native_device_only_shared_libs = libcore_native_shared_libs + [ |
| 125 | // TODO(b/122876336): Remove libpac.so once it's migrated to Webview. |
| 126 | // libpac is used by frameworks, not by ART host. |
| 127 | "libpac", |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 128 | ] |
| 129 | |
Alex Light | f7f3152 | 2019-02-01 11:14:41 -0800 | [diff] [blame] | 130 | // Temporary library includes for b/123591866 as all libraries are moved into the main art-apex. |
| 131 | art_runtime_libraries_zipapex = [ |
| 132 | "libnativebridge", |
| 133 | "libnativeloader", |
| 134 | "libnativehelper", |
| 135 | "libcutils", |
| 136 | ] |
| 137 | |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 138 | apex_key { |
| 139 | name: "com.android.runtime.key", |
Jiyong Park | 11a2df3 | 2018-11-22 16:25:08 +0900 | [diff] [blame] | 140 | public_key: "com.android.runtime.avbpubkey", |
| 141 | private_key: "com.android.runtime.pem", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 142 | } |
| 143 | |
Jiyong Park | e961855 | 2019-02-11 10:54:36 +0900 | [diff] [blame] | 144 | android_app_certificate { |
| 145 | name: "com.android.runtime.debug.certificate", |
| 146 | certificate: "com.android.runtime.debug", |
| 147 | } |
| 148 | |
| 149 | android_app_certificate { |
| 150 | name: "com.android.runtime.release.certificate", |
| 151 | certificate: "com.android.runtime.release", |
| 152 | } |
| 153 | |
Roland Levillain | 3be7afe | 2018-12-04 19:35:03 +0000 | [diff] [blame] | 154 | prebuilt_etc { |
| 155 | name: "com.android.runtime.ld.config.txt", |
| 156 | src: "ld.config.txt", |
| 157 | filename: "ld.config.txt", |
| 158 | installable: false, |
| 159 | } |
| 160 | |
Andreas Gampe | e55ea98 | 2019-02-26 09:11:20 -0800 | [diff] [blame] | 161 | apex_defaults { |
| 162 | name: "com.android.runtime-defaults", |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 163 | compile_multilib: "both", |
| 164 | manifest: "manifest.json", |
Roland Levillain | a0b1903 | 2019-02-08 15:59:56 +0000 | [diff] [blame] | 165 | java_libs: libcore_java_libs, |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 166 | native_shared_libs: art_runtime_base_native_shared_libs |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 167 | + bionic_native_shared_libs |
Victor Chang | 2f0008a | 2019-01-15 14:10:34 +0000 | [diff] [blame] | 168 | + libcore_native_device_only_shared_libs, |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 169 | multilib: { |
| 170 | both: { |
Jiyong Park | e2bc9fe | 2018-12-26 11:36:39 +0900 | [diff] [blame] | 171 | binaries: art_runtime_base_binaries_both |
| 172 | + bionic_binaries_both, |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 173 | }, |
| 174 | prefer32: { |
| 175 | binaries: art_runtime_base_binaries_prefer32, |
| 176 | }, |
| 177 | first: { |
| 178 | binaries: [], |
| 179 | } |
| 180 | }, |
Andreas Gampe | 31782c1 | 2019-02-06 09:47:25 -0800 | [diff] [blame] | 181 | binaries: [ |
Andreas Gampe | 5bb525a | 2019-02-19 12:26:35 -0800 | [diff] [blame^] | 182 | "art_postinstall_hook", |
Andreas Gampe | 31782c1 | 2019-02-06 09:47:25 -0800 | [diff] [blame] | 183 | "art_preinstall_hook", |
| 184 | "art_preinstall_hook_boot", |
| 185 | "art_prepostinstall_utils", |
| 186 | ], |
Neil Fuller | 5ab4a56 | 2018-12-11 20:33:46 +0000 | [diff] [blame] | 187 | prebuilts: art_runtime_data_file_prebuilts |
Neil Fuller | a886dab | 2018-12-06 15:12:52 +0000 | [diff] [blame] | 188 | + ["com.android.runtime.ld.config.txt"], |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 189 | key: "com.android.runtime.key", |
Andreas Gampe | e55ea98 | 2019-02-26 09:11:20 -0800 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | // Release version of the Runtime APEX module (not containing debug |
| 193 | // variants nor tools), included in user builds. Also used for |
| 194 | // storage-constrained devices in userdebug and eng builds. |
| 195 | apex { |
| 196 | name: "com.android.runtime.release", |
| 197 | defaults: ["com.android.runtime-defaults"], |
Jiyong Park | e961855 | 2019-02-11 10:54:36 +0900 | [diff] [blame] | 198 | certificate: ":com.android.runtime.release.certificate", |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | // "Debug" version of the Runtime APEX module (containing both release and |
| 202 | // debug variants, as well as additional tools), included in userdebug and |
| 203 | // eng build. |
| 204 | apex { |
| 205 | name: "com.android.runtime.debug", |
Andreas Gampe | e55ea98 | 2019-02-26 09:11:20 -0800 | [diff] [blame] | 206 | defaults: ["com.android.runtime-defaults"], |
| 207 | native_shared_libs: art_runtime_debug_native_shared_libs |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 208 | + libcore_debug_native_shared_libs, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 209 | multilib: { |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 210 | prefer32: { |
Andreas Gampe | e55ea98 | 2019-02-26 09:11:20 -0800 | [diff] [blame] | 211 | binaries: art_runtime_debug_binaries_prefer32 |
Alex Light | 572a096 | 2019-01-18 14:48:37 -0800 | [diff] [blame] | 212 | + art_runtime_debug_binaries_prefer32_device, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 213 | }, |
| 214 | first: { |
Roland Levillain | e9f0ccc | 2019-01-07 16:45:58 +0000 | [diff] [blame] | 215 | binaries: art_tools_device_binaries, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 216 | } |
| 217 | }, |
Jiyong Park | e961855 | 2019-02-11 10:54:36 +0900 | [diff] [blame] | 218 | certificate: ":com.android.runtime.debug.certificate", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 219 | } |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 220 | |
| 221 | // TODO: Do this better. art_apex will disable host builds when |
| 222 | // HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug |
| 223 | // because binaries have different multilib classes and 'multilib: {}' isn't |
| 224 | // supported by target: { ... }. |
| 225 | // See b/120617876 for more information. |
Alex Light | 0239f2f | 2019-02-07 13:38:50 -0800 | [diff] [blame] | 226 | art_apex_test { |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 227 | name: "com.android.runtime.host", |
| 228 | compile_multilib: "both", |
| 229 | payload_type: "zip", |
| 230 | host_supported: true, |
| 231 | device_supported: false, |
| 232 | manifest: "manifest.json", |
Roland Levillain | a0b1903 | 2019-02-08 15:59:56 +0000 | [diff] [blame] | 233 | java_libs: libcore_java_libs, |
Alex Light | 55a9bad | 2019-01-29 18:34:09 -0800 | [diff] [blame] | 234 | ignore_system_library_special_case: true, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 235 | native_shared_libs: art_runtime_base_native_shared_libs |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 236 | + art_runtime_debug_native_shared_libs |
| 237 | + libcore_native_shared_libs |
Alex Light | f7f3152 | 2019-02-01 11:14:41 -0800 | [diff] [blame] | 238 | + libcore_debug_native_shared_libs |
Alex Light | 6585ecb | 2019-02-08 14:13:22 -0800 | [diff] [blame] | 239 | + art_runtime_libraries_zipapex |
| 240 | + art_runtime_host_run_test_libs, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 241 | multilib: { |
| 242 | both: { |
Alex Light | 572a096 | 2019-01-18 14:48:37 -0800 | [diff] [blame] | 243 | binaries: art_runtime_base_binaries_both |
| 244 | + art_runtime_debug_binaries_both_host, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 245 | }, |
| 246 | first: { |
Roland Levillain | e9f0ccc | 2019-01-07 16:45:58 +0000 | [diff] [blame] | 247 | binaries: art_tools_host_binaries |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 248 | + art_runtime_base_binaries_prefer32 |
| 249 | + art_runtime_debug_binaries_prefer32, |
| 250 | } |
| 251 | }, |
| 252 | key: "com.android.runtime.key", |
Alex Light | e352152 | 2018-12-06 22:51:18 -0800 | [diff] [blame] | 253 | target: { |
| 254 | darwin: { |
| 255 | enabled: false, |
| 256 | }, |
Alex Light | 55a9bad | 2019-01-29 18:34:09 -0800 | [diff] [blame] | 257 | linux_bionic: { |
| 258 | enabled: true, |
| 259 | multilib: { |
| 260 | both: { |
| 261 | native_shared_libs: bionic_native_shared_libs, |
| 262 | binaries: bionic_binaries_both, |
| 263 | } |
| 264 | } |
| 265 | }, |
Alex Light | e352152 | 2018-12-06 22:51:18 -0800 | [diff] [blame] | 266 | }, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 267 | } |
Jiyong Park | 1410e9f | 2019-02-02 04:18:23 +0000 | [diff] [blame] | 268 | |
| 269 | python_binary_host { |
| 270 | name: "art-apex-tester", |
| 271 | srcs: ["art_apex_test.py"], |
| 272 | main: "art_apex_test.py", |
| 273 | version: { |
| 274 | py2: { |
| 275 | enabled: false, |
| 276 | }, |
| 277 | py3: { |
| 278 | enabled: true, |
| 279 | }, |
| 280 | }, |
| 281 | } |
| 282 | |
| 283 | // Genrules so we can run the checker, and empty Java library so that it gets executed. |
| 284 | |
| 285 | genrule { |
| 286 | name: "art-check-release-apex-gen", |
| 287 | srcs: [":com.android.runtime.release"], |
| 288 | tools: [ |
| 289 | "art-apex-tester", |
| 290 | "debugfs", |
| 291 | ], |
| 292 | cmd: "$(location art-apex-tester)" |
| 293 | + " --debugfs $(location debugfs)" |
| 294 | + " --tmpdir $(genDir)" |
| 295 | + " $(in)" |
| 296 | + " && touch $(out)", |
| 297 | out: ["art-check-release-apex-gen.dummy"], |
| 298 | } |
| 299 | cc_prebuilt_binary { |
| 300 | name: "art-check-release-apex-gen-fakebin", |
| 301 | srcs: [":art-check-release-apex-gen"], |
| 302 | host_supported: true, |
| 303 | device_supported: false, |
| 304 | target: { |
| 305 | darwin: { |
| 306 | enabled: false, // No python3. |
| 307 | }, |
| 308 | }, |
| 309 | } |
| 310 | |
| 311 | genrule { |
| 312 | name: "art-check-debug-apex-gen", |
| 313 | srcs: [":com.android.runtime.debug"], |
| 314 | tools: [ |
| 315 | "art-apex-tester", |
| 316 | "debugfs", |
| 317 | ], |
| 318 | cmd: "$(location art-apex-tester)" |
| 319 | + " --debugfs $(location debugfs)" |
| 320 | + " --tmpdir $(genDir)" |
| 321 | + " --debug" |
| 322 | + " $(in)" |
| 323 | + " && touch $(out)", |
| 324 | out: ["art-check-debug-apex-gen.dummy"], |
| 325 | } |
| 326 | cc_prebuilt_binary { |
| 327 | name: "art-check-debug-apex-gen-fakebin", |
| 328 | srcs: [":art-check-debug-apex-gen"], |
| 329 | host_supported: true, |
| 330 | device_supported: false, |
| 331 | target: { |
| 332 | darwin: { |
| 333 | enabled: false, // No python3. |
| 334 | }, |
| 335 | }, |
| 336 | } |
Andreas Gampe | 31782c1 | 2019-02-06 09:47:25 -0800 | [diff] [blame] | 337 | |
| 338 | // Pre-install scripts. |
| 339 | |
| 340 | sh_binary { |
| 341 | name: "art_preinstall_hook", |
| 342 | src: "art_preinstall_hook.sh", |
| 343 | } |
| 344 | sh_binary { |
| 345 | name: "art_preinstall_hook_boot", |
| 346 | src: "art_preinstall_hook_boot.sh", |
| 347 | } |
| 348 | sh_binary { |
| 349 | name: "art_prepostinstall_utils", |
| 350 | src: "art_prepostinstall_utils.sh", |
| 351 | } |
Andreas Gampe | 5bb525a | 2019-02-19 12:26:35 -0800 | [diff] [blame^] | 352 | sh_binary { |
| 353 | name: "art_postinstall_hook", |
| 354 | src: "art_postinstall_hook.sh", |
| 355 | } |