blob: 17373767c12c635643ec5dc4dfe6db8993e7f2c8 [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",
52 "optimizing/code_generator.cc",
53 "optimizing/code_generator_utils.cc",
54 "optimizing/constant_folding.cc",
55 "optimizing/dead_code_elimination.cc",
56 "optimizing/graph_checker.cc",
57 "optimizing/graph_visualizer.cc",
58 "optimizing/gvn.cc",
59 "optimizing/induction_var_analysis.cc",
60 "optimizing/induction_var_range.cc",
61 "optimizing/inliner.cc",
62 "optimizing/instruction_builder.cc",
63 "optimizing/instruction_simplifier.cc",
64 "optimizing/intrinsics.cc",
65 "optimizing/licm.cc",
Aart Bik96202302016-10-04 17:33:56 -070066 "optimizing/linear_order.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070067 "optimizing/load_store_elimination.cc",
68 "optimizing/locations.cc",
Aart Bik281c6812016-08-26 11:31:48 -070069 "optimizing/loop_optimization.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070070 "optimizing/nodes.cc",
71 "optimizing/optimization.cc",
72 "optimizing/optimizing_compiler.cc",
73 "optimizing/parallel_move_resolver.cc",
74 "optimizing/prepare_for_register_allocation.cc",
75 "optimizing/reference_type_propagation.cc",
76 "optimizing/register_allocation_resolver.cc",
77 "optimizing/register_allocator.cc",
78 "optimizing/register_allocator_graph_color.cc",
79 "optimizing/register_allocator_linear_scan.cc",
80 "optimizing/select_generator.cc",
81 "optimizing/sharpening.cc",
82 "optimizing/side_effects_analysis.cc",
83 "optimizing/ssa_builder.cc",
84 "optimizing/ssa_liveness_analysis.cc",
85 "optimizing/ssa_phi_elimination.cc",
86 "optimizing/stack_map_stream.cc",
87 "trampolines/trampoline_compiler.cc",
88 "utils/assembler.cc",
89 "utils/jni_macro_assembler.cc",
90 "utils/swap_space.cc",
91 "compiler.cc",
92 "elf_writer.cc",
93 "elf_writer_quick.cc",
94 "image_writer.cc",
95 "oat_writer.cc",
96 ],
97
98 codegen: {
99 arm: {
100 srcs: [
101 "jni/quick/arm/calling_convention_arm.cc",
102 "linker/arm/relative_patcher_arm_base.cc",
103 "linker/arm/relative_patcher_thumb2.cc",
104 "optimizing/code_generator_arm.cc",
Scott Wakelingfe885462016-09-22 10:24:38 +0100105 "optimizing/code_generator_arm_vixl.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700106 "optimizing/dex_cache_array_fixups_arm.cc",
107 "optimizing/instruction_simplifier_arm.cc",
108 "optimizing/instruction_simplifier_shared.cc",
109 "optimizing/intrinsics_arm.cc",
Anton Kirilov5ec62182016-10-13 20:16:02 +0100110 "optimizing/intrinsics_arm_vixl.cc",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700111 "utils/arm/assembler_arm.cc",
112 "utils/arm/assembler_arm_vixl.cc",
113 "utils/arm/assembler_thumb2.cc",
114 "utils/arm/jni_macro_assembler_arm.cc",
115 "utils/arm/jni_macro_assembler_arm_vixl.cc",
116 "utils/arm/managed_register_arm.cc",
117 ],
118 },
119 arm64: {
120 srcs: [
121 "jni/quick/arm64/calling_convention_arm64.cc",
122 "linker/arm64/relative_patcher_arm64.cc",
123 "optimizing/code_generator_arm64.cc",
124 "optimizing/instruction_simplifier_arm64.cc",
125 "optimizing/intrinsics_arm64.cc",
126 "optimizing/nodes_arm64.cc",
127 "utils/arm64/assembler_arm64.cc",
128 "utils/arm64/jni_macro_assembler_arm64.cc",
129 "utils/arm64/managed_register_arm64.cc",
130 ],
131 },
132 mips: {
133 srcs: [
134 "jni/quick/mips/calling_convention_mips.cc",
135 "linker/mips/relative_patcher_mips.cc",
136 "optimizing/code_generator_mips.cc",
137 "optimizing/dex_cache_array_fixups_mips.cc",
138 "optimizing/intrinsics_mips.cc",
139 "optimizing/pc_relative_fixups_mips.cc",
140 "utils/mips/assembler_mips.cc",
141 "utils/mips/managed_register_mips.cc",
142 ],
143 },
144 mips64: {
145 srcs: [
146 "jni/quick/mips64/calling_convention_mips64.cc",
147 "optimizing/code_generator_mips64.cc",
148 "optimizing/intrinsics_mips64.cc",
149 "utils/mips64/assembler_mips64.cc",
150 "utils/mips64/managed_register_mips64.cc",
151 ],
152 },
153 x86: {
154 srcs: [
155 "jni/quick/x86/calling_convention_x86.cc",
156 "linker/x86/relative_patcher_x86.cc",
157 "linker/x86/relative_patcher_x86_base.cc",
158 "optimizing/code_generator_x86.cc",
159 "optimizing/intrinsics_x86.cc",
160 "optimizing/pc_relative_fixups_x86.cc",
161 "optimizing/x86_memory_gen.cc",
162 "utils/x86/assembler_x86.cc",
163 "utils/x86/jni_macro_assembler_x86.cc",
164 "utils/x86/managed_register_x86.cc",
165 ],
166 },
167 x86_64: {
168 srcs: [
169 "jni/quick/x86_64/calling_convention_x86_64.cc",
170 "linker/x86_64/relative_patcher_x86_64.cc",
171 "optimizing/intrinsics_x86_64.cc",
172 "optimizing/code_generator_x86_64.cc",
173 "utils/x86_64/assembler_x86_64.cc",
174 "utils/x86_64/jni_macro_assembler_x86_64.cc",
175 "utils/x86_64/managed_register_x86_64.cc",
176 ],
177 },
178 },
179 target: {
180 host: {
181 // For compiler driver TLS.
182 host_ldlibs: ["-lpthread"],
183 },
184 android: {
185 // For atrace.
186 shared_libs: ["libcutils"],
187 },
188 },
189 generated_sources: ["art_compiler_operator_srcs"],
190 shared_libs: [
Andreas Gampe525a58b2016-09-26 18:09:47 -0700191 "libbase",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700192 "liblz4",
193 "liblzma",
194 ],
195 include_dirs: ["art/disassembler"],
Colin Crossfe6064a2016-08-30 13:49:26 -0700196 export_include_dirs: ["."],
Alexey Alexandrovab40c112016-09-19 09:33:49 -0700197
198 // For SHA-1 checksumming of build ID
199 static: {
200 whole_static_libs: ["libcrypto"],
201 },
202 shared: {
203 shared_libs: ["libcrypto"],
204 },
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700205}
206
207gensrcs {
208 name: "art_compiler_operator_srcs",
Colin Crossf657ed02016-11-04 15:31:17 -0700209 cmd: "$(location generate-operator-out.py) art/compiler $(in) > $(out)",
210 tool_files: ["generate-operator-out.py"],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700211 srcs: [
212 "compiled_method.h",
213 "dex/dex_to_dex_compiler.h",
214 "driver/compiler_driver.h",
215 "driver/compiler_options.h",
216 "image_writer.h",
217 "optimizing/locations.h",
218
219 "utils/arm/constants_arm.h",
220 "utils/mips/assembler_mips.h",
221 "utils/mips64/assembler_mips64.h",
222 ],
223 output_extension: "operator_out.cc",
224}
225
226art_cc_library {
227 name: "libart-compiler",
228 defaults: ["libart-compiler-defaults"],
229 codegen: {
Colin Cross766ea432016-08-25 16:22:04 -0700230 arm: {
231 // VIXL assembly support for ARM targets.
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700232 static: {
233 whole_static_libs: [
234 "libvixl-arm",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700235 ],
236 },
237 shared: {
238 shared_libs: [
239 "libvixl-arm",
Colin Cross766ea432016-08-25 16:22:04 -0700240 ],
241 },
242 },
243 arm64: {
244 // VIXL assembly support for ARM64 targets.
245 static: {
246 whole_static_libs: [
247 "libvixl-arm64",
248 ],
249 },
250 shared: {
251 shared_libs: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700252 "libvixl-arm64",
253 ],
254 },
255 },
256 },
Jeff Hao608f2ce2016-10-19 11:17:11 -0700257 shared_libs: [
258 "libart",
259 "libart-dexlayout",
260 ],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700261}
262
263art_cc_library {
264 name: "libartd-compiler",
265 defaults: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700266 "art_debug_defaults",
Colin Crossc5644062016-08-30 15:41:08 -0700267 "libart-compiler-defaults",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700268 ],
269 codegen: {
Colin Cross766ea432016-08-25 16:22:04 -0700270 arm: {
271 // VIXL assembly support for ARM targets.
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700272 static: {
273 whole_static_libs: [
274 "libvixld-arm",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700275 ],
276 },
277 shared: {
278 shared_libs: [
279 "libvixld-arm",
Colin Cross766ea432016-08-25 16:22:04 -0700280 ],
281 },
282 },
283 arm64: {
284 // VIXL assembly support for ARM64 targets.
285 static: {
286 whole_static_libs: [
287 "libvixld-arm64",
288 ],
289 },
290 shared: {
291 shared_libs: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700292 "libvixld-arm64",
293 ],
294 },
295 },
296 },
Jeff Hao608f2ce2016-10-19 11:17:11 -0700297 shared_libs: [
298 "libartd",
299 "libartd-dexlayout"
300 ],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700301}
Colin Cross6b22aa52016-09-12 14:35:39 -0700302
303art_cc_library {
304 name: "libart-compiler-gtest",
305 defaults: ["libart-gtest-defaults"],
306 srcs: ["common_compiler_test.cc"],
307 shared_libs: [
308 "libartd-compiler",
Colin Cross6e95dd52016-09-12 15:37:10 -0700309 "libart-runtime-gtest",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700310 "libbase",
Colin Cross6e95dd52016-09-12 15:37:10 -0700311 ],
312}
313
314art_cc_test {
315 name: "art_compiler_tests",
316 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700317 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700318 ],
319 srcs: [
320 "compiled_method_test.cc",
321 "debug/dwarf/dwarf_test.cc",
Nicolas Geoffray01b70e82016-11-17 10:58:36 +0000322 "dex/dex_to_dex_decompiler_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700323 "driver/compiled_method_storage_test.cc",
324 "driver/compiler_driver_test.cc",
325 "elf_writer_test.cc",
326 "exception_test.cc",
327 "image_test.cc",
328 "jni/jni_compiler_test.cc",
329 "linker/multi_oat_relative_patcher_test.cc",
330 "linker/output_stream_test.cc",
331 "oat_test.cc",
332 "optimizing/bounds_check_elimination_test.cc",
333 "optimizing/dominator_test.cc",
334 "optimizing/find_loops_test.cc",
335 "optimizing/graph_checker_test.cc",
336 "optimizing/graph_test.cc",
337 "optimizing/gvn_test.cc",
338 "optimizing/induction_var_analysis_test.cc",
339 "optimizing/induction_var_range_test.cc",
340 "optimizing/licm_test.cc",
341 "optimizing/live_interval_test.cc",
Aart Bik281c6812016-08-26 11:31:48 -0700342 "optimizing/loop_optimization_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700343 "optimizing/nodes_test.cc",
344 "optimizing/parallel_move_test.cc",
345 "optimizing/pretty_printer_test.cc",
346 "optimizing/reference_type_propagation_test.cc",
347 "optimizing/side_effects_test.cc",
348 "optimizing/ssa_test.cc",
349 "optimizing/stack_map_test.cc",
350 "optimizing/suspend_check_test.cc",
351 "utils/dedupe_set_test.cc",
352 "utils/intrusive_forward_list_test.cc",
353 "utils/string_reference_test.cc",
354 "utils/swap_space_test.cc",
355 "utils/test_dex_file_builder_test.cc",
Nicolas Geoffray08025182016-10-25 17:20:18 +0100356 "verifier_deps_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700357
358 "jni/jni_cfi_test.cc",
359 "optimizing/codegen_test.cc",
360 "optimizing/optimizing_cfi_test.cc",
361 ],
362
363 codegen: {
364 arm: {
365 srcs: [
366 "linker/arm/relative_patcher_thumb2_test.cc",
367 "utils/arm/managed_register_arm_test.cc",
368 ],
369 },
370 arm64: {
371 srcs: [
372 "linker/arm64/relative_patcher_arm64_test.cc",
373 "utils/arm64/managed_register_arm64_test.cc",
374 ],
375 },
376 mips: {
377 srcs: [
378 "linker/mips/relative_patcher_mips_test.cc",
379 "linker/mips/relative_patcher_mips32r6_test.cc",
380 ],
381 },
382 x86: {
383 srcs: [
384 "linker/x86/relative_patcher_x86_test.cc",
385 "utils/x86/managed_register_x86_test.cc",
386
387 // These tests are testing architecture-independent
388 // functionality, but happen to use x86 codegen as part of the
389 // test.
390 "optimizing/constant_folding_test.cc",
391 "optimizing/dead_code_elimination_test.cc",
392 "optimizing/linearize_test.cc",
393 "optimizing/live_ranges_test.cc",
394 "optimizing/liveness_test.cc",
395 "optimizing/register_allocator_test.cc",
396 ],
397 },
398 x86_64: {
399 srcs: [
400 "linker/x86_64/relative_patcher_x86_64_test.cc",
401 ],
402 },
403 },
404
405 shared_libs: [
406 "libartd-compiler",
407 "libvixld-arm",
408 "libvixld-arm64",
409
410 "libbacktrace",
411 "libnativeloader",
412 ],
413}
414
415art_cc_test {
416 name: "art_compiler_host_tests",
417 device_supported: false,
418 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700419 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700420 ],
421 codegen: {
422 arm: {
423 srcs: [
424 "utils/arm/assembler_thumb2_test.cc",
425 "utils/assembler_thumb_test.cc",
426 ],
427 },
428 mips: {
429 srcs: [
Goran Jakovljevic35dfcaa2016-09-22 09:26:01 +0200430 "optimizing/emit_swap_mips_test.cc",
Colin Cross6e95dd52016-09-12 15:37:10 -0700431 "utils/mips/assembler_mips_test.cc",
432 "utils/mips/assembler_mips32r6_test.cc",
433 ],
434 },
435 mips64: {
436 srcs: [
437 "utils/mips64/assembler_mips64_test.cc",
438 ],
439 },
440 x86: {
441 srcs: [
442 "utils/x86/assembler_x86_test.cc",
443 ],
444 },
445 x86_64: {
446 srcs: [
447 "utils/x86_64/assembler_x86_64_test.cc",
448 ],
449 },
450 },
451 shared_libs: [
452 "libartd-compiler",
453 "libvixld-arm",
454 "libvixld-arm64",
Colin Cross6b22aa52016-09-12 14:35:39 -0700455 ],
456}