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 | 9150de6 | 2021-02-26 03:22:24 -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 | ], |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | art_cc_binary { |
| 181 | name: "oatdumpds", |
| 182 | defaults: [ |
| 183 | "art_debug_defaults", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 184 | "libartd_static_defaults", |
| 185 | "libartbased_static_defaults", |
| 186 | "libdexfiled_static_defaults", |
| 187 | "libprofiled_static_defaults", |
| 188 | "libartd-compiler_static_defaults", |
Anestis Bechtsoudis | 8583bec | 2018-09-08 22:32:29 +0300 | [diff] [blame] | 189 | "libartd-dexlayout_static_defaults", |
Andreas Gampe | 11bf265 | 2018-07-10 14:21:15 -0700 | [diff] [blame] | 190 | "oatdumps-defaults", |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 191 | ], |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 192 | static_libs: [ |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 193 | "libartd-disassembler", |
Roland Levillain | 12dd9ae | 2018-11-06 13:32:06 +0000 | [diff] [blame] | 194 | "libvixld", |
Andreas Gampe | 11bf265 | 2018-07-10 14:21:15 -0700 | [diff] [blame] | 195 | ], |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 196 | } |
| 197 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 198 | art_cc_defaults { |
| 199 | name: "art_oatdump_tests_defaults", |
David Srbecky | 4a88a5a | 2020-05-05 16:21:57 +0100 | [diff] [blame] | 200 | data: [ |
| 201 | ":art-gtest-jars-ProfileTestMultiDex", |
| 202 | ], |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 203 | srcs: [ |
Vladimir Marko | 421087b | 2018-02-27 11:00:17 +0000 | [diff] [blame] | 204 | "oatdump_app_test.cc", |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 205 | "oatdump_test.cc", |
| 206 | "oatdump_image_test.cc", |
| 207 | ], |
Yo Chiang | 169dfb4 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 208 | target: { |
| 209 | host: { |
| 210 | required: [ |
| 211 | "dex2oatd", |
| 212 | "dex2oatds", |
| 213 | "dexdump", |
| 214 | "oatdumpd", |
| 215 | "oatdumpds", |
| 216 | ], |
| 217 | }, |
| 218 | }, |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 219 | } |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 220 | |
| 221 | // Version of ART gtest `art_oatdump_tests` bundled with the ART APEX on target. |
| 222 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 223 | art_cc_test { |
| 224 | name: "art_oatdump_tests", |
| 225 | defaults: [ |
| 226 | "art_gtest_defaults", |
| 227 | "art_oatdump_tests_defaults", |
| 228 | ], |
| 229 | } |
| 230 | |
| 231 | // Standalone version of ART gtest `art_oatdump_tests`, not bundled with the ART APEX on target. |
| 232 | art_cc_test { |
| 233 | name: "art_standalone_oatdump_tests", |
| 234 | defaults: [ |
| 235 | "art_standalone_gtest_defaults", |
| 236 | "art_oatdump_tests_defaults", |
| 237 | ], |
Jiakai Zhang | d539f86 | 2022-02-08 14:56:05 +0000 | [diff] [blame] | 238 | data: [":generate-boot-image"], |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 239 | test_config: "art_standalone_oatdump_tests.xml", |
| 240 | } |