| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2011 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | cc_defaults { |
| 18 | name: "oatdump-defaults", |
| 19 | defaults: ["art_defaults"], |
| 20 | host_supported: true, |
| 21 | srcs: ["oatdump.cc"], |
| Andreas Gampe | 3157fc2 | 2017-08-23 09:43:46 -0700 | [diff] [blame] | 22 | header_libs: [ |
| 23 | "art_cmdlineparser_headers", |
| 24 | ], |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 25 | } |
| 26 | |
| Martin Stjernholm | 9e85eeb | 2020-09-30 17:04:23 +0100 | [diff] [blame^] | 27 | // Collect all the static defaults and build a host-only static library, which |
| 28 | // is then used for the (mostly) static host oatdump binary. |
| 29 | art_cc_library_static { |
| 30 | name: "liboatdump_static", |
| 31 | device_supported: false, |
| 32 | host_supported: true, |
| 33 | defaults: [ |
| 34 | "libart-compiler_static_defaults", |
| 35 | "libart-dexlayout_static_defaults", |
| 36 | "libart-disassembler_static_defaults", |
| 37 | "libart_static_defaults", |
| 38 | "libartbase_static_defaults", |
| 39 | "libdexfile_static_defaults", |
| 40 | "libprofile_static_defaults", |
| 41 | "oatdump-defaults", |
| 42 | ], |
| 43 | whole_static_libs: [ |
| 44 | "libbase", |
| 45 | ], |
| 46 | } |
| 47 | |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 48 | art_cc_binary { |
| 49 | name: "oatdump", |
| 50 | defaults: ["oatdump-defaults"], |
| Martin Stjernholm | 9e85eeb | 2020-09-30 17:04:23 +0100 | [diff] [blame^] | 51 | |
| 52 | target: { |
| 53 | android: { |
| 54 | shared_libs: [ |
| 55 | "libart", |
| 56 | "libart-compiler", |
| 57 | "libart-dexlayout", |
| 58 | "libart-disassembler", |
| 59 | "libartbase", |
| 60 | "libbase", |
| 61 | "libdexfile", |
| 62 | "libprofile", |
| 63 | ], |
| 64 | }, |
| 65 | host: { |
| 66 | // Make the host binary static, except for system libraries. |
| 67 | static_libs: ["liboatdump_static"], |
| 68 | stl: "c++_static", |
| 69 | }, |
| 70 | }, |
| 71 | |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 72 | apex_available: [ |
| 73 | "com.android.art.release", |
| 74 | "com.android.art.debug", |
| 75 | ], |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 76 | } |
| 77 | |
| Martin Stjernholm | 9e85eeb | 2020-09-30 17:04:23 +0100 | [diff] [blame^] | 78 | // Collect all the static defaults and build a host-only static library, which |
| 79 | // is then used for the (mostly) static host oatdump binary. |
| 80 | art_cc_library_static { |
| 81 | name: "liboatdumpd_static", |
| 82 | device_supported: false, |
| 83 | host_supported: true, |
| 84 | defaults: [ |
| 85 | "libartd-compiler_static_defaults", |
| 86 | "libartd-dexlayout_static_defaults", |
| 87 | "libartd-disassembler_static_defaults", |
| 88 | "libartd_static_defaults", |
| 89 | "libartbased_static_defaults", |
| 90 | "libdexfiled_static_defaults", |
| 91 | "libprofiled_static_defaults", |
| 92 | "oatdump-defaults", |
| 93 | ], |
| 94 | whole_static_libs: [ |
| 95 | "libbase", |
| 96 | ], |
| 97 | } |
| 98 | |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 99 | art_cc_binary { |
| 100 | name: "oatdumpd", |
| 101 | defaults: [ |
| 102 | "art_debug_defaults", |
| 103 | "oatdump-defaults", |
| 104 | ], |
| Martin Stjernholm | 9e85eeb | 2020-09-30 17:04:23 +0100 | [diff] [blame^] | 105 | |
| 106 | target: { |
| 107 | android: { |
| 108 | shared_libs: [ |
| 109 | "libartbased", |
| 110 | "libartd", |
| 111 | "libartd-compiler", |
| 112 | "libartd-dexlayout", |
| 113 | "libartd-disassembler", |
| 114 | "libbase", |
| 115 | "libdexfiled", |
| 116 | "libprofiled", |
| 117 | ], |
| 118 | }, |
| 119 | host: { |
| 120 | // Make the host binary static, except for system libraries. |
| 121 | static_libs: ["liboatdumpd_static"], |
| 122 | stl: "c++_static", |
| 123 | }, |
| 124 | }, |
| 125 | |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 126 | apex_available: [ |
| 127 | "com.android.art.debug", |
| 128 | ], |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 129 | } |
| 130 | |
| Andreas Gampe | 11bf265 | 2018-07-10 14:21:15 -0700 | [diff] [blame] | 131 | cc_defaults { |
| 132 | name: "oatdumps-defaults", |
| Colin Cross | d2c2080 | 2016-09-19 12:57:18 -0700 | [diff] [blame] | 133 | device_supported: false, |
| Roland Levillain | 7f07f55 | 2016-11-22 17:20:46 +0000 | [diff] [blame] | 134 | static_executable: true, |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 135 | defaults: [ |
| 136 | "oatdump-defaults", |
| 137 | ], |
| Colin Cross | 8dd9068 | 2016-09-08 16:43:27 -0700 | [diff] [blame] | 138 | target: { |
| 139 | darwin: { |
| 140 | enabled: false, |
| 141 | }, |
| 142 | }, |
| Roland Levillain | 7f07f55 | 2016-11-22 17:20:46 +0000 | [diff] [blame] | 143 | ldflags: [ |
| 144 | // We need this because GC stress mode makes use of |
| 145 | // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also |
| 146 | // defined in libgcc_eh.a(unwind-dw2.o) |
| 147 | // TODO: Having this is not ideal as it might obscure errors. |
| 148 | // Try to get rid of it. |
| 149 | "-z muldefs", |
| 150 | ], |
| David Srbecky | d3ee902 | 2020-07-27 16:05:38 +0100 | [diff] [blame] | 151 | static_libs: ["libsigchain_fake"], |
| Andreas Gampe | 11bf265 | 2018-07-10 14:21:15 -0700 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | art_cc_binary { |
| 155 | name: "oatdumps", |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 156 | defaults: [ |
| 157 | "libart_static_defaults", |
| 158 | "libartbase_static_defaults", |
| 159 | "libdexfile_static_defaults", |
| 160 | "libprofile_static_defaults", |
| 161 | "libart-compiler_static_defaults", |
| Anestis Bechtsoudis | 8583bec | 2018-09-08 22:32:29 +0300 | [diff] [blame] | 162 | "libart-dexlayout_static_defaults", |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 163 | "oatdumps-defaults", |
| 164 | ], |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 165 | static_libs: [ |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 166 | "libart-disassembler", |
| Roland Levillain | 12dd9ae | 2018-11-06 13:32:06 +0000 | [diff] [blame] | 167 | "libvixl", |
| Andreas Gampe | 11bf265 | 2018-07-10 14:21:15 -0700 | [diff] [blame] | 168 | ], |
| Martin Stjernholm | 7e7ab23 | 2019-02-01 12:58:08 +0000 | [diff] [blame] | 169 | // We need this to resolve libartpalette symbols |
| 170 | // correctly. Multiple source libraries depend on it. |
| Martin Stjernholm | 84bf698 | 2019-02-05 15:07:57 +0000 | [diff] [blame] | 171 | // TODO(b/122885634): This is also necessary for the static lib ordering bug |
| 172 | // with APEX stubs. |
| Martin Stjernholm | 23b2704 | 2019-01-11 10:36:35 +0000 | [diff] [blame] | 173 | group_static_libs: true, |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | art_cc_binary { |
| 177 | name: "oatdumpds", |
| 178 | defaults: [ |
| 179 | "art_debug_defaults", |
| Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 180 | "libartd_static_defaults", |
| 181 | "libartbased_static_defaults", |
| 182 | "libdexfiled_static_defaults", |
| 183 | "libprofiled_static_defaults", |
| 184 | "libartd-compiler_static_defaults", |
| Anestis Bechtsoudis | 8583bec | 2018-09-08 22:32:29 +0300 | [diff] [blame] | 185 | "libartd-dexlayout_static_defaults", |
| Andreas Gampe | 11bf265 | 2018-07-10 14:21:15 -0700 | [diff] [blame] | 186 | "oatdumps-defaults", |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 187 | ], |
| Colin Cross | 8dd9068 | 2016-09-08 16:43:27 -0700 | [diff] [blame] | 188 | target: { |
| Pirama Arumuga Nainar | 6f5b4d2 | 2018-04-20 12:02:02 -0700 | [diff] [blame] | 189 | linux_glibc_x86_64: { |
| 190 | use_clang_lld: true, |
| 191 | }, |
| Colin Cross | 8dd9068 | 2016-09-08 16:43:27 -0700 | [diff] [blame] | 192 | }, |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 193 | static_libs: [ |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 194 | "libartd-disassembler", |
| Roland Levillain | 12dd9ae | 2018-11-06 13:32:06 +0000 | [diff] [blame] | 195 | "libvixld", |
| Andreas Gampe | 11bf265 | 2018-07-10 14:21:15 -0700 | [diff] [blame] | 196 | ], |
| Andreas Gampe | 802bcf5 | 2018-09-07 16:20:58 -0700 | [diff] [blame] | 197 | group_static_libs: true, |
| Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 198 | } |
| 199 | |
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 200 | art_cc_test { |
| 201 | name: "art_oatdump_tests", |
| 202 | defaults: [ |
| Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 203 | "art_gtest_defaults", |
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 204 | ], |
| David Srbecky | 4a88a5a | 2020-05-05 16:21:57 +0100 | [diff] [blame] | 205 | data: [ |
| 206 | ":art-gtest-jars-ProfileTestMultiDex", |
| 207 | ], |
| Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 208 | srcs: [ |
| Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 209 | "oatdump_app_test.cc", |
| Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 210 | "oatdump_test.cc", |
| 211 | "oatdump_image_test.cc", |
| 212 | ], |
| Yo Chiang | 169dfb4 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 213 | target: { |
| 214 | host: { |
| 215 | required: [ |
| 216 | "dex2oatd", |
| 217 | "dex2oatds", |
| 218 | "dexdump", |
| 219 | "oatdumpd", |
| 220 | "oatdumpds", |
| 221 | ], |
| 222 | }, |
| 223 | }, |
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 224 | } |