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