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