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