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", |
| 20 | "libadbconnection", |
| 21 | ] |
| 22 | // - Fake library that avoids namespace issues and gives some warnings for nosy apps. |
| 23 | art_runtime_fake_native_shared_libs = [ |
| 24 | // FIXME: Does not work as-is, because `libart_fake` is defined in libart_fake/Android.mk, |
| 25 | // and because a module defined in a Blueprint file cannot depend on a module defined in a |
| 26 | // Makefile. To support `libart_fake` as a dependency of this APEX module, we can either |
| 27 | // (probably in that order of preference): |
| 28 | // a. translate that logic into Blueprint; or |
| 29 | // b. write the whole Android Runtime APEX generation logic in Android.mk; or |
| 30 | // c. introduce an `art_apex` module type extending the `apex` module type and write the |
| 31 | // corresponding Go logic to handle this extra dependency. |
| 32 | //"libart_fake", |
| 33 | ] |
| 34 | // - Debug variants (binaries for which a 32-bit version is preferred). |
| 35 | // FIXME: These modules are optional (the built product can decide to include them or not). |
| 36 | // Should they be moved to another APEX file? |
| 37 | art_runtime_debug_binaries_prefer32 = [ |
| 38 | "dex2oatd", |
| 39 | "dexoptanalyzerd", |
| 40 | "profmand", |
| 41 | ] |
| 42 | art_runtime_debug_native_shared_libs = [ |
| 43 | "libartd", |
| 44 | "libartd-compiler", |
| 45 | "libopenjdkd", |
| 46 | "libopenjdkjvmd", |
| 47 | "libopenjdkjvmtid", |
| 48 | "libadbconnectiond", |
| 49 | ] |
| 50 | |
| 51 | // 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] | 52 | art_tools_common_binaries = [ |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 53 | "dexdiag", |
| 54 | "dexdump", |
| 55 | "dexlist", |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 56 | ] |
| 57 | |
| 58 | art_tools_device_binaries = [ |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 59 | "oatdump", |
| 60 | ] |
| 61 | |
| 62 | // Host-only modules listed in LOCAL_REQUIRED_MODULES for module art-tools in art/Android.mk. |
| 63 | // TODO: Include these modules in the future "host APEX". |
| 64 | art_tools_host_binaries = [ |
| 65 | // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk |
| 66 | // (same issue as for `libart_fake` above). |
| 67 | //"ahat", |
| 68 | "hprof-conv", |
| 69 | // ... |
| 70 | ] |
| 71 | |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 72 | art_tools_binaries = art_tools_common_binaries + art_tools_device_binaries |
| 73 | |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 74 | apex_key { |
| 75 | name: "com.android.runtime.key", |
Jiyong Park | 11a2df3 | 2018-11-22 16:25:08 +0900 | [diff] [blame] | 76 | public_key: "com.android.runtime.avbpubkey", |
| 77 | private_key: "com.android.runtime.pem", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 78 | } |
| 79 | |
Roland Levillain | 3be7afe | 2018-12-04 19:35:03 +0000 | [diff] [blame] | 80 | prebuilt_etc { |
| 81 | name: "com.android.runtime.ld.config.txt", |
| 82 | src: "ld.config.txt", |
| 83 | filename: "ld.config.txt", |
| 84 | installable: false, |
| 85 | } |
| 86 | |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 87 | // TODO: Introduce `apex_defaults` to factor common parts of `apex` |
| 88 | // module definitions below? |
| 89 | |
| 90 | // Release version of the Runtime APEX module (not containing debug |
| 91 | // variants nor tools), included in user builds. Also used for |
| 92 | // storage-constrained devices in userdebug and eng builds. |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 93 | apex { |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 94 | name: "com.android.runtime.release", |
| 95 | compile_multilib: "both", |
| 96 | manifest: "manifest.json", |
| 97 | native_shared_libs: art_runtime_base_native_shared_libs |
| 98 | + art_runtime_fake_native_shared_libs, |
| 99 | multilib: { |
| 100 | both: { |
| 101 | // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64` |
| 102 | // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp). |
| 103 | binaries: art_runtime_base_binaries_both, |
| 104 | }, |
| 105 | prefer32: { |
| 106 | binaries: art_runtime_base_binaries_prefer32, |
| 107 | }, |
| 108 | first: { |
| 109 | binaries: [], |
| 110 | } |
| 111 | }, |
Roland Levillain | 3be7afe | 2018-12-04 19:35:03 +0000 | [diff] [blame] | 112 | prebuilts: ["com.android.runtime.ld.config.txt"], |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 113 | key: "com.android.runtime.key", |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | // "Debug" version of the Runtime APEX module (containing both release and |
| 117 | // debug variants, as well as additional tools), included in userdebug and |
| 118 | // eng build. |
| 119 | apex { |
| 120 | name: "com.android.runtime.debug", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 121 | compile_multilib: "both", |
| 122 | manifest: "manifest.json", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 123 | native_shared_libs: art_runtime_base_native_shared_libs |
| 124 | + art_runtime_fake_native_shared_libs |
| 125 | + art_runtime_debug_native_shared_libs, |
| 126 | multilib: { |
| 127 | both: { |
| 128 | // TODO: Add logic to create a `dalvikvm` symlink to `dalvikvm32` or `dalvikvm64` |
| 129 | // (see `symlink_preferred_arch` in art/dalvikvm/Android.bp). |
| 130 | binaries: art_runtime_base_binaries_both, |
| 131 | }, |
| 132 | prefer32: { |
| 133 | binaries: art_runtime_base_binaries_prefer32 |
Roland Levillain | 5305880 | 2018-11-14 17:32:18 +0000 | [diff] [blame] | 134 | + art_runtime_debug_binaries_prefer32, |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 135 | }, |
| 136 | first: { |
| 137 | binaries: art_tools_binaries, |
| 138 | } |
| 139 | }, |
Roland Levillain | 3be7afe | 2018-12-04 19:35:03 +0000 | [diff] [blame] | 140 | prebuilts: ["com.android.runtime.ld.config.txt"], |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 141 | key: "com.android.runtime.key", |
Roland Levillain | 38a938e | 2018-09-21 10:55:51 +0100 | [diff] [blame] | 142 | } |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 143 | |
| 144 | // TODO: Do this better. art_apex will disable host builds when |
| 145 | // HOST_PREFER_32_BIT is set. We cannot simply use com.android.runtime.debug |
| 146 | // because binaries have different multilib classes and 'multilib: {}' isn't |
| 147 | // supported by target: { ... }. |
| 148 | // See b/120617876 for more information. |
| 149 | art_apex { |
| 150 | name: "com.android.runtime.host", |
| 151 | compile_multilib: "both", |
| 152 | payload_type: "zip", |
| 153 | host_supported: true, |
| 154 | device_supported: false, |
| 155 | manifest: "manifest.json", |
| 156 | native_shared_libs: art_runtime_base_native_shared_libs |
| 157 | + art_runtime_fake_native_shared_libs |
| 158 | + art_runtime_debug_native_shared_libs, |
| 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). |
| 163 | binaries: art_runtime_base_binaries_both, |
| 164 | }, |
| 165 | first: { |
| 166 | // TODO: oatdump cannot link with host linux_bionic due to not using clang ld |
| 167 | binaries: art_tools_common_binaries |
| 168 | + art_runtime_base_binaries_prefer32 |
| 169 | + art_runtime_debug_binaries_prefer32, |
| 170 | } |
| 171 | }, |
| 172 | key: "com.android.runtime.key", |
Alex Light | e352152 | 2018-12-06 22:51:18 -0800 | [diff] [blame^] | 173 | target: { |
| 174 | darwin: { |
| 175 | enabled: false, |
| 176 | }, |
| 177 | }, |
Alex Light | da948ce | 2018-12-06 17:05:41 +0000 | [diff] [blame] | 178 | } |