blob: 28c0f9a9c507c8769e233f3c123aa06049ed1f24 [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 Badour04c46122021-03-01 08:35:40 -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 ],
Martin Stjernholm7e7ab232019-02-01 12:58:08 +0000178 // We need this to resolve libartpalette symbols
179 // correctly. Multiple source libraries depend on it.
Martin Stjernholm84bf6982019-02-05 15:07:57 +0000180 // TODO(b/122885634): This is also necessary for the static lib ordering bug
181 // with APEX stubs.
Martin Stjernholm23b27042019-01-11 10:36:35 +0000182 group_static_libs: true,
Colin Crossfe6064a2016-08-30 13:49:26 -0700183}
184
185art_cc_binary {
186 name: "oatdumpds",
187 defaults: [
188 "art_debug_defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800189 "libartd_static_defaults",
190 "libartbased_static_defaults",
191 "libdexfiled_static_defaults",
192 "libprofiled_static_defaults",
193 "libartd-compiler_static_defaults",
Anestis Bechtsoudis8583bec2018-09-08 22:32:29 +0300194 "libartd-dexlayout_static_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700195 "oatdumps-defaults",
Colin Crossfe6064a2016-08-30 13:49:26 -0700196 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700197 static_libs: [
Colin Crossfe6064a2016-08-30 13:49:26 -0700198 "libartd-disassembler",
Roland Levillain12dd9ae2018-11-06 13:32:06 +0000199 "libvixld",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700200 ],
Andreas Gampe802bcf52018-09-07 16:20:58 -0700201 group_static_libs: true,
Colin Crossfe6064a2016-08-30 13:49:26 -0700202}
203
Colin Cross6e95dd52016-09-12 15:37:10 -0700204art_cc_test {
205 name: "art_oatdump_tests",
206 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700207 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700208 ],
David Srbecky4a88a5a2020-05-05 16:21:57 +0100209 data: [
210 ":art-gtest-jars-ProfileTestMultiDex",
211 ],
Vladimir Marko1352f132017-04-28 15:28:29 +0100212 srcs: [
Vladimir Marko421087b2018-02-27 11:00:17 +0000213 "oatdump_app_test.cc",
Vladimir Marko1352f132017-04-28 15:28:29 +0100214 "oatdump_test.cc",
215 "oatdump_image_test.cc",
216 ],
Yo Chiang169dfb42020-08-07 04:22:18 +0000217 target: {
218 host: {
219 required: [
220 "dex2oatd",
221 "dex2oatds",
222 "dexdump",
223 "oatdumpd",
224 "oatdumpds",
225 ],
226 },
227 },
Colin Cross6e95dd52016-09-12 15:37:10 -0700228}