blob: 87f3a6954d7f005fb9d1cd336c4b6633cc356bf8 [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
17cc_defaults {
18 name: "oatdump-defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
21 srcs: ["oatdump.cc"],
Andreas Gampe3157fc22017-08-23 09:43:46 -070022 header_libs: [
23 "art_cmdlineparser_headers",
24 ],
Colin Crossfe6064a2016-08-30 13:49:26 -070025}
26
Martin Stjernholm9e85eeb2020-09-30 17:04:23 +010027// Collect all the static defaults and build a host-only static library, which
28// is then used for the (mostly) static host oatdump binary.
29art_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 Crossfe6064a2016-08-30 13:49:26 -070048art_cc_binary {
49 name: "oatdump",
50 defaults: ["oatdump-defaults"],
Martin Stjernholm9e85eeb2020-09-30 17:04:23 +010051
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 Park066dd9022019-12-19 02:11:59 +000072 apex_available: [
73 "com.android.art.release",
74 "com.android.art.debug",
75 ],
Colin Crossfe6064a2016-08-30 13:49:26 -070076}
77
Martin Stjernholm9e85eeb2020-09-30 17:04:23 +010078// Collect all the static defaults and build a host-only static library, which
79// is then used for the (mostly) static host oatdump binary.
80art_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 Crossfe6064a2016-08-30 13:49:26 -070099art_cc_binary {
100 name: "oatdumpd",
101 defaults: [
102 "art_debug_defaults",
103 "oatdump-defaults",
104 ],
Martin Stjernholm9e85eeb2020-09-30 17:04:23 +0100105
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 Park066dd9022019-12-19 02:11:59 +0000126 apex_available: [
127 "com.android.art.debug",
128 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700129}
130
Andreas Gampe11bf2652018-07-10 14:21:15 -0700131cc_defaults {
132 name: "oatdumps-defaults",
Colin Crossd2c20802016-09-19 12:57:18 -0700133 device_supported: false,
Roland Levillain7f07f552016-11-22 17:20:46 +0000134 static_executable: true,
Andreas Gampeec5ed062018-01-26 16:20:02 -0800135 defaults: [
136 "oatdump-defaults",
137 ],
Colin Cross8dd90682016-09-08 16:43:27 -0700138 target: {
139 darwin: {
140 enabled: false,
141 },
142 },
Roland Levillain7f07f552016-11-22 17:20:46 +0000143 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 Srbeckyd3ee9022020-07-27 16:05:38 +0100151 static_libs: ["libsigchain_fake"],
Andreas Gampe11bf2652018-07-10 14:21:15 -0700152}
153
154art_cc_binary {
155 name: "oatdumps",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800156 defaults: [
157 "libart_static_defaults",
158 "libartbase_static_defaults",
159 "libdexfile_static_defaults",
160 "libprofile_static_defaults",
161 "libart-compiler_static_defaults",
Anestis Bechtsoudis8583bec2018-09-08 22:32:29 +0300162 "libart-dexlayout_static_defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800163 "oatdumps-defaults",
164 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700165 static_libs: [
Colin Crossfe6064a2016-08-30 13:49:26 -0700166 "libart-disassembler",
Roland Levillain12dd9ae2018-11-06 13:32:06 +0000167 "libvixl",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700168 ],
Martin Stjernholm7e7ab232019-02-01 12:58:08 +0000169 // We need this to resolve libartpalette symbols
170 // correctly. Multiple source libraries depend on it.
Martin Stjernholm84bf6982019-02-05 15:07:57 +0000171 // TODO(b/122885634): This is also necessary for the static lib ordering bug
172 // with APEX stubs.
Martin Stjernholm23b27042019-01-11 10:36:35 +0000173 group_static_libs: true,
Colin Crossfe6064a2016-08-30 13:49:26 -0700174}
175
176art_cc_binary {
177 name: "oatdumpds",
178 defaults: [
179 "art_debug_defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800180 "libartd_static_defaults",
181 "libartbased_static_defaults",
182 "libdexfiled_static_defaults",
183 "libprofiled_static_defaults",
184 "libartd-compiler_static_defaults",
Anestis Bechtsoudis8583bec2018-09-08 22:32:29 +0300185 "libartd-dexlayout_static_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700186 "oatdumps-defaults",
Colin Crossfe6064a2016-08-30 13:49:26 -0700187 ],
Colin Cross8dd90682016-09-08 16:43:27 -0700188 target: {
Pirama Arumuga Nainar6f5b4d22018-04-20 12:02:02 -0700189 linux_glibc_x86_64: {
190 use_clang_lld: true,
191 },
Colin Cross8dd90682016-09-08 16:43:27 -0700192 },
Colin Crossfe6064a2016-08-30 13:49:26 -0700193 static_libs: [
Colin Crossfe6064a2016-08-30 13:49:26 -0700194 "libartd-disassembler",
Roland Levillain12dd9ae2018-11-06 13:32:06 +0000195 "libvixld",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700196 ],
Andreas Gampe802bcf52018-09-07 16:20:58 -0700197 group_static_libs: true,
Colin Crossfe6064a2016-08-30 13:49:26 -0700198}
199
Colin Cross6e95dd52016-09-12 15:37:10 -0700200art_cc_test {
201 name: "art_oatdump_tests",
202 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700203 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700204 ],
David Srbecky4a88a5a2020-05-05 16:21:57 +0100205 data: [
206 ":art-gtest-jars-ProfileTestMultiDex",
207 ],
Vladimir Marko1352f132017-04-28 15:28:29 +0100208 srcs: [
Vladimir Marko421087b2018-02-27 11:00:17 +0000209 "oatdump_app_test.cc",
Vladimir Marko1352f132017-04-28 15:28:29 +0100210 "oatdump_test.cc",
211 "oatdump_image_test.cc",
212 ],
Yo Chiang169dfb42020-08-07 04:22:18 +0000213 target: {
214 host: {
215 required: [
216 "dex2oatd",
217 "dex2oatds",
218 "dexdump",
219 "oatdumpd",
220 "oatdumpds",
221 ],
222 },
223 },
Colin Cross6e95dd52016-09-12 15:37:10 -0700224}