blob: cb59bc235920d9871ae1f52a6236954d82196aae [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 ],
121}
122
Andreas Gampeec5ed062018-01-26 16:20:02 -0800123cc_defaults {
124 name: "libart-dex2oat_static_defaults",
125 defaults: [
126 "libart-dex2oat_static_base_defaults",
127 "libart_static_defaults",
128 "libprofile_static_defaults",
129 ],
130 static_libs: [
131 "libart-compiler",
132 "libart-dexlayout",
133 "libart-dex2oat",
134 ],
135}
136
Steven Moreland73030ed2019-01-03 14:23:28 -0800137art_cc_library_static {
Vladimir Marko74527972016-11-29 15:57:32 +0000138 name: "libartd-dex2oat",
139 defaults: [
140 "art_debug_defaults",
141 "libart-dex2oat-defaults",
142 ],
143 shared_libs: [
144 "libartd-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800145 "libartd-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700146 "libartd",
Vladimir Marko327497e2019-03-04 12:53:20 +0000147 "libartpalette",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700148 "libprofiled",
Vladimir Marko74527972016-11-29 15:57:32 +0000149 ],
150}
151
Andreas Gampeec5ed062018-01-26 16:20:02 -0800152cc_defaults {
153 name: "libartd-dex2oat_static_defaults",
154 defaults: [
155 "libart-dex2oat_static_base_defaults",
156 "libartd_static_defaults",
157 "libprofiled_static_defaults",
158 ],
159 static_libs: [
160 "libartd-compiler",
161 "libartd-dexlayout",
162 "libartd-dex2oat",
163 ],
164}
165
Andreas Gampe7b565912017-03-20 15:48:52 -0700166cc_library_headers {
167 name: "dex2oat_headers",
168 host_supported: true,
169 export_include_dirs: ["include"],
170}
171
Colin Crossc7376e02016-09-08 12:52:18 -0700172cc_defaults {
173 name: "dex2oat-defaults",
174 host_supported: true,
175 defaults: ["art_defaults"],
Andreas Gampe097f34c2017-08-23 08:57:51 -0700176 srcs: [
177 "dex2oat_options.cc",
178 "dex2oat.cc",
179 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700180
181 target: {
182 android: {
Roland Levillain38a938e2018-09-21 10:55:51 +0100183 // Use the 32-bit version of dex2oat on devices.
Colin Crossc7376e02016-09-08 12:52:18 -0700184 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700185 },
Colin Crossc7376e02016-09-08 12:52:18 -0700186 },
Andreas Gampe3157fc22017-08-23 09:43:46 -0700187 header_libs: [
188 "dex2oat_headers",
189 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700190 ],
191}
192
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700193cc_defaults {
194 name: "dex2oat-pgo-defaults",
195 pgo: {
196 instrumentation: true,
197 benchmarks: ["dex2oat"],
198 },
199 target: {
200 android_arm64: {
201 pgo: {
202 profile_file: "art/dex2oat_arm_arm64.profdata",
203 },
204 },
205 android_arm: {
206 pgo: {
207 profile_file: "art/dex2oat_arm_arm64.profdata",
208 },
209 },
210 android_x86_64: {
211 pgo: {
212 profile_file: "art/dex2oat_x86_x86_64.profdata",
213 },
214 },
215 android_x86: {
216 pgo: {
217 profile_file: "art/dex2oat_x86_x86_64.profdata",
218 },
219 },
Pirama Arumuga Nainarfc1de872018-04-20 14:11:12 -0700220 android_mips64: {
221 pgo: {
222 profile_file: "art/dex2oat_mips_mips64.profdata",
223 },
224 },
225 android_mips: {
226 pgo: {
227 profile_file: "art/dex2oat_mips_mips64.profdata",
228 },
229 },
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700230 },
231}
232
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100233art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700234 name: "dex2oat",
235 defaults: [
236 "dex2oat-defaults",
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700237 "dex2oat-pgo-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700238 ],
239 shared_libs: [
David Sehr82d046e2018-04-23 08:14:19 -0700240 "libprofile",
Colin Crossc7376e02016-09-08 12:52:18 -0700241 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000242 "libart-dexlayout",
243 "libart",
Colin Cross70f23142019-09-13 17:37:33 -0700244 "libcrypto",
David Sehr0225f8e2018-01-31 08:52:24 +0000245 "libdexfile",
David Sehr1f010162018-05-15 08:59:32 -0700246 "libartbase",
Vladimir Marko327497e2019-03-04 12:53:20 +0000247 "libartpalette",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700248 "libbase",
Colin Crossc7376e02016-09-08 12:52:18 -0700249 "libsigchain",
250 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000251 static_libs: [
252 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700253 ],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800254
255 pgo: {
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700256 // Additional cflags just for dex2oat during PGO instrumentation
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800257 cflags: [
258 // Ignore frame-size increase resulting from instrumentation.
259 "-Wno-frame-larger-than=",
260 "-DART_PGO_INSTRUMENTATION",
261 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800262 },
263 target: {
264 android: {
265 lto: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700266 thin: true,
Yi Kong1d894d92018-01-19 22:01:14 -0800267 },
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000268 static_libs: [
269 "libz",
270 ],
271 },
272 host: {
273 shared_libs: [
274 "libz",
275 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800276 },
277 },
Colin Crossc7376e02016-09-08 12:52:18 -0700278}
279
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100280art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700281 name: "dex2oatd",
282 defaults: [
283 "art_debug_defaults",
284 "dex2oat-defaults",
285 ],
286 shared_libs: [
David Sehr82d046e2018-04-23 08:14:19 -0700287 "libprofiled",
Colin Crossc7376e02016-09-08 12:52:18 -0700288 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000289 "libartd-dexlayout",
290 "libartd",
Colin Cross70f23142019-09-13 17:37:33 -0700291 "libcrypto",
David Sehrfcbe15c2018-02-15 09:41:13 -0800292 "libdexfiled",
David Sehr1f010162018-05-15 08:59:32 -0700293 "libartbased",
Vladimir Marko327497e2019-03-04 12:53:20 +0000294 "libartpalette",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700295 "libbase",
Colin Crossc7376e02016-09-08 12:52:18 -0700296 "libsigchain",
297 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000298 static_libs: [
299 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700300 ],
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000301 target: {
302 android: {
303 static_libs: [
304 "libz",
305 ],
Roland Levillain9a45d012019-06-05 13:54:02 +0100306 compile_multilib: "prefer32",
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000307 },
308 host: {
309 shared_libs: [
310 "libz",
311 ],
Alex Light907001d2019-01-17 00:16:04 +0000312 compile_multilib: "both",
Roland Levillain9a45d012019-06-05 13:54:02 +0100313 symlink_preferred_arch: true,
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000314 },
Roland Levillain9a45d012019-06-05 13:54:02 +0100315 linux_glibc_x86: {
Alex Light907001d2019-01-17 00:16:04 +0000316 suffix: "32",
317 },
Roland Levillain9a45d012019-06-05 13:54:02 +0100318 linux_glibc_x86_64: {
319 suffix: "64",
320 },
321 linux_bionic_x86_64: {
Alex Light907001d2019-01-17 00:16:04 +0000322 suffix: "64",
323 },
324 },
Colin Crossc7376e02016-09-08 12:52:18 -0700325}
326
Andreas Gampe11bf2652018-07-10 14:21:15 -0700327cc_defaults {
328 name: "dex2oats-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700329 device_supported: false,
330 static_executable: true,
Andreas Gampeec5ed062018-01-26 16:20:02 -0800331 defaults: [
332 "dex2oat-defaults",
333 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700334 target: {
335 darwin: {
336 enabled: false,
337 },
338 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700339 ldflags: [
340 // We need this because GC stress mode makes use of
341 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
342 // defined in libgcc_eh.a(unwind-dw2.o)
343 // TODO: Having this is not ideal as it might obscure errors.
344 // Try to get rid of it.
345 "-z muldefs",
346 ],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800347 static_libs: [
348 "libbase",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800349 "libsigchain_dummy",
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000350 "libz",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800351 ],
Andreas Gampe11bf2652018-07-10 14:21:15 -0700352}
353
354art_cc_binary {
355 name: "dex2oats",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800356 defaults: [
357 "dex2oats-defaults",
358 "libart_static_defaults",
359 "libart-compiler_static_defaults",
360 "libart-dexlayout_static_defaults",
361 "libartbase_static_defaults",
362 "libdexfile_static_defaults",
363 "libprofile_static_defaults",
364 "libart-dex2oat_static_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700365 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700366}
367
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100368art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700369 name: "dex2oatds",
Colin Crossc7376e02016-09-08 12:52:18 -0700370 defaults: [
371 "art_debug_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700372 "dex2oats-defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800373 "libartd_static_defaults",
374 "libartd-compiler_static_defaults",
375 "libartd-dexlayout_static_defaults",
376 "libartbased_static_defaults",
377 "libdexfiled_static_defaults",
378 "libprofiled_static_defaults",
379 "libartd-dex2oat_static_defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700380 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700381 target: {
Pirama Arumuga Nainar6f5b4d22018-04-20 12:02:02 -0700382 linux_glibc_x86_64: {
383 use_clang_lld: true,
384 },
Colin Crossaa63aa22016-09-13 14:07:00 -0700385 },
Colin Crossc7376e02016-09-08 12:52:18 -0700386}
Colin Cross6e95dd52016-09-12 15:37:10 -0700387
Vladimir Marko327497e2019-03-04 12:53:20 +0000388art_cc_library_static {
389 name: "libart-dex2oat-gtest",
390 defaults: ["libart-gtest-defaults"],
391 srcs: [
392 "common_compiler_driver_test.cc",
393 ],
394 shared_libs: [
395 "libartd-compiler",
396 "libartd-disassembler",
397 "libart-compiler-gtest",
398 "libart-runtime-gtest",
399 "libbase",
400 ],
401 static_libs: [
402 "libartd-dex2oat",
403 ],
404}
405
Colin Cross6e95dd52016-09-12 15:37:10 -0700406art_cc_test {
407 name: "art_dex2oat_tests",
408 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700409 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700410 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700411 srcs: [
412 "dex2oat_test.cc",
413 "dex2oat_image_test.cc",
Vladimir Marko327497e2019-03-04 12:53:20 +0000414 "dex/dex_to_dex_decompiler_test.cc",
415 "driver/compiler_driver_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000416 "linker/elf_writer_test.cc",
417 "linker/image_test.cc",
418 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000419 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000420 "linker/multi_oat_relative_patcher_test.cc",
421 "linker/oat_writer_test.cc",
Vladimir Marko327497e2019-03-04 12:53:20 +0000422 "verifier_deps_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700423 ],
Vladimir Marko6d66fcf2018-04-12 13:15:27 +0100424
425 codegen: {
426 arm: {
427 srcs: [
428 "linker/arm/relative_patcher_thumb2_test.cc",
429 ],
430 },
431 arm64: {
432 srcs: [
433 "linker/arm64/relative_patcher_arm64_test.cc",
434 ],
435 },
436 mips: {
437 srcs: [
438 "linker/mips/relative_patcher_mips_test.cc",
439 "linker/mips/relative_patcher_mips32r6_test.cc",
440 ],
441 },
442 mips64: {
443 srcs: [
444 "linker/mips64/relative_patcher_mips64_test.cc",
445 ],
446 },
447 x86: {
448 srcs: [
449 "linker/x86/relative_patcher_x86_test.cc",
450 ],
451 },
452 x86_64: {
453 srcs: [
454 "linker/x86_64/relative_patcher_x86_64_test.cc",
455 ],
456 },
457 },
458
Andreas Gampef7882972017-03-20 16:35:24 -0700459 header_libs: ["dex2oat_headers"],
Vladimir Marko74527972016-11-29 15:57:32 +0000460 shared_libs: [
Martin Stjernholm43551622018-11-09 15:14:54 +0000461 "libartbased",
Vladimir Marko74527972016-11-29 15:57:32 +0000462 "libartd-compiler",
463 "libartd-dexlayout",
Vladimir Marko327497e2019-03-04 12:53:20 +0000464 "libartpalette",
Vladimir Marko74527972016-11-29 15:57:32 +0000465 "libbase",
Colin Cross70f23142019-09-13 17:37:33 -0700466 "libcrypto",
Martin Stjernholm43551622018-11-09 15:14:54 +0000467 "libprofiled",
Vladimir Marko74527972016-11-29 15:57:32 +0000468 "libsigchain",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000469 "libziparchive",
Vladimir Marko74527972016-11-29 15:57:32 +0000470 ],
471 static_libs: [
Vladimir Marko327497e2019-03-04 12:53:20 +0000472 "libart-dex2oat-gtest",
Vladimir Marko74527972016-11-29 15:57:32 +0000473 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700474 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700475}