blob: c59e36b59705d0e0b88ae18de4b97aa439c94e42 [file] [log] [blame]
Colin Cross1f7f3bd2016-07-27 10:12:38 -07001//
2// Copyright (C) 2012 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
17// TODO We should really separate out those files that are actually needed for both variants of an
18// architecture into its own category. Currently we just include all of the 32bit variant in the
19// 64bit variant. It also might be good to allow one to compile only the 64bit variant without the
20// 32bit one.
21
22art_cc_defaults {
23 name: "libart-compiler-defaults",
24 defaults: ["art_defaults"],
25 host_supported: true,
26 clang: true,
27 srcs: [
28 "compiled_method.cc",
29 "debug/elf_debug_writer.cc",
30 "dex/dex_to_dex_compiler.cc",
Nicolas Geoffray01b70e82016-11-17 10:58:36 +000031 "dex/dex_to_dex_decompiler.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070032 "dex/verified_method.cc",
33 "dex/verification_results.cc",
34 "dex/quick_compiler_callbacks.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070035 "driver/compiled_method_storage.cc",
36 "driver/compiler_driver.cc",
37 "driver/compiler_options.cc",
38 "driver/dex_compilation_unit.cc",
39 "linker/buffered_output_stream.cc",
40 "linker/file_output_stream.cc",
41 "linker/multi_oat_relative_patcher.cc",
42 "linker/output_stream.cc",
43 "linker/vector_output_stream.cc",
44 "linker/relative_patcher.cc",
45 "jit/jit_compiler.cc",
xueliang.zhong383b57d2016-10-04 11:19:17 +010046 "jit/jit_logger.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070047 "jni/quick/calling_convention.cc",
48 "jni/quick/jni_compiler.cc",
49 "optimizing/block_builder.cc",
50 "optimizing/bounds_check_elimination.cc",
51 "optimizing/builder.cc",
Mingyao Yangb0b051a2016-11-17 09:04:53 -080052 "optimizing/cha_guard_optimization.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070053 "optimizing/code_generator.cc",
54 "optimizing/code_generator_utils.cc",
Nicolas Geoffrayb813ca12017-02-16 22:08:29 +000055 "optimizing/code_sinking.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070056 "optimizing/constant_folding.cc",
57 "optimizing/dead_code_elimination.cc",
Aart Bik96fd51d2016-11-28 11:22:35 -080058 "optimizing/escape.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070059 "optimizing/graph_checker.cc",
60 "optimizing/graph_visualizer.cc",
61 "optimizing/gvn.cc",
62 "optimizing/induction_var_analysis.cc",
63 "optimizing/induction_var_range.cc",
64 "optimizing/inliner.cc",
65 "optimizing/instruction_builder.cc",
66 "optimizing/instruction_simplifier.cc",
67 "optimizing/intrinsics.cc",
68 "optimizing/licm.cc",
Aart Bik96202302016-10-04 17:33:56 -070069 "optimizing/linear_order.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070070 "optimizing/load_store_elimination.cc",
71 "optimizing/locations.cc",
Aart Bik281c6812016-08-26 11:31:48 -070072 "optimizing/loop_optimization.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070073 "optimizing/nodes.cc",
74 "optimizing/optimization.cc",
75 "optimizing/optimizing_compiler.cc",
76 "optimizing/parallel_move_resolver.cc",
77 "optimizing/prepare_for_register_allocation.cc",
78 "optimizing/reference_type_propagation.cc",
79 "optimizing/register_allocation_resolver.cc",
80 "optimizing/register_allocator.cc",
81 "optimizing/register_allocator_graph_color.cc",
82 "optimizing/register_allocator_linear_scan.cc",
83 "optimizing/select_generator.cc",
Alexandre Rames22aa54b2016-10-18 09:32:29 +010084 "optimizing/scheduler.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070085 "optimizing/sharpening.cc",
86 "optimizing/side_effects_analysis.cc",
87 "optimizing/ssa_builder.cc",
88 "optimizing/ssa_liveness_analysis.cc",
89 "optimizing/ssa_phi_elimination.cc",
90 "optimizing/stack_map_stream.cc",
91 "trampolines/trampoline_compiler.cc",
92 "utils/assembler.cc",
93 "utils/jni_macro_assembler.cc",
94 "utils/swap_space.cc",
95 "compiler.cc",
96 "elf_writer.cc",
97 "elf_writer_quick.cc",
98 "image_writer.cc",
99 "oat_writer.cc",
100 ],
101
102 codegen: {
103 arm: {
104 srcs: [
105 "jni/quick/arm/calling_convention_arm.cc",
106 "linker/arm/relative_patcher_arm_base.cc",
107 "linker/arm/relative_patcher_thumb2.cc",
108 "optimizing/code_generator_arm.cc",
Scott Wakelingfe885462016-09-22 10:24:38 +0100109 "optimizing/code_generator_arm_vixl.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700110 "optimizing/dex_cache_array_fixups_arm.cc",
111 "optimizing/instruction_simplifier_arm.cc",
112 "optimizing/instruction_simplifier_shared.cc",
113 "optimizing/intrinsics_arm.cc",
Anton Kirilov5ec62182016-10-13 20:16:02 +0100114 "optimizing/intrinsics_arm_vixl.cc",
Anton Kirilov74234da2017-01-13 14:42:47 +0000115 "optimizing/nodes_shared.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700116 "utils/arm/assembler_arm.cc",
117 "utils/arm/assembler_arm_vixl.cc",
118 "utils/arm/assembler_thumb2.cc",
119 "utils/arm/jni_macro_assembler_arm.cc",
120 "utils/arm/jni_macro_assembler_arm_vixl.cc",
121 "utils/arm/managed_register_arm.cc",
122 ],
123 },
124 arm64: {
125 srcs: [
126 "jni/quick/arm64/calling_convention_arm64.cc",
127 "linker/arm64/relative_patcher_arm64.cc",
128 "optimizing/code_generator_arm64.cc",
Alexandre Rames22aa54b2016-10-18 09:32:29 +0100129 "optimizing/scheduler_arm64.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700130 "optimizing/instruction_simplifier_arm64.cc",
131 "optimizing/intrinsics_arm64.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700132 "utils/arm64/assembler_arm64.cc",
133 "utils/arm64/jni_macro_assembler_arm64.cc",
134 "utils/arm64/managed_register_arm64.cc",
135 ],
136 },
137 mips: {
138 srcs: [
139 "jni/quick/mips/calling_convention_mips.cc",
140 "linker/mips/relative_patcher_mips.cc",
141 "optimizing/code_generator_mips.cc",
142 "optimizing/dex_cache_array_fixups_mips.cc",
143 "optimizing/intrinsics_mips.cc",
144 "optimizing/pc_relative_fixups_mips.cc",
145 "utils/mips/assembler_mips.cc",
146 "utils/mips/managed_register_mips.cc",
147 ],
148 },
149 mips64: {
150 srcs: [
151 "jni/quick/mips64/calling_convention_mips64.cc",
Alexey Frunze19f6c692016-11-30 19:19:55 -0800152 "linker/mips64/relative_patcher_mips64.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700153 "optimizing/code_generator_mips64.cc",
154 "optimizing/intrinsics_mips64.cc",
155 "utils/mips64/assembler_mips64.cc",
156 "utils/mips64/managed_register_mips64.cc",
157 ],
158 },
159 x86: {
160 srcs: [
161 "jni/quick/x86/calling_convention_x86.cc",
162 "linker/x86/relative_patcher_x86.cc",
163 "linker/x86/relative_patcher_x86_base.cc",
164 "optimizing/code_generator_x86.cc",
165 "optimizing/intrinsics_x86.cc",
166 "optimizing/pc_relative_fixups_x86.cc",
167 "optimizing/x86_memory_gen.cc",
168 "utils/x86/assembler_x86.cc",
169 "utils/x86/jni_macro_assembler_x86.cc",
170 "utils/x86/managed_register_x86.cc",
171 ],
172 },
173 x86_64: {
174 srcs: [
175 "jni/quick/x86_64/calling_convention_x86_64.cc",
176 "linker/x86_64/relative_patcher_x86_64.cc",
177 "optimizing/intrinsics_x86_64.cc",
178 "optimizing/code_generator_x86_64.cc",
179 "utils/x86_64/assembler_x86_64.cc",
180 "utils/x86_64/jni_macro_assembler_x86_64.cc",
181 "utils/x86_64/managed_register_x86_64.cc",
182 ],
183 },
184 },
185 target: {
186 host: {
187 // For compiler driver TLS.
188 host_ldlibs: ["-lpthread"],
189 },
190 android: {
191 // For atrace.
192 shared_libs: ["libcutils"],
193 },
194 },
195 generated_sources: ["art_compiler_operator_srcs"],
196 shared_libs: [
Andreas Gampe525a58b2016-09-26 18:09:47 -0700197 "libbase",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700198 "liblz4",
199 "liblzma",
200 ],
201 include_dirs: ["art/disassembler"],
Colin Crossfe6064a2016-08-30 13:49:26 -0700202 export_include_dirs: ["."],
Alexey Alexandrovab40c112016-09-19 09:33:49 -0700203
204 // For SHA-1 checksumming of build ID
205 static: {
206 whole_static_libs: ["libcrypto"],
207 },
208 shared: {
209 shared_libs: ["libcrypto"],
210 },
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700211}
212
213gensrcs {
214 name: "art_compiler_operator_srcs",
Colin Crossf657ed02016-11-04 15:31:17 -0700215 cmd: "$(location generate-operator-out.py) art/compiler $(in) > $(out)",
216 tool_files: ["generate-operator-out.py"],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700217 srcs: [
218 "compiled_method.h",
219 "dex/dex_to_dex_compiler.h",
220 "driver/compiler_driver.h",
221 "driver/compiler_options.h",
222 "image_writer.h",
223 "optimizing/locations.h",
224
225 "utils/arm/constants_arm.h",
226 "utils/mips/assembler_mips.h",
227 "utils/mips64/assembler_mips64.h",
228 ],
229 output_extension: "operator_out.cc",
230}
231
232art_cc_library {
233 name: "libart-compiler",
234 defaults: ["libart-compiler-defaults"],
235 codegen: {
Colin Cross766ea432016-08-25 16:22:04 -0700236 arm: {
237 // VIXL assembly support for ARM targets.
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700238 static: {
239 whole_static_libs: [
240 "libvixl-arm",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700241 ],
242 },
243 shared: {
244 shared_libs: [
245 "libvixl-arm",
Colin Cross766ea432016-08-25 16:22:04 -0700246 ],
247 },
248 },
249 arm64: {
250 // VIXL assembly support for ARM64 targets.
251 static: {
252 whole_static_libs: [
253 "libvixl-arm64",
254 ],
255 },
256 shared: {
257 shared_libs: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700258 "libvixl-arm64",
259 ],
260 },
261 },
262 },
Jeff Hao608f2ce2016-10-19 11:17:11 -0700263 shared_libs: [
264 "libart",
265 "libart-dexlayout",
266 ],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700267}
268
269art_cc_library {
270 name: "libartd-compiler",
271 defaults: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700272 "art_debug_defaults",
Colin Crossc5644062016-08-30 15:41:08 -0700273 "libart-compiler-defaults",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700274 ],
275 codegen: {
Colin Cross766ea432016-08-25 16:22:04 -0700276 arm: {
277 // VIXL assembly support for ARM targets.
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700278 static: {
279 whole_static_libs: [
280 "libvixld-arm",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700281 ],
282 },
283 shared: {
284 shared_libs: [
285 "libvixld-arm",
Colin Cross766ea432016-08-25 16:22:04 -0700286 ],
287 },
288 },
289 arm64: {
290 // VIXL assembly support for ARM64 targets.
291 static: {
292 whole_static_libs: [
293 "libvixld-arm64",
294 ],
295 },
296 shared: {
297 shared_libs: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700298 "libvixld-arm64",
299 ],
300 },
301 },
302 },
Jeff Hao608f2ce2016-10-19 11:17:11 -0700303 shared_libs: [
304 "libartd",
305 "libartd-dexlayout"
306 ],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700307}
Colin Cross6b22aa52016-09-12 14:35:39 -0700308
309art_cc_library {
310 name: "libart-compiler-gtest",
311 defaults: ["libart-gtest-defaults"],
312 srcs: ["common_compiler_test.cc"],
313 shared_libs: [
314 "libartd-compiler",
Colin Cross6e95dd52016-09-12 15:37:10 -0700315 "libart-runtime-gtest",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700316 "libbase",
Colin Cross6e95dd52016-09-12 15:37:10 -0700317 ],
318}
319
320art_cc_test {
321 name: "art_compiler_tests",
322 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700323 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700324 ],
325 srcs: [
326 "compiled_method_test.cc",
327 "debug/dwarf/dwarf_test.cc",
Nicolas Geoffray01b70e82016-11-17 10:58:36 +0000328 "dex/dex_to_dex_decompiler_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700329 "driver/compiled_method_storage_test.cc",
330 "driver/compiler_driver_test.cc",
331 "elf_writer_test.cc",
332 "exception_test.cc",
333 "image_test.cc",
334 "jni/jni_compiler_test.cc",
335 "linker/multi_oat_relative_patcher_test.cc",
336 "linker/output_stream_test.cc",
337 "oat_test.cc",
338 "optimizing/bounds_check_elimination_test.cc",
339 "optimizing/dominator_test.cc",
340 "optimizing/find_loops_test.cc",
341 "optimizing/graph_checker_test.cc",
342 "optimizing/graph_test.cc",
343 "optimizing/gvn_test.cc",
344 "optimizing/induction_var_analysis_test.cc",
345 "optimizing/induction_var_range_test.cc",
346 "optimizing/licm_test.cc",
347 "optimizing/live_interval_test.cc",
Aart Bik281c6812016-08-26 11:31:48 -0700348 "optimizing/loop_optimization_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700349 "optimizing/nodes_test.cc",
350 "optimizing/parallel_move_test.cc",
351 "optimizing/pretty_printer_test.cc",
352 "optimizing/reference_type_propagation_test.cc",
353 "optimizing/side_effects_test.cc",
354 "optimizing/ssa_test.cc",
355 "optimizing/stack_map_test.cc",
356 "optimizing/suspend_check_test.cc",
Mathieu Chartier9df89312016-11-23 13:28:16 -0800357 "utils/atomic_method_ref_map_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700358 "utils/dedupe_set_test.cc",
359 "utils/intrusive_forward_list_test.cc",
360 "utils/string_reference_test.cc",
361 "utils/swap_space_test.cc",
362 "utils/test_dex_file_builder_test.cc",
Nicolas Geoffray08025182016-10-25 17:20:18 +0100363 "verifier_deps_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700364
365 "jni/jni_cfi_test.cc",
366 "optimizing/codegen_test.cc",
367 "optimizing/optimizing_cfi_test.cc",
Alexandre Rames22aa54b2016-10-18 09:32:29 +0100368 "optimizing/scheduler_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700369 ],
370
371 codegen: {
372 arm: {
373 srcs: [
374 "linker/arm/relative_patcher_thumb2_test.cc",
375 "utils/arm/managed_register_arm_test.cc",
376 ],
377 },
378 arm64: {
379 srcs: [
380 "linker/arm64/relative_patcher_arm64_test.cc",
381 "utils/arm64/managed_register_arm64_test.cc",
382 ],
383 },
384 mips: {
385 srcs: [
386 "linker/mips/relative_patcher_mips_test.cc",
387 "linker/mips/relative_patcher_mips32r6_test.cc",
388 ],
389 },
Alexey Frunze19f6c692016-11-30 19:19:55 -0800390 mips64: {
391 srcs: [
392 "linker/mips64/relative_patcher_mips64_test.cc",
393 ],
394 },
Colin Cross6e95dd52016-09-12 15:37:10 -0700395 x86: {
396 srcs: [
397 "linker/x86/relative_patcher_x86_test.cc",
398 "utils/x86/managed_register_x86_test.cc",
399
400 // These tests are testing architecture-independent
401 // functionality, but happen to use x86 codegen as part of the
402 // test.
403 "optimizing/constant_folding_test.cc",
404 "optimizing/dead_code_elimination_test.cc",
405 "optimizing/linearize_test.cc",
406 "optimizing/live_ranges_test.cc",
407 "optimizing/liveness_test.cc",
408 "optimizing/register_allocator_test.cc",
409 ],
410 },
411 x86_64: {
412 srcs: [
413 "linker/x86_64/relative_patcher_x86_64_test.cc",
414 ],
415 },
416 },
417
418 shared_libs: [
419 "libartd-compiler",
Narayan Kamath9a193f62017-03-08 14:14:58 +0000420 "libartd-simulator",
Colin Cross6e95dd52016-09-12 15:37:10 -0700421 "libvixld-arm",
422 "libvixld-arm64",
423
424 "libbacktrace",
425 "libnativeloader",
426 ],
427}
428
429art_cc_test {
430 name: "art_compiler_host_tests",
431 device_supported: false,
432 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700433 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700434 ],
435 codegen: {
436 arm: {
437 srcs: [
438 "utils/arm/assembler_thumb2_test.cc",
439 "utils/assembler_thumb_test.cc",
440 ],
441 },
442 mips: {
443 srcs: [
Goran Jakovljevic35dfcaa2016-09-22 09:26:01 +0200444 "optimizing/emit_swap_mips_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700445 "utils/mips/assembler_mips_test.cc",
446 "utils/mips/assembler_mips32r6_test.cc",
447 ],
448 },
449 mips64: {
450 srcs: [
451 "utils/mips64/assembler_mips64_test.cc",
452 ],
453 },
454 x86: {
455 srcs: [
456 "utils/x86/assembler_x86_test.cc",
457 ],
458 },
459 x86_64: {
460 srcs: [
461 "utils/x86_64/assembler_x86_64_test.cc",
462 ],
463 },
464 },
465 shared_libs: [
466 "libartd-compiler",
467 "libvixld-arm",
468 "libvixld-arm64",
Colin Cross6b22aa52016-09-12 14:35:39 -0700469 ],
470}