blob: 49b65fd35eb595c6ebff653169fcf69e5e99e501 [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",
Vladimir Marko6d66fcf2018-04-12 13:15:27 +010027 "linker/relative_patcher.cc",
Vladimir Marko74527972016-11-29 15:57:32 +000028 ],
Vladimir Marko6d66fcf2018-04-12 13:15:27 +010029
30 codegen: {
31 arm: {
32 srcs: [
33 "linker/arm/relative_patcher_arm_base.cc",
34 "linker/arm/relative_patcher_thumb2.cc",
35 ],
36 },
37 arm64: {
38 srcs: [
39 "linker/arm64/relative_patcher_arm64.cc",
40 ],
41 },
42 mips: {
43 srcs: [
44 "linker/mips/relative_patcher_mips.cc",
45 ],
46 },
47 mips64: {
48 srcs: [
49 "linker/mips64/relative_patcher_mips64.cc",
50 ],
51 },
52 x86: {
53 srcs: [
54 "linker/x86/relative_patcher_x86.cc",
55 "linker/x86/relative_patcher_x86_base.cc",
56 ],
57 },
58 x86_64: {
59 srcs: [
60 "linker/x86_64/relative_patcher_x86_64.cc",
61 ],
62 },
63 },
64
Vladimir Marko74527972016-11-29 15:57:32 +000065 target: {
Vladimir Marko74527972016-11-29 15:57:32 +000066 android: {
67 // For atrace.
68 shared_libs: ["libcutils"],
69 },
70 },
71 generated_sources: ["art_dex2oat_operator_srcs"],
72 shared_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +000073 "libbase",
74 "liblz4",
75 "liblzma",
76 ],
Andreas Gampef24dfb02017-11-01 15:41:25 -070077 include_dirs: [
78 "external/lz4/lib",
Andreas Gampe238e8fc2017-11-01 17:10:10 -070079 "external/zlib",
Andreas Gampef24dfb02017-11-01 15:41:25 -070080 ],
Vladimir Marko74527972016-11-29 15:57:32 +000081 export_include_dirs: ["."],
82
83 // For SHA-1 checksumming of build ID
84 static: {
85 whole_static_libs: ["libcrypto"],
86 },
87 shared: {
88 shared_libs: ["libcrypto"],
89 },
90}
91
92gensrcs {
93 name: "art_dex2oat_operator_srcs",
Alex Lightb69d2d32018-02-21 13:37:17 -080094 cmd: "$(location generate_operator_out) art/dex2oat $(in) > $(out)",
95 tools: ["generate_operator_out"],
Vladimir Marko74527972016-11-29 15:57:32 +000096 srcs: [
97 "linker/image_writer.h",
98 ],
99 output_extension: "operator_out.cc",
100}
101
102art_cc_static_library {
103 name: "libart-dex2oat",
104 defaults: ["libart-dex2oat-defaults"],
105 shared_libs: [
106 "libart-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800107 "libart-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700108 "libart",
Vladimir Marko74527972016-11-29 15:57:32 +0000109 ],
110}
111
112art_cc_static_library {
113 name: "libartd-dex2oat",
114 defaults: [
115 "art_debug_defaults",
116 "libart-dex2oat-defaults",
117 ],
118 shared_libs: [
119 "libartd-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800120 "libartd-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700121 "libartd",
Vladimir Marko74527972016-11-29 15:57:32 +0000122 ],
123}
124
Andreas Gampe7b565912017-03-20 15:48:52 -0700125cc_library_headers {
126 name: "dex2oat_headers",
127 host_supported: true,
128 export_include_dirs: ["include"],
129}
130
Colin Crossc7376e02016-09-08 12:52:18 -0700131cc_defaults {
132 name: "dex2oat-defaults",
133 host_supported: true,
134 defaults: ["art_defaults"],
Andreas Gampe097f34c2017-08-23 08:57:51 -0700135 srcs: [
136 "dex2oat_options.cc",
137 "dex2oat.cc",
138 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700139
140 target: {
141 android: {
142 // Use the 32-bit version of dex2oat on devices
143 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700144 },
Colin Crossc7376e02016-09-08 12:52:18 -0700145 },
Andreas Gampe3157fc22017-08-23 09:43:46 -0700146 header_libs: [
147 "dex2oat_headers",
148 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700149 ],
150}
151
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100152art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700153 name: "dex2oat",
154 defaults: [
155 "dex2oat-defaults",
156 ],
157 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700158 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000159 "libart-dexlayout",
160 "libart",
David Sehr0225f8e2018-01-31 08:52:24 +0000161 "libdexfile",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700162 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000163 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700164 "libsigchain",
165 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000166 static_libs: [
167 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700168 ],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800169
170 pgo: {
171 instrumentation: true,
Pirama Arumuga Nainarc89013c2018-01-18 12:35:40 -0800172 profile_file: "art/dex2oat.profdata",
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800173 benchmarks: ["dex2oat"],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800174 cflags: [
175 // Ignore frame-size increase resulting from instrumentation.
176 "-Wno-frame-larger-than=",
177 "-DART_PGO_INSTRUMENTATION",
178 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800179 },
180 target: {
181 android: {
182 lto: {
183 thin: true,
184 },
185 },
186 },
Colin Crossc7376e02016-09-08 12:52:18 -0700187}
188
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100189art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700190 name: "dex2oatd",
191 defaults: [
192 "art_debug_defaults",
193 "dex2oat-defaults",
194 ],
195 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700196 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000197 "libartd-dexlayout",
198 "libartd",
David Sehrfcbe15c2018-02-15 09:41:13 -0800199 "libdexfiled",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700200 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000201 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700202 "libsigchain",
203 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000204 static_libs: [
205 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700206 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700207}
208
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100209art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700210 name: "dex2oats",
211 device_supported: false,
212 static_executable: true,
213 defaults: ["dex2oat-defaults"],
Colin Crossaa63aa22016-09-13 14:07:00 -0700214 target: {
215 darwin: {
216 enabled: false,
217 },
218 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700219 ldflags: [
220 // We need this because GC stress mode makes use of
221 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
222 // defined in libgcc_eh.a(unwind-dw2.o)
223 // TODO: Having this is not ideal as it might obscure errors.
224 // Try to get rid of it.
225 "-z muldefs",
226 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700227 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000228 "libart-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700229 "libart-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700230 "libart-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700231 "libart",
David Sehrfcbe15c2018-02-15 09:41:13 -0800232 "libdexfile",
Colin Crossc7376e02016-09-08 12:52:18 -0700233 "libvixl-arm",
234 "libvixl-arm64",
235 ] + art_static_dependencies,
236}
237
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100238art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700239 name: "dex2oatds",
240 device_supported: false,
241 static_executable: true,
242 defaults: [
243 "art_debug_defaults",
244 "dex2oat-defaults",
245 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700246 target: {
247 darwin: {
248 enabled: false,
249 },
250 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700251 ldflags: [
252 // We need this because GC stress mode makes use of
253 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
254 // defined in libgcc_eh.a(unwind-dw2.o)
255 // TODO: Having this is not ideal as it might obscure errors.
256 // Try to get rid of it.
257 "-z muldefs",
258 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700259 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000260 "libartd-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700261 "libartd-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700262 "libartd-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700263 "libartd",
David Sehrfcbe15c2018-02-15 09:41:13 -0800264 "libdexfiled",
Colin Crossc7376e02016-09-08 12:52:18 -0700265 "libvixld-arm",
266 "libvixld-arm64",
267 ] + art_static_dependencies,
268}
Colin Cross6e95dd52016-09-12 15:37:10 -0700269
270art_cc_test {
271 name: "art_dex2oat_tests",
272 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700273 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700274 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700275 srcs: [
276 "dex2oat_test.cc",
277 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000278 "linker/elf_writer_test.cc",
279 "linker/image_test.cc",
280 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000281 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000282 "linker/multi_oat_relative_patcher_test.cc",
283 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700284 ],
Vladimir Marko6d66fcf2018-04-12 13:15:27 +0100285
286 codegen: {
287 arm: {
288 srcs: [
289 "linker/arm/relative_patcher_thumb2_test.cc",
290 ],
291 },
292 arm64: {
293 srcs: [
294 "linker/arm64/relative_patcher_arm64_test.cc",
295 ],
296 },
297 mips: {
298 srcs: [
299 "linker/mips/relative_patcher_mips_test.cc",
300 "linker/mips/relative_patcher_mips32r6_test.cc",
301 ],
302 },
303 mips64: {
304 srcs: [
305 "linker/mips64/relative_patcher_mips64_test.cc",
306 ],
307 },
308 x86: {
309 srcs: [
310 "linker/x86/relative_patcher_x86_test.cc",
311 ],
312 },
313 x86_64: {
314 srcs: [
315 "linker/x86_64/relative_patcher_x86_64_test.cc",
316 ],
317 },
318 },
319
Andreas Gampef7882972017-03-20 16:35:24 -0700320 header_libs: ["dex2oat_headers"],
Andreas Gampe238e8fc2017-11-01 17:10:10 -0700321 include_dirs: [
322 "external/zlib",
323 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000324 shared_libs: [
325 "libartd-compiler",
326 "libartd-dexlayout",
327 "libbase",
328 "liblz4",
329 "libsigchain",
Mathieu Chartier792111c2018-02-15 13:02:15 -0800330 "libziparchive",
Vladimir Marko74527972016-11-29 15:57:32 +0000331 ],
332 static_libs: [
333 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700334 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700335}