blob: 420dddd6c3e42c09659a9db48b3db7b08185a0e6 [file] [log] [blame]
Colin Crossc7376e02016-09-08 12:52:18 -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
Vladimir Marko74527972016-11-29 15:57:32 +000017art_cc_defaults {
18 name: "libart-dex2oat-defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
Vladimir Marko74527972016-11-29 15:57:32 +000021 srcs: [
22 "linker/elf_writer.cc",
23 "linker/elf_writer_quick.cc",
24 "linker/image_writer.cc",
25 "linker/multi_oat_relative_patcher.cc",
26 "linker/oat_writer.cc",
27 ],
28 target: {
Vladimir Marko74527972016-11-29 15:57:32 +000029 android: {
30 // For atrace.
31 shared_libs: ["libcutils"],
32 },
33 },
34 generated_sources: ["art_dex2oat_operator_srcs"],
35 shared_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +000036 "libbase",
37 "liblz4",
38 "liblzma",
39 ],
Andreas Gampef24dfb02017-11-01 15:41:25 -070040 include_dirs: [
41 "external/lz4/lib",
Andreas Gampe238e8fc2017-11-01 17:10:10 -070042 "external/zlib",
Andreas Gampef24dfb02017-11-01 15:41:25 -070043 ],
Vladimir Marko74527972016-11-29 15:57:32 +000044 export_include_dirs: ["."],
45
46 // For SHA-1 checksumming of build ID
47 static: {
48 whole_static_libs: ["libcrypto"],
49 },
50 shared: {
51 shared_libs: ["libcrypto"],
52 },
53}
54
55gensrcs {
56 name: "art_dex2oat_operator_srcs",
Alex Lightb69d2d32018-02-21 13:37:17 -080057 cmd: "$(location generate_operator_out) art/dex2oat $(in) > $(out)",
58 tools: ["generate_operator_out"],
Vladimir Marko74527972016-11-29 15:57:32 +000059 srcs: [
60 "linker/image_writer.h",
61 ],
62 output_extension: "operator_out.cc",
63}
64
65art_cc_static_library {
66 name: "libart-dex2oat",
67 defaults: ["libart-dex2oat-defaults"],
68 shared_libs: [
69 "libart-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -080070 "libart-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -070071 "libart",
Vladimir Marko74527972016-11-29 15:57:32 +000072 ],
73}
74
75art_cc_static_library {
76 name: "libartd-dex2oat",
77 defaults: [
78 "art_debug_defaults",
79 "libart-dex2oat-defaults",
80 ],
81 shared_libs: [
82 "libartd-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -080083 "libartd-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -070084 "libartd",
Vladimir Marko74527972016-11-29 15:57:32 +000085 ],
86}
87
Andreas Gampe7b565912017-03-20 15:48:52 -070088cc_library_headers {
89 name: "dex2oat_headers",
90 host_supported: true,
91 export_include_dirs: ["include"],
92}
93
Colin Crossc7376e02016-09-08 12:52:18 -070094cc_defaults {
95 name: "dex2oat-defaults",
96 host_supported: true,
97 defaults: ["art_defaults"],
Andreas Gampe097f34c2017-08-23 08:57:51 -070098 srcs: [
99 "dex2oat_options.cc",
100 "dex2oat.cc",
101 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700102
103 target: {
104 android: {
105 // Use the 32-bit version of dex2oat on devices
106 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700107 },
Colin Crossc7376e02016-09-08 12:52:18 -0700108 },
Andreas Gampe3157fc22017-08-23 09:43:46 -0700109 header_libs: [
110 "dex2oat_headers",
111 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700112 ],
113}
114
Pirama Arumuga Nainarda221a72018-04-18 22:59:36 -0700115cc_defaults {
116 name: "dex2oat-pgo-defaults",
117 pgo: {
118 instrumentation: true,
119 benchmarks: ["dex2oat"],
120 },
121 target: {
122 android_arm64: {
123 pgo: {
124 profile_file: "art/dex2oat_arm_arm64.profdata",
125 },
126 },
127 android_arm: {
128 pgo: {
129 profile_file: "art/dex2oat_arm_arm64.profdata",
130 },
131 },
132 android_x86_64: {
133 pgo: {
134 profile_file: "art/dex2oat_x86_x86_64.profdata",
135 },
136 },
137 android_x86: {
138 pgo: {
139 profile_file: "art/dex2oat_x86_x86_64.profdata",
140 },
141 },
Pirama Arumuga Nainar69e02632018-04-20 14:11:12 -0700142 android_mips64: {
143 pgo: {
144 profile_file: "art/dex2oat_mips_mips64.profdata",
145 },
146 },
147 android_mips: {
148 pgo: {
149 profile_file: "art/dex2oat_mips_mips64.profdata",
150 },
151 },
Pirama Arumuga Nainarda221a72018-04-18 22:59:36 -0700152 },
153}
154
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100155art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700156 name: "dex2oat",
157 defaults: [
158 "dex2oat-defaults",
Pirama Arumuga Nainarda221a72018-04-18 22:59:36 -0700159 "dex2oat-pgo-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700160 ],
161 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700162 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000163 "libart-dexlayout",
164 "libart",
David Sehr0225f8e2018-01-31 08:52:24 +0000165 "libdexfile",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700166 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000167 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700168 "libsigchain",
169 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000170 static_libs: [
171 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700172 ],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800173
174 pgo: {
Pirama Arumuga Nainarda221a72018-04-18 22:59:36 -0700175 // Additional cflags just for dex2oat during PGO instrumentation
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800176 cflags: [
177 // Ignore frame-size increase resulting from instrumentation.
178 "-Wno-frame-larger-than=",
179 "-DART_PGO_INSTRUMENTATION",
180 ],
Yi Kong36b54152018-03-08 03:19:06 +0000181 },
182 target: {
183 android: {
184 lto: {
185 thin: true,
186 },
187 },
188 },
Colin Crossc7376e02016-09-08 12:52:18 -0700189}
190
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100191art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700192 name: "dex2oatd",
193 defaults: [
194 "art_debug_defaults",
195 "dex2oat-defaults",
196 ],
197 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700198 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000199 "libartd-dexlayout",
200 "libartd",
David Sehrfcbe15c2018-02-15 09:41:13 -0800201 "libdexfiled",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700202 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000203 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700204 "libsigchain",
205 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000206 static_libs: [
207 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700208 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700209}
210
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100211art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700212 name: "dex2oats",
213 device_supported: false,
214 static_executable: true,
215 defaults: ["dex2oat-defaults"],
Colin Crossaa63aa22016-09-13 14:07:00 -0700216 target: {
217 darwin: {
218 enabled: false,
219 },
220 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700221 ldflags: [
222 // We need this because GC stress mode makes use of
223 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
224 // defined in libgcc_eh.a(unwind-dw2.o)
225 // TODO: Having this is not ideal as it might obscure errors.
226 // Try to get rid of it.
227 "-z muldefs",
228 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700229 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000230 "libart-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700231 "libart-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700232 "libart-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700233 "libart",
David Sehrfcbe15c2018-02-15 09:41:13 -0800234 "libdexfile",
Colin Crossc7376e02016-09-08 12:52:18 -0700235 "libvixl-arm",
236 "libvixl-arm64",
237 ] + art_static_dependencies,
238}
239
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100240art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700241 name: "dex2oatds",
242 device_supported: false,
243 static_executable: true,
244 defaults: [
245 "art_debug_defaults",
246 "dex2oat-defaults",
247 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700248 target: {
249 darwin: {
250 enabled: false,
251 },
252 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700253 ldflags: [
254 // We need this because GC stress mode makes use of
255 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
256 // defined in libgcc_eh.a(unwind-dw2.o)
257 // TODO: Having this is not ideal as it might obscure errors.
258 // Try to get rid of it.
259 "-z muldefs",
260 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700261 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000262 "libartd-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700263 "libartd-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700264 "libartd-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700265 "libartd",
David Sehrfcbe15c2018-02-15 09:41:13 -0800266 "libdexfiled",
Colin Crossc7376e02016-09-08 12:52:18 -0700267 "libvixld-arm",
268 "libvixld-arm64",
269 ] + art_static_dependencies,
270}
Colin Cross6e95dd52016-09-12 15:37:10 -0700271
272art_cc_test {
273 name: "art_dex2oat_tests",
274 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700275 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700276 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700277 srcs: [
278 "dex2oat_test.cc",
Calin Juravle5a0381f2020-11-23 19:21:09 -0800279 "dex2oat_vdex_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700280 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000281 "linker/elf_writer_test.cc",
282 "linker/image_test.cc",
283 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000284 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000285 "linker/multi_oat_relative_patcher_test.cc",
286 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700287 ],
Andreas Gampef7882972017-03-20 16:35:24 -0700288 header_libs: ["dex2oat_headers"],
Andreas Gampe238e8fc2017-11-01 17:10:10 -0700289 include_dirs: [
290 "external/zlib",
291 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000292 shared_libs: [
293 "libartd-compiler",
294 "libartd-dexlayout",
295 "libbase",
296 "liblz4",
297 "libsigchain",
Mathieu Chartier792111c2018-02-15 13:02:15 -0800298 "libziparchive",
Vladimir Marko74527972016-11-29 15:57:32 +0000299 ],
300 static_libs: [
301 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700302 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700303}