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 = [ |
Pete Bentley | 51ffdbe | 2019-01-11 15:25:40 +0000 | [diff] [blame] | 114 | "libjavacore", |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 115 | "libopenjdk", |
Pete Bentley | 51ffdbe | 2019-01-11 15:25:40 +0000 | [diff] [blame] | 116 | "libexpat", |
| 117 | "libz", |
| 118 | "libziparchive" |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 119 | ] |
| 120 | |
Alex Light | f7f3152 | 2019-02-01 11:14:41 -0800 | [diff] [blame] | 121 | // Temporary library includes for b/123591866 as all libraries are moved into the main art-apex. |
| 122 | art_runtime_libraries_zipapex = [ |
| 123 | "libnativebridge", |
| 124 | "libnativeloader", |
| 125 | "libnativehelper", |
| 126 | "libcutils", |
| 127 | ] |
| 128 | |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 129 | apex_key { |
| 130 | name: "com.android.runtime.key", |
Jiyong Park | 11a2df3 | 2018-11-22 16:25:08 +0900 | [diff] [blame] | 131 | public_key: "com.android.runtime.avbpubkey", |
| 132 | private_key: "com.android.runtime.pem", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 133 | } |
| 134 | |
Roland Levillain | 3be7afe | 2018-12-04 19:35:03 +0000 | [diff] [blame] | 135 | prebuilt_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 Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 142 | // 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 Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 148 | apex { |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 149 | name: "com.android.runtime.release", |
| 150 | compile_multilib: "both", |
| 151 | manifest: "manifest.json", |
Roland Levillain | a0b1903 | 2019-02-08 15:59:56 +0000 | [diff] [blame] | 152 | java_libs: libcore_java_libs, |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 153 | native_shared_libs: art_runtime_base_native_shared_libs |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 154 | + bionic_native_shared_libs |
| 155 | + libcore_native_shared_libs, |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 156 | 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 Park | e2bc9fe | 2018-12-26 11:36:39 +0900 | [diff] [blame] | 160 | binaries: art_runtime_base_binaries_both |
| 161 | + bionic_binaries_both, |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 162 | }, |
| 163 | prefer32: { |
| 164 | binaries: art_runtime_base_binaries_prefer32, |
| 165 | }, |
| 166 | first: { |
| 167 | binaries: [], |
| 168 | } |
| 169 | }, |
Neil Fuller | 5ab4a56 | 2018-12-11 20:33:46 +0000 | [diff] [blame] | 170 | prebuilts: art_runtime_data_file_prebuilts |
Neil Fuller | a886dab | 2018-12-06 15:12:52 +0000 | [diff] [blame] | 171 | + ["com.android.runtime.ld.config.txt"], |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 172 | key: "com.android.runtime.key", |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 173 | } |
| 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. |
| 178 | apex { |
| 179 | name: "com.android.runtime.debug", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 180 | compile_multilib: "both", |
| 181 | manifest: "manifest.json", |
Roland Levillain | a0b1903 | 2019-02-08 15:59:56 +0000 | [diff] [blame] | 182 | java_libs: libcore_java_libs, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 183 | native_shared_libs: art_runtime_base_native_shared_libs |
Jiyong Park | 3296fb1 | 2018-12-13 18:32:21 +0900 | [diff] [blame] | 184 | + art_runtime_debug_native_shared_libs |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 185 | + bionic_native_shared_libs |
| 186 | + libcore_native_shared_libs |
| 187 | + libcore_debug_native_shared_libs, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 188 | 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 Park | e2bc9fe | 2018-12-26 11:36:39 +0900 | [diff] [blame] | 192 | binaries: art_runtime_base_binaries_both |
| 193 | + bionic_binaries_both, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 194 | }, |
| 195 | prefer32: { |
| 196 | binaries: art_runtime_base_binaries_prefer32 |
Alex Light | 572a096 | 2019-01-18 14:48:37 -0800 | [diff] [blame] | 197 | + art_runtime_debug_binaries_prefer32 |
| 198 | + art_runtime_debug_binaries_prefer32_device, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 199 | }, |
| 200 | first: { |
Roland Levillain | e9f0ccc | 2019-01-07 16:45:58 +0000 | [diff] [blame] | 201 | binaries: art_tools_device_binaries, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 202 | } |
| 203 | }, |
Neil Fuller | 5ab4a56 | 2018-12-11 20:33:46 +0000 | [diff] [blame] | 204 | prebuilts: art_runtime_data_file_prebuilts |
Neil Fuller | a886dab | 2018-12-06 15:12:52 +0000 | [diff] [blame] | 205 | + ["com.android.runtime.ld.config.txt"], |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 206 | key: "com.android.runtime.key", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 207 | } |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 208 | |
| 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 Light | 0239f2f | 2019-02-07 13:38:50 -0800 | [diff] [blame] | 214 | art_apex_test { |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 215 | 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 Levillain | a0b1903 | 2019-02-08 15:59:56 +0000 | [diff] [blame] | 221 | java_libs: libcore_java_libs, |
Alex Light | 55a9bad | 2019-01-29 18:34:09 -0800 | [diff] [blame] | 222 | ignore_system_library_special_case: true, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 223 | native_shared_libs: art_runtime_base_native_shared_libs |
Roland Levillain | cb82d09 | 2018-11-02 18:50:15 +0000 | [diff] [blame] | 224 | + art_runtime_debug_native_shared_libs |
| 225 | + libcore_native_shared_libs |
Alex Light | f7f3152 | 2019-02-01 11:14:41 -0800 | [diff] [blame] | 226 | + libcore_debug_native_shared_libs |
Alex Light | 6585ecb | 2019-02-08 14:13:22 -0800 | [diff] [blame] | 227 | + art_runtime_libraries_zipapex |
| 228 | + art_runtime_host_run_test_libs, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 229 | 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 Light | 572a096 | 2019-01-18 14:48:37 -0800 | [diff] [blame] | 233 | binaries: art_runtime_base_binaries_both |
| 234 | + art_runtime_debug_binaries_both_host, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 235 | }, |
| 236 | first: { |
Roland Levillain | e9f0ccc | 2019-01-07 16:45:58 +0000 | [diff] [blame] | 237 | binaries: art_tools_host_binaries |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 238 | + art_runtime_base_binaries_prefer32 |
| 239 | + art_runtime_debug_binaries_prefer32, |
| 240 | } |
| 241 | }, |
| 242 | key: "com.android.runtime.key", |
Alex Light | e352152 | 2018-12-06 22:51:18 -0800 | [diff] [blame] | 243 | target: { |
| 244 | darwin: { |
| 245 | enabled: false, |
| 246 | }, |
Alex Light | 55a9bad | 2019-01-29 18:34:09 -0800 | [diff] [blame] | 247 | 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 Light | e352152 | 2018-12-06 22:51:18 -0800 | [diff] [blame] | 256 | }, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 257 | } |
Jiyong Park | 1410e9f | 2019-02-02 04:18:23 +0000 | [diff] [blame] | 258 | |
| 259 | python_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 | |
| 275 | genrule { |
| 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 | } |
| 289 | cc_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 | |
| 301 | genrule { |
| 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 | } |
| 316 | cc_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 | } |