blob: 20d41b4d0a89d0b9c248ec97cd426d6a3027f3d5 [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: {
Vladimir Markoc10a0c62018-11-16 11:39:22 +000067 static_libs: [
68 "libz",
69 ],
70 },
71 host: {
72 shared_libs: [
73 "libz",
74 ],
Vladimir Marko74527972016-11-29 15:57:32 +000075 },
76 },
77 generated_sources: ["art_dex2oat_operator_srcs"],
78 shared_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +000079 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +000080 ],
81 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
Andreas Gampeec5ed062018-01-26 16:20:02 -080092cc_defaults {
93 name: "libart-dex2oat_static_base_defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -080094 static_libs: [
95 "libbase",
Vladimir Markoc10a0c62018-11-16 11:39:22 +000096 "libz",
Andreas Gampeec5ed062018-01-26 16:20:02 -080097 ],
98}
99
Vladimir Marko74527972016-11-29 15:57:32 +0000100gensrcs {
101 name: "art_dex2oat_operator_srcs",
Alex Lightb69d2d32018-02-21 13:37:17 -0800102 cmd: "$(location generate_operator_out) art/dex2oat $(in) > $(out)",
103 tools: ["generate_operator_out"],
Vladimir Marko74527972016-11-29 15:57:32 +0000104 srcs: [
105 "linker/image_writer.h",
106 ],
107 output_extension: "operator_out.cc",
108}
109
Steven Moreland73030ed2019-01-03 14:23:28 -0800110art_cc_library_static {
Vladimir Marko74527972016-11-29 15:57:32 +0000111 name: "libart-dex2oat",
112 defaults: ["libart-dex2oat-defaults"],
113 shared_libs: [
114 "libart-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800115 "libart-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700116 "libart",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700117 "libprofile",
Vladimir Marko74527972016-11-29 15:57:32 +0000118 ],
119}
120
Andreas Gampeec5ed062018-01-26 16:20:02 -0800121cc_defaults {
122 name: "libart-dex2oat_static_defaults",
123 defaults: [
124 "libart-dex2oat_static_base_defaults",
125 "libart_static_defaults",
126 "libprofile_static_defaults",
127 ],
128 static_libs: [
129 "libart-compiler",
130 "libart-dexlayout",
131 "libart-dex2oat",
132 ],
133}
134
Steven Moreland73030ed2019-01-03 14:23:28 -0800135art_cc_library_static {
Vladimir Marko74527972016-11-29 15:57:32 +0000136 name: "libartd-dex2oat",
137 defaults: [
138 "art_debug_defaults",
139 "libart-dex2oat-defaults",
140 ],
141 shared_libs: [
142 "libartd-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800143 "libartd-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700144 "libartd",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700145 "libprofiled",
Vladimir Marko74527972016-11-29 15:57:32 +0000146 ],
147}
148
Andreas Gampeec5ed062018-01-26 16:20:02 -0800149cc_defaults {
150 name: "libartd-dex2oat_static_defaults",
151 defaults: [
152 "libart-dex2oat_static_base_defaults",
153 "libartd_static_defaults",
154 "libprofiled_static_defaults",
155 ],
156 static_libs: [
157 "libartd-compiler",
158 "libartd-dexlayout",
159 "libartd-dex2oat",
160 ],
161}
162
Andreas Gampe7b565912017-03-20 15:48:52 -0700163cc_library_headers {
164 name: "dex2oat_headers",
165 host_supported: true,
166 export_include_dirs: ["include"],
167}
168
Colin Crossc7376e02016-09-08 12:52:18 -0700169cc_defaults {
170 name: "dex2oat-defaults",
171 host_supported: true,
172 defaults: ["art_defaults"],
Andreas Gampe097f34c2017-08-23 08:57:51 -0700173 srcs: [
174 "dex2oat_options.cc",
175 "dex2oat.cc",
176 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700177
178 target: {
179 android: {
Roland Levillain38a938e2018-09-21 10:55:51 +0100180 // Use the 32-bit version of dex2oat on devices.
Colin Crossc7376e02016-09-08 12:52:18 -0700181 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700182 },
Colin Crossc7376e02016-09-08 12:52:18 -0700183 },
Andreas Gampe3157fc22017-08-23 09:43:46 -0700184 header_libs: [
185 "dex2oat_headers",
186 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700187 ],
188}
189
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700190cc_defaults {
191 name: "dex2oat-pgo-defaults",
192 pgo: {
193 instrumentation: true,
194 benchmarks: ["dex2oat"],
195 },
196 target: {
197 android_arm64: {
198 pgo: {
199 profile_file: "art/dex2oat_arm_arm64.profdata",
200 },
201 },
202 android_arm: {
203 pgo: {
204 profile_file: "art/dex2oat_arm_arm64.profdata",
205 },
206 },
207 android_x86_64: {
208 pgo: {
209 profile_file: "art/dex2oat_x86_x86_64.profdata",
210 },
211 },
212 android_x86: {
213 pgo: {
214 profile_file: "art/dex2oat_x86_x86_64.profdata",
215 },
216 },
Pirama Arumuga Nainarfc1de872018-04-20 14:11:12 -0700217 android_mips64: {
218 pgo: {
219 profile_file: "art/dex2oat_mips_mips64.profdata",
220 },
221 },
222 android_mips: {
223 pgo: {
224 profile_file: "art/dex2oat_mips_mips64.profdata",
225 },
226 },
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700227 },
228}
229
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100230art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700231 name: "dex2oat",
232 defaults: [
233 "dex2oat-defaults",
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700234 "dex2oat-pgo-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700235 ],
236 shared_libs: [
David Sehr82d046e2018-04-23 08:14:19 -0700237 "libprofile",
Colin Crossc7376e02016-09-08 12:52:18 -0700238 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000239 "libart-dexlayout",
240 "libart",
David Sehr0225f8e2018-01-31 08:52:24 +0000241 "libdexfile",
David Sehr1f010162018-05-15 08:59:32 -0700242 "libartbase",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700243 "libbase",
Colin Crossc7376e02016-09-08 12:52:18 -0700244 "libsigchain",
245 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000246 static_libs: [
247 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700248 ],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800249
250 pgo: {
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700251 // Additional cflags just for dex2oat during PGO instrumentation
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800252 cflags: [
253 // Ignore frame-size increase resulting from instrumentation.
254 "-Wno-frame-larger-than=",
255 "-DART_PGO_INSTRUMENTATION",
256 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800257 },
258 target: {
259 android: {
260 lto: {
261 thin: true,
262 },
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000263 static_libs: [
264 "libz",
265 ],
266 },
267 host: {
268 shared_libs: [
269 "libz",
270 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800271 },
272 },
Colin Crossc7376e02016-09-08 12:52:18 -0700273}
274
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100275art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700276 name: "dex2oatd",
277 defaults: [
278 "art_debug_defaults",
279 "dex2oat-defaults",
280 ],
281 shared_libs: [
David Sehr82d046e2018-04-23 08:14:19 -0700282 "libprofiled",
Colin Crossc7376e02016-09-08 12:52:18 -0700283 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000284 "libartd-dexlayout",
285 "libartd",
David Sehrfcbe15c2018-02-15 09:41:13 -0800286 "libdexfiled",
David Sehr1f010162018-05-15 08:59:32 -0700287 "libartbased",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700288 "libbase",
Colin Crossc7376e02016-09-08 12:52:18 -0700289 "libsigchain",
290 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000291 static_libs: [
292 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700293 ],
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000294 target: {
295 android: {
296 static_libs: [
297 "libz",
298 ],
299 },
300 host: {
301 shared_libs: [
302 "libz",
303 ],
Alex Light907001d2019-01-17 00:16:04 +0000304 compile_multilib: "both",
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000305 },
306 },
Alex Light907001d2019-01-17 00:16:04 +0000307
308 multilib: {
309 lib32: {
310 suffix: "32",
311 },
312 lib64: {
313 suffix: "64",
314 },
315 },
316
317 symlink_preferred_arch: true,
Colin Crossc7376e02016-09-08 12:52:18 -0700318}
319
Andreas Gampe11bf2652018-07-10 14:21:15 -0700320cc_defaults {
321 name: "dex2oats-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700322 device_supported: false,
323 static_executable: true,
Andreas Gampeec5ed062018-01-26 16:20:02 -0800324 defaults: [
325 "dex2oat-defaults",
326 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700327 target: {
328 darwin: {
329 enabled: false,
330 },
331 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700332 ldflags: [
333 // We need this because GC stress mode makes use of
334 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
335 // defined in libgcc_eh.a(unwind-dw2.o)
336 // TODO: Having this is not ideal as it might obscure errors.
337 // Try to get rid of it.
338 "-z muldefs",
339 ],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800340 static_libs: [
341 "libbase",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800342 "libsigchain_dummy",
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000343 "libz",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800344 ],
Andreas Gampe11bf2652018-07-10 14:21:15 -0700345}
346
347art_cc_binary {
348 name: "dex2oats",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800349 defaults: [
350 "dex2oats-defaults",
351 "libart_static_defaults",
352 "libart-compiler_static_defaults",
353 "libart-dexlayout_static_defaults",
354 "libartbase_static_defaults",
355 "libdexfile_static_defaults",
356 "libprofile_static_defaults",
357 "libart-dex2oat_static_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700358 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700359}
360
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100361art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700362 name: "dex2oatds",
Colin Crossc7376e02016-09-08 12:52:18 -0700363 defaults: [
364 "art_debug_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700365 "dex2oats-defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800366 "libartd_static_defaults",
367 "libartd-compiler_static_defaults",
368 "libartd-dexlayout_static_defaults",
369 "libartbased_static_defaults",
370 "libdexfiled_static_defaults",
371 "libprofiled_static_defaults",
372 "libartd-dex2oat_static_defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700373 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700374 target: {
Pirama Arumuga Nainar6f5b4d22018-04-20 12:02:02 -0700375 linux_glibc_x86_64: {
376 use_clang_lld: true,
377 },
Colin Crossaa63aa22016-09-13 14:07:00 -0700378 },
Chih-Hung Hsieh238c9632018-05-08 10:22:52 -0700379 // b/79417743, oatdump 32-bit tests failed with clang lld
380 use_clang_lld: false,
Colin Crossc7376e02016-09-08 12:52:18 -0700381}
Colin Cross6e95dd52016-09-12 15:37:10 -0700382
383art_cc_test {
384 name: "art_dex2oat_tests",
385 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700386 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700387 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700388 srcs: [
389 "dex2oat_test.cc",
390 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000391 "linker/elf_writer_test.cc",
392 "linker/image_test.cc",
393 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000394 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000395 "linker/multi_oat_relative_patcher_test.cc",
396 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700397 ],
Vladimir Marko6d66fcf2018-04-12 13:15:27 +0100398
399 codegen: {
400 arm: {
401 srcs: [
402 "linker/arm/relative_patcher_thumb2_test.cc",
403 ],
404 },
405 arm64: {
406 srcs: [
407 "linker/arm64/relative_patcher_arm64_test.cc",
408 ],
409 },
410 mips: {
411 srcs: [
412 "linker/mips/relative_patcher_mips_test.cc",
413 "linker/mips/relative_patcher_mips32r6_test.cc",
414 ],
415 },
416 mips64: {
417 srcs: [
418 "linker/mips64/relative_patcher_mips64_test.cc",
419 ],
420 },
421 x86: {
422 srcs: [
423 "linker/x86/relative_patcher_x86_test.cc",
424 ],
425 },
426 x86_64: {
427 srcs: [
428 "linker/x86_64/relative_patcher_x86_64_test.cc",
429 ],
430 },
431 },
432
Andreas Gampef7882972017-03-20 16:35:24 -0700433 header_libs: ["dex2oat_headers"],
Andreas Gampe238e8fc2017-11-01 17:10:10 -0700434 include_dirs: [
435 "external/zlib",
436 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000437 shared_libs: [
Martin Stjernholm43551622018-11-09 15:14:54 +0000438 "libartbased",
Vladimir Marko74527972016-11-29 15:57:32 +0000439 "libartd-compiler",
440 "libartd-dexlayout",
441 "libbase",
Martin Stjernholm43551622018-11-09 15:14:54 +0000442 "libprofiled",
Vladimir Marko74527972016-11-29 15:57:32 +0000443 "libsigchain",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000444 "libziparchive",
Vladimir Marko74527972016-11-29 15:57:32 +0000445 ],
446 static_libs: [
447 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700448 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700449}