blob: e3320fe120b48ff6d6d86d3ef5fc0dd89ea4bf47 [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: [
Vladimir Marko327497e2019-03-04 12:53:20 +000022 "dex/dex_to_dex_compiler.cc",
23 "dex/quick_compiler_callbacks.cc",
24 "driver/compiler_driver.cc",
Vladimir Marko74527972016-11-29 15:57:32 +000025 "linker/elf_writer.cc",
26 "linker/elf_writer_quick.cc",
27 "linker/image_writer.cc",
28 "linker/multi_oat_relative_patcher.cc",
29 "linker/oat_writer.cc",
Vladimir Marko6d66fcf2018-04-12 13:15:27 +010030 "linker/relative_patcher.cc",
Vladimir Marko74527972016-11-29 15:57:32 +000031 ],
Vladimir Marko6d66fcf2018-04-12 13:15:27 +010032
33 codegen: {
34 arm: {
35 srcs: [
36 "linker/arm/relative_patcher_arm_base.cc",
37 "linker/arm/relative_patcher_thumb2.cc",
38 ],
39 },
40 arm64: {
41 srcs: [
42 "linker/arm64/relative_patcher_arm64.cc",
43 ],
44 },
45 mips: {
46 srcs: [
47 "linker/mips/relative_patcher_mips.cc",
48 ],
49 },
50 mips64: {
51 srcs: [
52 "linker/mips64/relative_patcher_mips64.cc",
53 ],
54 },
55 x86: {
56 srcs: [
57 "linker/x86/relative_patcher_x86.cc",
58 "linker/x86/relative_patcher_x86_base.cc",
59 ],
60 },
61 x86_64: {
62 srcs: [
63 "linker/x86_64/relative_patcher_x86_64.cc",
64 ],
65 },
66 },
67
Vladimir Marko74527972016-11-29 15:57:32 +000068 target: {
Vladimir Marko74527972016-11-29 15:57:32 +000069 android: {
Vladimir Markoc10a0c62018-11-16 11:39:22 +000070 static_libs: [
71 "libz",
72 ],
73 },
74 host: {
75 shared_libs: [
76 "libz",
77 ],
Vladimir Marko74527972016-11-29 15:57:32 +000078 },
79 },
80 generated_sources: ["art_dex2oat_operator_srcs"],
81 shared_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +000082 "libbase",
Colin Cross70f23142019-09-13 17:37:33 -070083
84 // For SHA-1 checksumming of build ID
85 "libcrypto",
Vladimir Marko74527972016-11-29 15:57:32 +000086 ],
87 export_include_dirs: ["."],
Vladimir Marko74527972016-11-29 15:57:32 +000088}
89
Andreas Gampeec5ed062018-01-26 16:20:02 -080090cc_defaults {
91 name: "libart-dex2oat_static_base_defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -080092 static_libs: [
93 "libbase",
Colin Cross70f23142019-09-13 17:37:33 -070094 "libcrypto",
Vladimir Markoc10a0c62018-11-16 11:39:22 +000095 "libz",
Andreas Gampeec5ed062018-01-26 16:20:02 -080096 ],
97}
98
Vladimir Marko74527972016-11-29 15:57:32 +000099gensrcs {
100 name: "art_dex2oat_operator_srcs",
Alex Lightb69d2d32018-02-21 13:37:17 -0800101 cmd: "$(location generate_operator_out) art/dex2oat $(in) > $(out)",
102 tools: ["generate_operator_out"],
Vladimir Marko74527972016-11-29 15:57:32 +0000103 srcs: [
Vladimir Marko327497e2019-03-04 12:53:20 +0000104 "dex/dex_to_dex_compiler.h",
105 "driver/compiler_driver.h",
Vladimir Marko74527972016-11-29 15:57:32 +0000106 "linker/image_writer.h",
107 ],
108 output_extension: "operator_out.cc",
109}
110
Steven Moreland73030ed2019-01-03 14:23:28 -0800111art_cc_library_static {
Vladimir Marko74527972016-11-29 15:57:32 +0000112 name: "libart-dex2oat",
113 defaults: ["libart-dex2oat-defaults"],
114 shared_libs: [
115 "libart-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800116 "libart-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700117 "libart",
Vladimir Marko327497e2019-03-04 12:53:20 +0000118 "libartpalette",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700119 "libprofile",
Vladimir Marko74527972016-11-29 15:57:32 +0000120 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000121 apex_available: [
122 "com.android.art.release",
Jiyong Park7c2f69e2020-01-15 15:43:32 +0900123 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +0000124 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000125}
126
Andreas Gampeec5ed062018-01-26 16:20:02 -0800127cc_defaults {
128 name: "libart-dex2oat_static_defaults",
129 defaults: [
130 "libart-dex2oat_static_base_defaults",
131 "libart_static_defaults",
132 "libprofile_static_defaults",
133 ],
134 static_libs: [
135 "libart-compiler",
136 "libart-dexlayout",
137 "libart-dex2oat",
138 ],
139}
140
Steven Moreland73030ed2019-01-03 14:23:28 -0800141art_cc_library_static {
Vladimir Marko74527972016-11-29 15:57:32 +0000142 name: "libartd-dex2oat",
143 defaults: [
144 "art_debug_defaults",
145 "libart-dex2oat-defaults",
146 ],
147 shared_libs: [
148 "libartd-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800149 "libartd-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700150 "libartd",
Vladimir Marko327497e2019-03-04 12:53:20 +0000151 "libartpalette",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700152 "libprofiled",
Vladimir Marko74527972016-11-29 15:57:32 +0000153 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000154 apex_available: [
155 "com.android.art.debug",
156 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000157}
158
Andreas Gampeec5ed062018-01-26 16:20:02 -0800159cc_defaults {
160 name: "libartd-dex2oat_static_defaults",
161 defaults: [
162 "libart-dex2oat_static_base_defaults",
163 "libartd_static_defaults",
164 "libprofiled_static_defaults",
165 ],
166 static_libs: [
167 "libartd-compiler",
168 "libartd-dexlayout",
169 "libartd-dex2oat",
170 ],
171}
172
Andreas Gampe7b565912017-03-20 15:48:52 -0700173cc_library_headers {
174 name: "dex2oat_headers",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100175 visibility: [
176 // TODO(b/133140750): Clean this up.
177 "//frameworks/native/cmds/installd",
178 ],
Andreas Gampe7b565912017-03-20 15:48:52 -0700179 host_supported: true,
180 export_include_dirs: ["include"],
181}
182
Colin Crossc7376e02016-09-08 12:52:18 -0700183cc_defaults {
184 name: "dex2oat-defaults",
185 host_supported: true,
186 defaults: ["art_defaults"],
Andreas Gampe097f34c2017-08-23 08:57:51 -0700187 srcs: [
188 "dex2oat_options.cc",
189 "dex2oat.cc",
190 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700191
192 target: {
193 android: {
Roland Levillain38a938e2018-09-21 10:55:51 +0100194 // Use the 32-bit version of dex2oat on devices.
Colin Crossc7376e02016-09-08 12:52:18 -0700195 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700196 },
Colin Crossc7376e02016-09-08 12:52:18 -0700197 },
Andreas Gampe3157fc22017-08-23 09:43:46 -0700198 header_libs: [
199 "dex2oat_headers",
200 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700201 ],
202}
203
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700204cc_defaults {
205 name: "dex2oat-pgo-defaults",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100206 defaults_visibility: [
207 "//art:__subpackages__",
208 "//external/vixl",
209 ],
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700210 pgo: {
211 instrumentation: true,
212 benchmarks: ["dex2oat"],
213 },
214 target: {
215 android_arm64: {
216 pgo: {
217 profile_file: "art/dex2oat_arm_arm64.profdata",
218 },
219 },
220 android_arm: {
221 pgo: {
222 profile_file: "art/dex2oat_arm_arm64.profdata",
223 },
224 },
225 android_x86_64: {
226 pgo: {
227 profile_file: "art/dex2oat_x86_x86_64.profdata",
228 },
229 },
230 android_x86: {
231 pgo: {
232 profile_file: "art/dex2oat_x86_x86_64.profdata",
233 },
234 },
Pirama Arumuga Nainarfc1de872018-04-20 14:11:12 -0700235 android_mips64: {
236 pgo: {
237 profile_file: "art/dex2oat_mips_mips64.profdata",
238 },
239 },
240 android_mips: {
241 pgo: {
242 profile_file: "art/dex2oat_mips_mips64.profdata",
243 },
244 },
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700245 },
246}
247
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100248art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700249 name: "dex2oat",
250 defaults: [
251 "dex2oat-defaults",
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700252 "dex2oat-pgo-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700253 ],
254 shared_libs: [
David Sehr82d046e2018-04-23 08:14:19 -0700255 "libprofile",
Colin Crossc7376e02016-09-08 12:52:18 -0700256 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000257 "libart-dexlayout",
258 "libart",
Colin Cross70f23142019-09-13 17:37:33 -0700259 "libcrypto",
David Sehr0225f8e2018-01-31 08:52:24 +0000260 "libdexfile",
David Sehr1f010162018-05-15 08:59:32 -0700261 "libartbase",
Vladimir Marko327497e2019-03-04 12:53:20 +0000262 "libartpalette",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700263 "libbase",
Colin Crossc7376e02016-09-08 12:52:18 -0700264 "libsigchain",
265 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000266 static_libs: [
267 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700268 ],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800269
270 pgo: {
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700271 // Additional cflags just for dex2oat during PGO instrumentation
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800272 cflags: [
273 // Ignore frame-size increase resulting from instrumentation.
274 "-Wno-frame-larger-than=",
275 "-DART_PGO_INSTRUMENTATION",
276 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800277 },
278 target: {
279 android: {
280 lto: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700281 thin: true,
Yi Kong1d894d92018-01-19 22:01:14 -0800282 },
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000283 static_libs: [
284 "libz",
285 ],
286 },
287 host: {
288 shared_libs: [
289 "libz",
290 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800291 },
292 },
Jiyong Park066dd9022019-12-19 02:11:59 +0000293 apex_available: [
294 "com.android.art.release",
295 "com.android.art.debug",
296 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700297}
298
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100299art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700300 name: "dex2oatd",
301 defaults: [
302 "art_debug_defaults",
303 "dex2oat-defaults",
304 ],
305 shared_libs: [
David Sehr82d046e2018-04-23 08:14:19 -0700306 "libprofiled",
Colin Crossc7376e02016-09-08 12:52:18 -0700307 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000308 "libartd-dexlayout",
309 "libartd",
Colin Cross70f23142019-09-13 17:37:33 -0700310 "libcrypto",
David Sehrfcbe15c2018-02-15 09:41:13 -0800311 "libdexfiled",
David Sehr1f010162018-05-15 08:59:32 -0700312 "libartbased",
Vladimir Marko327497e2019-03-04 12:53:20 +0000313 "libartpalette",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700314 "libbase",
Colin Crossc7376e02016-09-08 12:52:18 -0700315 "libsigchain",
316 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000317 static_libs: [
318 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700319 ],
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000320 target: {
321 android: {
322 static_libs: [
323 "libz",
324 ],
Roland Levillain9a45d012019-06-05 13:54:02 +0100325 compile_multilib: "prefer32",
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000326 },
327 host: {
328 shared_libs: [
329 "libz",
330 ],
Alex Light907001d2019-01-17 00:16:04 +0000331 compile_multilib: "both",
Roland Levillain9a45d012019-06-05 13:54:02 +0100332 symlink_preferred_arch: true,
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000333 },
Roland Levillain9a45d012019-06-05 13:54:02 +0100334 linux_glibc_x86: {
Alex Light907001d2019-01-17 00:16:04 +0000335 suffix: "32",
336 },
Roland Levillain9a45d012019-06-05 13:54:02 +0100337 linux_glibc_x86_64: {
338 suffix: "64",
339 },
340 linux_bionic_x86_64: {
Alex Light907001d2019-01-17 00:16:04 +0000341 suffix: "64",
342 },
343 },
Jiyong Park066dd9022019-12-19 02:11:59 +0000344 apex_available: [
345 "com.android.art.debug",
346 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700347}
348
Andreas Gampe11bf2652018-07-10 14:21:15 -0700349cc_defaults {
350 name: "dex2oats-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700351 device_supported: false,
352 static_executable: true,
Andreas Gampeec5ed062018-01-26 16:20:02 -0800353 defaults: [
354 "dex2oat-defaults",
355 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700356 target: {
357 darwin: {
358 enabled: false,
359 },
360 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700361 ldflags: [
362 // We need this because GC stress mode makes use of
363 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
364 // defined in libgcc_eh.a(unwind-dw2.o)
365 // TODO: Having this is not ideal as it might obscure errors.
366 // Try to get rid of it.
367 "-z muldefs",
368 ],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800369 static_libs: [
370 "libbase",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800371 "libsigchain_dummy",
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000372 "libz",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800373 ],
Andreas Gampe11bf2652018-07-10 14:21:15 -0700374}
375
376art_cc_binary {
377 name: "dex2oats",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800378 defaults: [
379 "dex2oats-defaults",
380 "libart_static_defaults",
381 "libart-compiler_static_defaults",
382 "libart-dexlayout_static_defaults",
383 "libartbase_static_defaults",
384 "libdexfile_static_defaults",
385 "libprofile_static_defaults",
386 "libart-dex2oat_static_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700387 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700388}
389
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100390art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700391 name: "dex2oatds",
Colin Crossc7376e02016-09-08 12:52:18 -0700392 defaults: [
393 "art_debug_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700394 "dex2oats-defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800395 "libartd_static_defaults",
396 "libartd-compiler_static_defaults",
397 "libartd-dexlayout_static_defaults",
398 "libartbased_static_defaults",
399 "libdexfiled_static_defaults",
400 "libprofiled_static_defaults",
401 "libartd-dex2oat_static_defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700402 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700403 target: {
Pirama Arumuga Nainar6f5b4d22018-04-20 12:02:02 -0700404 linux_glibc_x86_64: {
405 use_clang_lld: true,
406 },
Colin Crossaa63aa22016-09-13 14:07:00 -0700407 },
Colin Crossc7376e02016-09-08 12:52:18 -0700408}
Colin Cross6e95dd52016-09-12 15:37:10 -0700409
Vladimir Marko327497e2019-03-04 12:53:20 +0000410art_cc_library_static {
411 name: "libart-dex2oat-gtest",
412 defaults: ["libart-gtest-defaults"],
413 srcs: [
414 "common_compiler_driver_test.cc",
415 ],
416 shared_libs: [
417 "libartd-compiler",
418 "libartd-disassembler",
419 "libart-compiler-gtest",
420 "libart-runtime-gtest",
421 "libbase",
422 ],
423 static_libs: [
424 "libartd-dex2oat",
425 ],
426}
427
Colin Cross6e95dd52016-09-12 15:37:10 -0700428art_cc_test {
429 name: "art_dex2oat_tests",
430 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700431 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700432 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700433 srcs: [
434 "dex2oat_test.cc",
435 "dex2oat_image_test.cc",
Vladimir Marko327497e2019-03-04 12:53:20 +0000436 "dex/dex_to_dex_decompiler_test.cc",
437 "driver/compiler_driver_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000438 "linker/elf_writer_test.cc",
439 "linker/image_test.cc",
440 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000441 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000442 "linker/multi_oat_relative_patcher_test.cc",
443 "linker/oat_writer_test.cc",
Vladimir Marko327497e2019-03-04 12:53:20 +0000444 "verifier_deps_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700445 ],
Vladimir Marko6d66fcf2018-04-12 13:15:27 +0100446
447 codegen: {
448 arm: {
449 srcs: [
450 "linker/arm/relative_patcher_thumb2_test.cc",
451 ],
452 },
453 arm64: {
454 srcs: [
455 "linker/arm64/relative_patcher_arm64_test.cc",
456 ],
457 },
458 mips: {
459 srcs: [
460 "linker/mips/relative_patcher_mips_test.cc",
461 "linker/mips/relative_patcher_mips32r6_test.cc",
462 ],
463 },
464 mips64: {
465 srcs: [
466 "linker/mips64/relative_patcher_mips64_test.cc",
467 ],
468 },
469 x86: {
470 srcs: [
471 "linker/x86/relative_patcher_x86_test.cc",
472 ],
473 },
474 x86_64: {
475 srcs: [
476 "linker/x86_64/relative_patcher_x86_64_test.cc",
477 ],
478 },
479 },
480
Andreas Gampef7882972017-03-20 16:35:24 -0700481 header_libs: ["dex2oat_headers"],
Vladimir Marko74527972016-11-29 15:57:32 +0000482 shared_libs: [
Martin Stjernholm43551622018-11-09 15:14:54 +0000483 "libartbased",
Vladimir Marko0a516052019-10-14 13:00:44 +0000484 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000485 "libartd-dexlayout",
Vladimir Marko327497e2019-03-04 12:53:20 +0000486 "libartpalette",
Vladimir Marko74527972016-11-29 15:57:32 +0000487 "libbase",
Colin Cross70f23142019-09-13 17:37:33 -0700488 "libcrypto",
Martin Stjernholm43551622018-11-09 15:14:54 +0000489 "libprofiled",
Vladimir Marko74527972016-11-29 15:57:32 +0000490 "libsigchain",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000491 "libziparchive",
Vladimir Marko74527972016-11-29 15:57:32 +0000492 ],
493 static_libs: [
Vladimir Marko327497e2019-03-04 12:53:20 +0000494 "libart-dex2oat-gtest",
Vladimir Marko74527972016-11-29 15:57:32 +0000495 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700496 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700497}