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