Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 1 | // |
| 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 | |
| 22 | art_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", |
| 31 | "dex/verified_method.cc", |
| 32 | "dex/verification_results.cc", |
| 33 | "dex/quick_compiler_callbacks.cc", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 34 | "driver/compiled_method_storage.cc", |
| 35 | "driver/compiler_driver.cc", |
| 36 | "driver/compiler_options.cc", |
| 37 | "driver/dex_compilation_unit.cc", |
| 38 | "linker/buffered_output_stream.cc", |
| 39 | "linker/file_output_stream.cc", |
| 40 | "linker/multi_oat_relative_patcher.cc", |
| 41 | "linker/output_stream.cc", |
| 42 | "linker/vector_output_stream.cc", |
| 43 | "linker/relative_patcher.cc", |
| 44 | "jit/jit_compiler.cc", |
| 45 | "jni/quick/calling_convention.cc", |
| 46 | "jni/quick/jni_compiler.cc", |
| 47 | "optimizing/block_builder.cc", |
| 48 | "optimizing/bounds_check_elimination.cc", |
| 49 | "optimizing/builder.cc", |
| 50 | "optimizing/code_generator.cc", |
| 51 | "optimizing/code_generator_utils.cc", |
| 52 | "optimizing/constant_folding.cc", |
| 53 | "optimizing/dead_code_elimination.cc", |
| 54 | "optimizing/graph_checker.cc", |
| 55 | "optimizing/graph_visualizer.cc", |
| 56 | "optimizing/gvn.cc", |
| 57 | "optimizing/induction_var_analysis.cc", |
| 58 | "optimizing/induction_var_range.cc", |
| 59 | "optimizing/inliner.cc", |
| 60 | "optimizing/instruction_builder.cc", |
| 61 | "optimizing/instruction_simplifier.cc", |
| 62 | "optimizing/intrinsics.cc", |
| 63 | "optimizing/licm.cc", |
Aart Bik | 9620230 | 2016-10-04 17:33:56 -0700 | [diff] [blame] | 64 | "optimizing/linear_order.cc", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 65 | "optimizing/load_store_elimination.cc", |
| 66 | "optimizing/locations.cc", |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 67 | "optimizing/loop_optimization.cc", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 68 | "optimizing/nodes.cc", |
| 69 | "optimizing/optimization.cc", |
| 70 | "optimizing/optimizing_compiler.cc", |
| 71 | "optimizing/parallel_move_resolver.cc", |
| 72 | "optimizing/prepare_for_register_allocation.cc", |
| 73 | "optimizing/reference_type_propagation.cc", |
| 74 | "optimizing/register_allocation_resolver.cc", |
| 75 | "optimizing/register_allocator.cc", |
| 76 | "optimizing/register_allocator_graph_color.cc", |
| 77 | "optimizing/register_allocator_linear_scan.cc", |
| 78 | "optimizing/select_generator.cc", |
| 79 | "optimizing/sharpening.cc", |
| 80 | "optimizing/side_effects_analysis.cc", |
| 81 | "optimizing/ssa_builder.cc", |
| 82 | "optimizing/ssa_liveness_analysis.cc", |
| 83 | "optimizing/ssa_phi_elimination.cc", |
| 84 | "optimizing/stack_map_stream.cc", |
| 85 | "trampolines/trampoline_compiler.cc", |
| 86 | "utils/assembler.cc", |
| 87 | "utils/jni_macro_assembler.cc", |
| 88 | "utils/swap_space.cc", |
| 89 | "compiler.cc", |
| 90 | "elf_writer.cc", |
| 91 | "elf_writer_quick.cc", |
| 92 | "image_writer.cc", |
| 93 | "oat_writer.cc", |
| 94 | ], |
| 95 | |
| 96 | codegen: { |
| 97 | arm: { |
| 98 | srcs: [ |
| 99 | "jni/quick/arm/calling_convention_arm.cc", |
| 100 | "linker/arm/relative_patcher_arm_base.cc", |
| 101 | "linker/arm/relative_patcher_thumb2.cc", |
| 102 | "optimizing/code_generator_arm.cc", |
Scott Wakeling | fe88546 | 2016-09-22 10:24:38 +0100 | [diff] [blame] | 103 | "optimizing/code_generator_arm_vixl.cc", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 104 | "optimizing/dex_cache_array_fixups_arm.cc", |
| 105 | "optimizing/instruction_simplifier_arm.cc", |
| 106 | "optimizing/instruction_simplifier_shared.cc", |
| 107 | "optimizing/intrinsics_arm.cc", |
| 108 | "utils/arm/assembler_arm.cc", |
| 109 | "utils/arm/assembler_arm_vixl.cc", |
| 110 | "utils/arm/assembler_thumb2.cc", |
| 111 | "utils/arm/jni_macro_assembler_arm.cc", |
| 112 | "utils/arm/jni_macro_assembler_arm_vixl.cc", |
| 113 | "utils/arm/managed_register_arm.cc", |
| 114 | ], |
| 115 | }, |
| 116 | arm64: { |
| 117 | srcs: [ |
| 118 | "jni/quick/arm64/calling_convention_arm64.cc", |
| 119 | "linker/arm64/relative_patcher_arm64.cc", |
| 120 | "optimizing/code_generator_arm64.cc", |
| 121 | "optimizing/instruction_simplifier_arm64.cc", |
| 122 | "optimizing/intrinsics_arm64.cc", |
| 123 | "optimizing/nodes_arm64.cc", |
| 124 | "utils/arm64/assembler_arm64.cc", |
| 125 | "utils/arm64/jni_macro_assembler_arm64.cc", |
| 126 | "utils/arm64/managed_register_arm64.cc", |
| 127 | ], |
| 128 | }, |
| 129 | mips: { |
| 130 | srcs: [ |
| 131 | "jni/quick/mips/calling_convention_mips.cc", |
| 132 | "linker/mips/relative_patcher_mips.cc", |
| 133 | "optimizing/code_generator_mips.cc", |
| 134 | "optimizing/dex_cache_array_fixups_mips.cc", |
| 135 | "optimizing/intrinsics_mips.cc", |
| 136 | "optimizing/pc_relative_fixups_mips.cc", |
| 137 | "utils/mips/assembler_mips.cc", |
| 138 | "utils/mips/managed_register_mips.cc", |
| 139 | ], |
| 140 | }, |
| 141 | mips64: { |
| 142 | srcs: [ |
| 143 | "jni/quick/mips64/calling_convention_mips64.cc", |
| 144 | "optimizing/code_generator_mips64.cc", |
| 145 | "optimizing/intrinsics_mips64.cc", |
| 146 | "utils/mips64/assembler_mips64.cc", |
| 147 | "utils/mips64/managed_register_mips64.cc", |
| 148 | ], |
| 149 | }, |
| 150 | x86: { |
| 151 | srcs: [ |
| 152 | "jni/quick/x86/calling_convention_x86.cc", |
| 153 | "linker/x86/relative_patcher_x86.cc", |
| 154 | "linker/x86/relative_patcher_x86_base.cc", |
| 155 | "optimizing/code_generator_x86.cc", |
| 156 | "optimizing/intrinsics_x86.cc", |
| 157 | "optimizing/pc_relative_fixups_x86.cc", |
| 158 | "optimizing/x86_memory_gen.cc", |
| 159 | "utils/x86/assembler_x86.cc", |
| 160 | "utils/x86/jni_macro_assembler_x86.cc", |
| 161 | "utils/x86/managed_register_x86.cc", |
| 162 | ], |
| 163 | }, |
| 164 | x86_64: { |
| 165 | srcs: [ |
| 166 | "jni/quick/x86_64/calling_convention_x86_64.cc", |
| 167 | "linker/x86_64/relative_patcher_x86_64.cc", |
| 168 | "optimizing/intrinsics_x86_64.cc", |
| 169 | "optimizing/code_generator_x86_64.cc", |
| 170 | "utils/x86_64/assembler_x86_64.cc", |
| 171 | "utils/x86_64/jni_macro_assembler_x86_64.cc", |
| 172 | "utils/x86_64/managed_register_x86_64.cc", |
| 173 | ], |
| 174 | }, |
| 175 | }, |
| 176 | target: { |
| 177 | host: { |
| 178 | // For compiler driver TLS. |
| 179 | host_ldlibs: ["-lpthread"], |
| 180 | }, |
| 181 | android: { |
| 182 | // For atrace. |
| 183 | shared_libs: ["libcutils"], |
| 184 | }, |
| 185 | }, |
| 186 | generated_sources: ["art_compiler_operator_srcs"], |
| 187 | shared_libs: [ |
Andreas Gampe | 525a58b | 2016-09-26 18:09:47 -0700 | [diff] [blame] | 188 | "libbase", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 189 | "liblz4", |
| 190 | "liblzma", |
| 191 | ], |
| 192 | include_dirs: ["art/disassembler"], |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 193 | export_include_dirs: ["."], |
Alexey Alexandrov | ab40c11 | 2016-09-19 09:33:49 -0700 | [diff] [blame] | 194 | |
| 195 | // For SHA-1 checksumming of build ID |
| 196 | static: { |
| 197 | whole_static_libs: ["libcrypto"], |
| 198 | }, |
| 199 | shared: { |
| 200 | shared_libs: ["libcrypto"], |
| 201 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | gensrcs { |
| 205 | name: "art_compiler_operator_srcs", |
| 206 | cmd: "art/tools/generate-operator-out.py art/compiler $in > $out", |
| 207 | srcs: [ |
| 208 | "compiled_method.h", |
| 209 | "dex/dex_to_dex_compiler.h", |
| 210 | "driver/compiler_driver.h", |
| 211 | "driver/compiler_options.h", |
| 212 | "image_writer.h", |
| 213 | "optimizing/locations.h", |
| 214 | |
| 215 | "utils/arm/constants_arm.h", |
| 216 | "utils/mips/assembler_mips.h", |
| 217 | "utils/mips64/assembler_mips64.h", |
| 218 | ], |
| 219 | output_extension: "operator_out.cc", |
| 220 | } |
| 221 | |
| 222 | art_cc_library { |
| 223 | name: "libart-compiler", |
| 224 | defaults: ["libart-compiler-defaults"], |
| 225 | codegen: { |
Colin Cross | 766ea43 | 2016-08-25 16:22:04 -0700 | [diff] [blame] | 226 | arm: { |
| 227 | // VIXL assembly support for ARM targets. |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 228 | static: { |
| 229 | whole_static_libs: [ |
| 230 | "libvixl-arm", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 231 | ], |
| 232 | }, |
| 233 | shared: { |
| 234 | shared_libs: [ |
| 235 | "libvixl-arm", |
Colin Cross | 766ea43 | 2016-08-25 16:22:04 -0700 | [diff] [blame] | 236 | ], |
| 237 | }, |
| 238 | }, |
| 239 | arm64: { |
| 240 | // VIXL assembly support for ARM64 targets. |
| 241 | static: { |
| 242 | whole_static_libs: [ |
| 243 | "libvixl-arm64", |
| 244 | ], |
| 245 | }, |
| 246 | shared: { |
| 247 | shared_libs: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 248 | "libvixl-arm64", |
| 249 | ], |
| 250 | }, |
| 251 | }, |
| 252 | }, |
| 253 | shared_libs: ["libart"], |
| 254 | } |
| 255 | |
| 256 | art_cc_library { |
| 257 | name: "libartd-compiler", |
| 258 | defaults: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 259 | "art_debug_defaults", |
Colin Cross | c564406 | 2016-08-30 15:41:08 -0700 | [diff] [blame] | 260 | "libart-compiler-defaults", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 261 | ], |
| 262 | codegen: { |
Colin Cross | 766ea43 | 2016-08-25 16:22:04 -0700 | [diff] [blame] | 263 | arm: { |
| 264 | // VIXL assembly support for ARM targets. |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 265 | static: { |
| 266 | whole_static_libs: [ |
| 267 | "libvixld-arm", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 268 | ], |
| 269 | }, |
| 270 | shared: { |
| 271 | shared_libs: [ |
| 272 | "libvixld-arm", |
Colin Cross | 766ea43 | 2016-08-25 16:22:04 -0700 | [diff] [blame] | 273 | ], |
| 274 | }, |
| 275 | }, |
| 276 | arm64: { |
| 277 | // VIXL assembly support for ARM64 targets. |
| 278 | static: { |
| 279 | whole_static_libs: [ |
| 280 | "libvixld-arm64", |
| 281 | ], |
| 282 | }, |
| 283 | shared: { |
| 284 | shared_libs: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 285 | "libvixld-arm64", |
| 286 | ], |
| 287 | }, |
| 288 | }, |
| 289 | }, |
| 290 | shared_libs: ["libartd"], |
| 291 | } |
Colin Cross | 6b22aa5 | 2016-09-12 14:35:39 -0700 | [diff] [blame] | 292 | |
| 293 | art_cc_library { |
| 294 | name: "libart-compiler-gtest", |
| 295 | defaults: ["libart-gtest-defaults"], |
| 296 | srcs: ["common_compiler_test.cc"], |
| 297 | shared_libs: [ |
| 298 | "libartd-compiler", |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 299 | "libart-runtime-gtest", |
Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 300 | "libbase", |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 301 | ], |
| 302 | } |
| 303 | |
| 304 | art_cc_test { |
| 305 | name: "art_compiler_tests", |
| 306 | defaults: [ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 307 | "art_gtest_defaults", |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 308 | ], |
| 309 | srcs: [ |
| 310 | "compiled_method_test.cc", |
| 311 | "debug/dwarf/dwarf_test.cc", |
| 312 | "driver/compiled_method_storage_test.cc", |
| 313 | "driver/compiler_driver_test.cc", |
| 314 | "elf_writer_test.cc", |
| 315 | "exception_test.cc", |
| 316 | "image_test.cc", |
| 317 | "jni/jni_compiler_test.cc", |
| 318 | "linker/multi_oat_relative_patcher_test.cc", |
| 319 | "linker/output_stream_test.cc", |
| 320 | "oat_test.cc", |
| 321 | "optimizing/bounds_check_elimination_test.cc", |
| 322 | "optimizing/dominator_test.cc", |
| 323 | "optimizing/find_loops_test.cc", |
| 324 | "optimizing/graph_checker_test.cc", |
| 325 | "optimizing/graph_test.cc", |
| 326 | "optimizing/gvn_test.cc", |
| 327 | "optimizing/induction_var_analysis_test.cc", |
| 328 | "optimizing/induction_var_range_test.cc", |
| 329 | "optimizing/licm_test.cc", |
| 330 | "optimizing/live_interval_test.cc", |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 331 | "optimizing/loop_optimization_test.cc", |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 332 | "optimizing/nodes_test.cc", |
| 333 | "optimizing/parallel_move_test.cc", |
| 334 | "optimizing/pretty_printer_test.cc", |
| 335 | "optimizing/reference_type_propagation_test.cc", |
| 336 | "optimizing/side_effects_test.cc", |
| 337 | "optimizing/ssa_test.cc", |
| 338 | "optimizing/stack_map_test.cc", |
| 339 | "optimizing/suspend_check_test.cc", |
| 340 | "utils/dedupe_set_test.cc", |
| 341 | "utils/intrusive_forward_list_test.cc", |
| 342 | "utils/string_reference_test.cc", |
| 343 | "utils/swap_space_test.cc", |
| 344 | "utils/test_dex_file_builder_test.cc", |
| 345 | |
| 346 | "jni/jni_cfi_test.cc", |
| 347 | "optimizing/codegen_test.cc", |
| 348 | "optimizing/optimizing_cfi_test.cc", |
| 349 | ], |
| 350 | |
| 351 | codegen: { |
| 352 | arm: { |
| 353 | srcs: [ |
| 354 | "linker/arm/relative_patcher_thumb2_test.cc", |
| 355 | "utils/arm/managed_register_arm_test.cc", |
| 356 | ], |
| 357 | }, |
| 358 | arm64: { |
| 359 | srcs: [ |
| 360 | "linker/arm64/relative_patcher_arm64_test.cc", |
| 361 | "utils/arm64/managed_register_arm64_test.cc", |
| 362 | ], |
| 363 | }, |
| 364 | mips: { |
| 365 | srcs: [ |
| 366 | "linker/mips/relative_patcher_mips_test.cc", |
| 367 | "linker/mips/relative_patcher_mips32r6_test.cc", |
| 368 | ], |
| 369 | }, |
| 370 | x86: { |
| 371 | srcs: [ |
| 372 | "linker/x86/relative_patcher_x86_test.cc", |
| 373 | "utils/x86/managed_register_x86_test.cc", |
| 374 | |
| 375 | // These tests are testing architecture-independent |
| 376 | // functionality, but happen to use x86 codegen as part of the |
| 377 | // test. |
| 378 | "optimizing/constant_folding_test.cc", |
| 379 | "optimizing/dead_code_elimination_test.cc", |
| 380 | "optimizing/linearize_test.cc", |
| 381 | "optimizing/live_ranges_test.cc", |
| 382 | "optimizing/liveness_test.cc", |
| 383 | "optimizing/register_allocator_test.cc", |
| 384 | ], |
| 385 | }, |
| 386 | x86_64: { |
| 387 | srcs: [ |
| 388 | "linker/x86_64/relative_patcher_x86_64_test.cc", |
| 389 | ], |
| 390 | }, |
| 391 | }, |
| 392 | |
| 393 | shared_libs: [ |
| 394 | "libartd-compiler", |
| 395 | "libvixld-arm", |
| 396 | "libvixld-arm64", |
| 397 | |
| 398 | "libbacktrace", |
| 399 | "libnativeloader", |
| 400 | ], |
| 401 | } |
| 402 | |
| 403 | art_cc_test { |
| 404 | name: "art_compiler_host_tests", |
| 405 | device_supported: false, |
| 406 | defaults: [ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 407 | "art_gtest_defaults", |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 408 | ], |
| 409 | codegen: { |
| 410 | arm: { |
| 411 | srcs: [ |
| 412 | "utils/arm/assembler_thumb2_test.cc", |
| 413 | "utils/assembler_thumb_test.cc", |
| 414 | ], |
| 415 | }, |
| 416 | mips: { |
| 417 | srcs: [ |
| 418 | "utils/mips/assembler_mips_test.cc", |
| 419 | "utils/mips/assembler_mips32r6_test.cc", |
| 420 | ], |
| 421 | }, |
| 422 | mips64: { |
| 423 | srcs: [ |
| 424 | "utils/mips64/assembler_mips64_test.cc", |
| 425 | ], |
| 426 | }, |
| 427 | x86: { |
| 428 | srcs: [ |
| 429 | "utils/x86/assembler_x86_test.cc", |
| 430 | ], |
| 431 | }, |
| 432 | x86_64: { |
| 433 | srcs: [ |
| 434 | "utils/x86_64/assembler_x86_64_test.cc", |
| 435 | ], |
| 436 | }, |
| 437 | }, |
| 438 | shared_libs: [ |
| 439 | "libartd-compiler", |
| 440 | "libvixld-arm", |
| 441 | "libvixld-arm64", |
Colin Cross | 6b22aa5 | 2016-09-12 14:35:39 -0700 | [diff] [blame] | 442 | ], |
| 443 | } |