blob: 57242801d7934475a4d935ec8ff31e18b14bbb0a [file] [log] [blame]
Colin Crossfe6064a2016-08-30 13:49:26 -07001//
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 Badour9150de62021-02-26 03:22:24 -080017package {
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 Crossfe6064a2016-08-30 13:49:26 -070026cc_defaults {
27 name: "oatdump-defaults",
28 defaults: ["art_defaults"],
29 host_supported: true,
30 srcs: ["oatdump.cc"],
Andreas Gampe3157fc22017-08-23 09:43:46 -070031 header_libs: [
32 "art_cmdlineparser_headers",
33 ],
Colin Crossfe6064a2016-08-30 13:49:26 -070034}
35
Martin Stjernholm9e85eeb2020-09-30 17:04:23 +010036// Collect all the static defaults and build a host-only static library, which
37// is then used for the (mostly) static host oatdump binary.
38art_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 Crossfe6064a2016-08-30 13:49:26 -070057art_cc_binary {
58 name: "oatdump",
59 defaults: ["oatdump-defaults"],
Martin Stjernholm9e85eeb2020-09-30 17:04:23 +010060
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 Park066dd9022019-12-19 02:11:59 +000081 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010082 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +000083 "com.android.art.debug",
84 ],
Colin Crossfe6064a2016-08-30 13:49:26 -070085}
86
Martin Stjernholm9e85eeb2020-09-30 17:04:23 +010087// Collect all the static defaults and build a host-only static library, which
88// is then used for the (mostly) static host oatdump binary.
89art_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 Crossfe6064a2016-08-30 13:49:26 -0700108art_cc_binary {
109 name: "oatdumpd",
110 defaults: [
111 "art_debug_defaults",
112 "oatdump-defaults",
113 ],
Martin Stjernholm9e85eeb2020-09-30 17:04:23 +0100114
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 Park066dd9022019-12-19 02:11:59 +0000135 apex_available: [
136 "com.android.art.debug",
137 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700138}
139
Andreas Gampe11bf2652018-07-10 14:21:15 -0700140cc_defaults {
141 name: "oatdumps-defaults",
Colin Crossd2c20802016-09-19 12:57:18 -0700142 device_supported: false,
Roland Levillain7f07f552016-11-22 17:20:46 +0000143 static_executable: true,
Andreas Gampeec5ed062018-01-26 16:20:02 -0800144 defaults: [
145 "oatdump-defaults",
146 ],
Colin Cross8dd90682016-09-08 16:43:27 -0700147 target: {
148 darwin: {
149 enabled: false,
150 },
151 },
Roland Levillain7f07f552016-11-22 17:20:46 +0000152 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 Srbeckyd3ee9022020-07-27 16:05:38 +0100160 static_libs: ["libsigchain_fake"],
Andreas Gampe11bf2652018-07-10 14:21:15 -0700161}
162
163art_cc_binary {
164 name: "oatdumps",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800165 defaults: [
166 "libart_static_defaults",
167 "libartbase_static_defaults",
168 "libdexfile_static_defaults",
169 "libprofile_static_defaults",
170 "libart-compiler_static_defaults",
Anestis Bechtsoudis8583bec2018-09-08 22:32:29 +0300171 "libart-dexlayout_static_defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800172 "oatdumps-defaults",
173 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700174 static_libs: [
Colin Crossfe6064a2016-08-30 13:49:26 -0700175 "libart-disassembler",
Roland Levillain12dd9ae2018-11-06 13:32:06 +0000176 "libvixl",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700177 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700178}
179
180art_cc_binary {
181 name: "oatdumpds",
182 defaults: [
183 "art_debug_defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800184 "libartd_static_defaults",
185 "libartbased_static_defaults",
186 "libdexfiled_static_defaults",
187 "libprofiled_static_defaults",
188 "libartd-compiler_static_defaults",
Anestis Bechtsoudis8583bec2018-09-08 22:32:29 +0300189 "libartd-dexlayout_static_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700190 "oatdumps-defaults",
Colin Crossfe6064a2016-08-30 13:49:26 -0700191 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700192 static_libs: [
Colin Crossfe6064a2016-08-30 13:49:26 -0700193 "libartd-disassembler",
Roland Levillain12dd9ae2018-11-06 13:32:06 +0000194 "libvixld",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700195 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700196}
197
Roland Levillainf0409142021-03-22 15:45:03 +0000198art_cc_defaults {
199 name: "art_oatdump_tests_defaults",
David Srbecky4a88a5a2020-05-05 16:21:57 +0100200 data: [
201 ":art-gtest-jars-ProfileTestMultiDex",
202 ],
Vladimir Marko1352f132017-04-28 15:28:29 +0100203 srcs: [
Vladimir Marko421087b2018-02-27 11:00:17 +0000204 "oatdump_app_test.cc",
Vladimir Marko1352f132017-04-28 15:28:29 +0100205 "oatdump_test.cc",
206 "oatdump_image_test.cc",
207 ],
Yo Chiang169dfb42020-08-07 04:22:18 +0000208 target: {
209 host: {
210 required: [
211 "dex2oatd",
212 "dex2oatds",
213 "dexdump",
214 "oatdumpd",
215 "oatdumpds",
216 ],
217 },
218 },
Colin Cross6e95dd52016-09-12 15:37:10 -0700219}
Roland Levillainf0409142021-03-22 15:45:03 +0000220
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.
223art_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.
232art_cc_test {
233 name: "art_standalone_oatdump_tests",
234 defaults: [
235 "art_standalone_gtest_defaults",
236 "art_oatdump_tests_defaults",
237 ],
Jiakai Zhangd539f862022-02-08 14:56:05 +0000238 data: [":generate-boot-image"],
Roland Levillainf0409142021-03-22 15:45:03 +0000239 test_config: "art_standalone_oatdump_tests.xml",
240}