Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 1 | // |
| 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 | |
| 17 | // Keep the __jit_debug_register_code symbol as a unique symbol during ICF for architectures where |
| 18 | // we use gold as the linker (arm, x86, x86_64). The symbol is used by the debuggers to detect when |
| 19 | // new jit code is generated. We don't want it to be called when a different function with the same |
| 20 | // (empty) body is called. |
| 21 | JIT_DEBUG_REGISTER_CODE_LDFLAGS = ["-Wl,--keep-unique,__jit_debug_register_code"] |
| 22 | |
| 23 | cc_defaults { |
| 24 | name: "libart_defaults", |
| 25 | defaults: ["art_defaults"], |
| 26 | host_supported: true, |
| 27 | srcs: [ |
| 28 | "art_field.cc", |
| 29 | "art_method.cc", |
| 30 | "atomic.cc", |
| 31 | "barrier.cc", |
| 32 | "base/allocator.cc", |
| 33 | "base/arena_allocator.cc", |
| 34 | "base/arena_bit_vector.cc", |
| 35 | "base/bit_vector.cc", |
| 36 | "base/file_magic.cc", |
| 37 | "base/hex_dump.cc", |
| 38 | "base/logging.cc", |
| 39 | "base/mutex.cc", |
| 40 | "base/scoped_arena_allocator.cc", |
| 41 | "base/scoped_flock.cc", |
| 42 | "base/stringpiece.cc", |
| 43 | "base/stringprintf.cc", |
| 44 | "base/time_utils.cc", |
| 45 | "base/timing_logger.cc", |
| 46 | "base/unix_file/fd_file.cc", |
| 47 | "base/unix_file/random_access_file_utils.cc", |
| 48 | "check_jni.cc", |
| 49 | "class_linker.cc", |
| 50 | "class_table.cc", |
| 51 | "code_simulator_container.cc", |
| 52 | "common_throws.cc", |
| 53 | "compiler_filter.cc", |
| 54 | "debugger.cc", |
| 55 | "dex_file.cc", |
| 56 | "dex_file_verifier.cc", |
| 57 | "dex_instruction.cc", |
| 58 | "elf_file.cc", |
| 59 | "fault_handler.cc", |
| 60 | "gc/allocation_record.cc", |
| 61 | "gc/allocator/dlmalloc.cc", |
| 62 | "gc/allocator/rosalloc.cc", |
| 63 | "gc/accounting/bitmap.cc", |
| 64 | "gc/accounting/card_table.cc", |
| 65 | "gc/accounting/heap_bitmap.cc", |
| 66 | "gc/accounting/mod_union_table.cc", |
| 67 | "gc/accounting/remembered_set.cc", |
| 68 | "gc/accounting/space_bitmap.cc", |
| 69 | "gc/collector/concurrent_copying.cc", |
| 70 | "gc/collector/garbage_collector.cc", |
| 71 | "gc/collector/immune_region.cc", |
| 72 | "gc/collector/immune_spaces.cc", |
| 73 | "gc/collector/mark_compact.cc", |
| 74 | "gc/collector/mark_sweep.cc", |
| 75 | "gc/collector/partial_mark_sweep.cc", |
| 76 | "gc/collector/semi_space.cc", |
| 77 | "gc/collector/sticky_mark_sweep.cc", |
| 78 | "gc/gc_cause.cc", |
| 79 | "gc/heap.cc", |
| 80 | "gc/reference_processor.cc", |
| 81 | "gc/reference_queue.cc", |
| 82 | "gc/scoped_gc_critical_section.cc", |
| 83 | "gc/space/bump_pointer_space.cc", |
| 84 | "gc/space/dlmalloc_space.cc", |
| 85 | "gc/space/image_space.cc", |
| 86 | "gc/space/large_object_space.cc", |
| 87 | "gc/space/malloc_space.cc", |
| 88 | "gc/space/region_space.cc", |
| 89 | "gc/space/rosalloc_space.cc", |
| 90 | "gc/space/space.cc", |
| 91 | "gc/space/zygote_space.cc", |
| 92 | "gc/task_processor.cc", |
| 93 | "hprof/hprof.cc", |
| 94 | "image.cc", |
| 95 | "indirect_reference_table.cc", |
| 96 | "instrumentation.cc", |
| 97 | "intern_table.cc", |
| 98 | "interpreter/interpreter.cc", |
| 99 | "interpreter/interpreter_common.cc", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 100 | "interpreter/interpreter_switch_impl.cc", |
| 101 | "interpreter/unstarted_runtime.cc", |
| 102 | "java_vm_ext.cc", |
| 103 | "jdwp/jdwp_event.cc", |
| 104 | "jdwp/jdwp_expand_buf.cc", |
| 105 | "jdwp/jdwp_handler.cc", |
| 106 | "jdwp/jdwp_main.cc", |
| 107 | "jdwp/jdwp_request.cc", |
| 108 | "jdwp/jdwp_socket.cc", |
| 109 | "jdwp/object_registry.cc", |
| 110 | "jni_env_ext.cc", |
| 111 | "jit/debugger_interface.cc", |
| 112 | "jit/jit.cc", |
| 113 | "jit/jit_code_cache.cc", |
| 114 | "jit/offline_profiling_info.cc", |
| 115 | "jit/profiling_info.cc", |
| 116 | "jit/profile_saver.cc", |
| 117 | "jni_internal.cc", |
| 118 | "jobject_comparator.cc", |
| 119 | "linear_alloc.cc", |
| 120 | "mem_map.cc", |
| 121 | "memory_region.cc", |
| 122 | "mirror/abstract_method.cc", |
| 123 | "mirror/array.cc", |
| 124 | "mirror/class.cc", |
| 125 | "mirror/dex_cache.cc", |
| 126 | "mirror/field.cc", |
| 127 | "mirror/method.cc", |
| 128 | "mirror/object.cc", |
| 129 | "mirror/reference.cc", |
| 130 | "mirror/stack_trace_element.cc", |
| 131 | "mirror/string.cc", |
| 132 | "mirror/throwable.cc", |
| 133 | "monitor.cc", |
| 134 | "native_bridge_art_interface.cc", |
| 135 | "native_stack_dump.cc", |
| 136 | "native/dalvik_system_DexFile.cc", |
Orion Hodson | a4c2a05 | 2016-08-17 10:51:42 +0100 | [diff] [blame] | 137 | "native/dalvik_system_InMemoryDexClassLoader_DexData.cc", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 138 | "native/dalvik_system_VMDebug.cc", |
| 139 | "native/dalvik_system_VMRuntime.cc", |
| 140 | "native/dalvik_system_VMStack.cc", |
| 141 | "native/dalvik_system_ZygoteHooks.cc", |
| 142 | "native/java_lang_Class.cc", |
| 143 | "native/java_lang_DexCache.cc", |
| 144 | "native/java_lang_Object.cc", |
| 145 | "native/java_lang_String.cc", |
| 146 | "native/java_lang_StringFactory.cc", |
| 147 | "native/java_lang_System.cc", |
| 148 | "native/java_lang_Thread.cc", |
| 149 | "native/java_lang_Throwable.cc", |
| 150 | "native/java_lang_VMClassLoader.cc", |
| 151 | "native/java_lang_ref_FinalizerReference.cc", |
| 152 | "native/java_lang_ref_Reference.cc", |
| 153 | "native/java_lang_reflect_AbstractMethod.cc", |
| 154 | "native/java_lang_reflect_Array.cc", |
| 155 | "native/java_lang_reflect_Constructor.cc", |
| 156 | "native/java_lang_reflect_Field.cc", |
| 157 | "native/java_lang_reflect_Method.cc", |
| 158 | "native/java_lang_reflect_Proxy.cc", |
| 159 | "native/java_util_concurrent_atomic_AtomicLong.cc", |
| 160 | "native/libcore_util_CharsetUtils.cc", |
| 161 | "native/org_apache_harmony_dalvik_ddmc_DdmServer.cc", |
| 162 | "native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc", |
| 163 | "native/sun_misc_Unsafe.cc", |
| 164 | "oat.cc", |
| 165 | "oat_file.cc", |
| 166 | "oat_file_assistant.cc", |
| 167 | "oat_file_manager.cc", |
| 168 | "oat_quick_method_header.cc", |
| 169 | "object_lock.cc", |
| 170 | "offsets.cc", |
| 171 | "os_linux.cc", |
| 172 | "parsed_options.cc", |
| 173 | "plugin.cc", |
| 174 | "primitive.cc", |
| 175 | "quick_exception_handler.cc", |
| 176 | "quick/inline_method_analyser.cc", |
| 177 | "reference_table.cc", |
| 178 | "reflection.cc", |
| 179 | "runtime.cc", |
| 180 | "runtime_options.cc", |
| 181 | "signal_catcher.cc", |
| 182 | "stack.cc", |
| 183 | "stack_map.cc", |
| 184 | "thread.cc", |
| 185 | "thread_list.cc", |
| 186 | "thread_pool.cc", |
| 187 | "ti/agent.cc", |
| 188 | "trace.cc", |
| 189 | "transaction.cc", |
| 190 | "type_lookup_table.cc", |
| 191 | "utf.cc", |
| 192 | "utils.cc", |
| 193 | "verifier/instruction_flags.cc", |
| 194 | "verifier/method_verifier.cc", |
| 195 | "verifier/reg_type.cc", |
| 196 | "verifier/reg_type_cache.cc", |
| 197 | "verifier/register_line.cc", |
| 198 | "well_known_classes.cc", |
| 199 | "zip_archive.cc", |
| 200 | |
| 201 | "arch/context.cc", |
| 202 | "arch/instruction_set.cc", |
| 203 | "arch/instruction_set_features.cc", |
| 204 | "arch/memcmp16.cc", |
| 205 | "arch/arm/instruction_set_features_arm.cc", |
| 206 | "arch/arm/registers_arm.cc", |
| 207 | "arch/arm64/instruction_set_features_arm64.cc", |
| 208 | "arch/arm64/registers_arm64.cc", |
| 209 | "arch/mips/instruction_set_features_mips.cc", |
| 210 | "arch/mips/registers_mips.cc", |
| 211 | "arch/mips64/instruction_set_features_mips64.cc", |
| 212 | "arch/mips64/registers_mips64.cc", |
| 213 | "arch/x86/instruction_set_features_x86.cc", |
| 214 | "arch/x86/registers_x86.cc", |
| 215 | "arch/x86_64/registers_x86_64.cc", |
| 216 | "entrypoints/entrypoint_utils.cc", |
| 217 | "entrypoints/jni/jni_entrypoints.cc", |
| 218 | "entrypoints/math_entrypoints.cc", |
| 219 | "entrypoints/quick/quick_alloc_entrypoints.cc", |
| 220 | "entrypoints/quick/quick_cast_entrypoints.cc", |
| 221 | "entrypoints/quick/quick_deoptimization_entrypoints.cc", |
| 222 | "entrypoints/quick/quick_dexcache_entrypoints.cc", |
Serban Constantinescu | da8ffec | 2016-03-09 12:02:11 +0000 | [diff] [blame] | 223 | "entrypoints/quick/quick_entrypoints_enum.cc", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 224 | "entrypoints/quick/quick_field_entrypoints.cc", |
| 225 | "entrypoints/quick/quick_fillarray_entrypoints.cc", |
| 226 | "entrypoints/quick/quick_instrumentation_entrypoints.cc", |
| 227 | "entrypoints/quick/quick_jni_entrypoints.cc", |
| 228 | "entrypoints/quick/quick_lock_entrypoints.cc", |
| 229 | "entrypoints/quick/quick_math_entrypoints.cc", |
| 230 | "entrypoints/quick/quick_thread_entrypoints.cc", |
| 231 | "entrypoints/quick/quick_throw_entrypoints.cc", |
| 232 | "entrypoints/quick/quick_trampoline_entrypoints.cc", |
| 233 | ], |
| 234 | |
| 235 | arch: { |
| 236 | arm: { |
| 237 | clang_asflags: ["-no-integrated-as"], |
| 238 | srcs: [ |
| 239 | "interpreter/mterp/mterp.cc", |
| 240 | "interpreter/mterp/out/mterp_arm.S", |
| 241 | "arch/arm/context_arm.cc", |
| 242 | "arch/arm/entrypoints_init_arm.cc", |
| 243 | "arch/arm/instruction_set_features_assembly_tests.S", |
| 244 | "arch/arm/jni_entrypoints_arm.S", |
| 245 | "arch/arm/memcmp16_arm.S", |
| 246 | "arch/arm/quick_entrypoints_arm.S", |
| 247 | "arch/arm/quick_entrypoints_cc_arm.cc", |
| 248 | "arch/arm/thread_arm.cc", |
| 249 | "arch/arm/fault_handler_arm.cc", |
| 250 | ], |
| 251 | }, |
| 252 | arm64: { |
| 253 | srcs: [ |
| 254 | "interpreter/mterp/mterp.cc", |
| 255 | "interpreter/mterp/out/mterp_arm64.S", |
| 256 | "arch/arm64/context_arm64.cc", |
| 257 | "arch/arm64/entrypoints_init_arm64.cc", |
| 258 | "arch/arm64/jni_entrypoints_arm64.S", |
| 259 | "arch/arm64/memcmp16_arm64.S", |
| 260 | "arch/arm64/quick_entrypoints_arm64.S", |
| 261 | "arch/arm64/thread_arm64.cc", |
| 262 | "monitor_pool.cc", |
| 263 | "arch/arm64/fault_handler_arm64.cc", |
| 264 | ], |
| 265 | }, |
| 266 | x86: { |
| 267 | srcs: [ |
| 268 | "interpreter/mterp/mterp.cc", |
| 269 | "interpreter/mterp/out/mterp_x86.S", |
| 270 | "arch/x86/context_x86.cc", |
| 271 | "arch/x86/entrypoints_init_x86.cc", |
| 272 | "arch/x86/jni_entrypoints_x86.S", |
| 273 | "arch/x86/memcmp16_x86.S", |
| 274 | "arch/x86/quick_entrypoints_x86.S", |
| 275 | "arch/x86/thread_x86.cc", |
| 276 | "arch/x86/fault_handler_x86.cc", |
| 277 | ], |
| 278 | }, |
| 279 | x86_64: { |
| 280 | srcs: [ |
| 281 | // Note that the fault_handler_x86.cc is not a mistake. This file is |
| 282 | // shared between the x86 and x86_64 architectures. |
| 283 | "interpreter/mterp/mterp.cc", |
| 284 | "interpreter/mterp/out/mterp_x86_64.S", |
| 285 | "arch/x86_64/context_x86_64.cc", |
| 286 | "arch/x86_64/entrypoints_init_x86_64.cc", |
| 287 | "arch/x86_64/jni_entrypoints_x86_64.S", |
| 288 | "arch/x86_64/memcmp16_x86_64.S", |
| 289 | "arch/x86_64/quick_entrypoints_x86_64.S", |
| 290 | "arch/x86_64/thread_x86_64.cc", |
| 291 | "monitor_pool.cc", |
| 292 | "arch/x86/fault_handler_x86.cc", |
| 293 | ], |
| 294 | }, |
| 295 | mips: { |
| 296 | srcs: [ |
| 297 | "interpreter/mterp/mterp.cc", |
| 298 | "interpreter/mterp/out/mterp_mips.S", |
| 299 | "arch/mips/context_mips.cc", |
| 300 | "arch/mips/entrypoints_init_mips.cc", |
| 301 | "arch/mips/jni_entrypoints_mips.S", |
| 302 | "arch/mips/memcmp16_mips.S", |
| 303 | "arch/mips/quick_entrypoints_mips.S", |
| 304 | "arch/mips/thread_mips.cc", |
| 305 | "arch/mips/fault_handler_mips.cc", |
| 306 | ], |
| 307 | }, |
| 308 | mips64: { |
| 309 | srcs: [ |
| 310 | "interpreter/mterp/mterp.cc", |
| 311 | "interpreter/mterp/out/mterp_mips64.S", |
| 312 | "arch/mips64/context_mips64.cc", |
| 313 | "arch/mips64/entrypoints_init_mips64.cc", |
| 314 | "arch/mips64/jni_entrypoints_mips64.S", |
| 315 | "arch/mips64/memcmp16_mips64.S", |
| 316 | "arch/mips64/quick_entrypoints_mips64.S", |
| 317 | "arch/mips64/thread_mips64.cc", |
| 318 | "monitor_pool.cc", |
| 319 | "arch/mips64/fault_handler_mips64.cc", |
| 320 | ], |
| 321 | }, |
| 322 | }, |
| 323 | target: { |
| 324 | android: { |
| 325 | srcs: [ |
| 326 | "jdwp/jdwp_adb.cc", |
| 327 | "monitor_android.cc", |
| 328 | "runtime_android.cc", |
| 329 | "thread_android.cc", |
| 330 | ], |
| 331 | shared_libs: [ |
| 332 | "libdl", |
| 333 | // For android::FileMap used by libziparchive. |
| 334 | "libutils", |
| 335 | ], |
| 336 | static_libs: [ |
| 337 | // ZipArchive support, the order matters here to get all symbols. |
| 338 | "libziparchive", |
| 339 | "libz", |
| 340 | "libbase", |
| 341 | ], |
| 342 | }, |
| 343 | android_arm: { |
| 344 | ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS, |
| 345 | }, |
| 346 | android_arm64: { |
| 347 | ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS, |
| 348 | }, |
| 349 | android_x86: { |
| 350 | ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS, |
| 351 | }, |
| 352 | android_x86_64: { |
| 353 | ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS, |
| 354 | }, |
| 355 | host: { |
| 356 | srcs: [ |
| 357 | "monitor_linux.cc", |
| 358 | "runtime_linux.cc", |
| 359 | "thread_linux.cc", |
| 360 | ], |
| 361 | shared_libs: [ |
| 362 | "libziparchive", |
Colin Cross | 19f28f1 | 2016-08-25 16:42:09 -0700 | [diff] [blame] | 363 | "libz-host", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 364 | ], |
| 365 | }, |
| 366 | }, |
| 367 | cflags: ["-DBUILDING_LIBART=1"], |
| 368 | generated_sources: ["art_operator_srcs"], |
| 369 | clang: true, |
| 370 | include_dirs: [ |
| 371 | "art/cmdline", |
| 372 | "art/sigchainlib", |
| 373 | "art", |
| 374 | ], |
| 375 | shared_libs: [ |
| 376 | "libnativehelper", |
| 377 | "libnativebridge", |
| 378 | "libnativeloader", |
| 379 | "libbacktrace", |
| 380 | "liblz4", |
| 381 | // For liblog, atrace, properties, ashmem, set_sched_policy and socket_peer_is_trusted. |
| 382 | "libcutils", |
Andreas Gampe | aaadff8 | 2016-08-29 09:53:48 -0700 | [diff] [blame] | 383 | // For common macros. |
| 384 | "libbase", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 385 | ], |
| 386 | static: { |
| 387 | static_libs: ["libsigchain_dummy"], |
| 388 | }, |
| 389 | shared: { |
| 390 | shared_libs: ["libsigchain"], |
| 391 | }, |
| 392 | export_include_dirs: ["."], |
Andreas Gampe | aaadff8 | 2016-08-29 09:53:48 -0700 | [diff] [blame] | 393 | // ART's macros.h depends on libbase's macros.h. |
| 394 | export_shared_lib_headers: ["libbase"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 395 | } |
| 396 | |
| 397 | gensrcs { |
| 398 | name: "art_operator_srcs", |
| 399 | cmd: "art/tools/generate-operator-out.py art/runtime $in > $out", |
| 400 | srcs: [ |
| 401 | "arch/instruction_set.h", |
| 402 | "base/allocator.h", |
| 403 | "base/enums.h", |
| 404 | "base/mutex.h", |
| 405 | "debugger.h", |
| 406 | "base/unix_file/fd_file.h", |
| 407 | "dex_file.h", |
| 408 | "dex_instruction.h", |
| 409 | "dex_instruction_utils.h", |
| 410 | "gc_root.h", |
| 411 | "gc/allocator_type.h", |
| 412 | "gc/allocator/rosalloc.h", |
| 413 | "gc/collector_type.h", |
| 414 | "gc/collector/gc_type.h", |
| 415 | "gc/heap.h", |
| 416 | "gc/space/region_space.h", |
| 417 | "gc/space/space.h", |
| 418 | "gc/weak_root_state.h", |
| 419 | "image.h", |
| 420 | "instrumentation.h", |
| 421 | "indirect_reference_table.h", |
| 422 | "invoke_type.h", |
| 423 | "jdwp/jdwp.h", |
| 424 | "jdwp/jdwp_constants.h", |
| 425 | "lock_word.h", |
| 426 | "mirror/class.h", |
| 427 | "oat.h", |
| 428 | "object_callbacks.h", |
| 429 | "process_state.h", |
| 430 | "quick/inline_method_analyser.h", |
| 431 | "runtime.h", |
| 432 | "stack.h", |
| 433 | "thread.h", |
| 434 | "thread_state.h", |
| 435 | "ti/agent.h", |
| 436 | "verifier/method_verifier.h", |
| 437 | ], |
| 438 | output_extension: "operator_out.cc", |
| 439 | } |
| 440 | |
| 441 | // We always build dex2oat and dependencies, even if the host build is otherwise disabled, since |
| 442 | // they are used to cross compile for the target. |
| 443 | |
| 444 | art_cc_library { |
| 445 | name: "libart", |
| 446 | defaults: ["libart_defaults"], |
Andreas Gampe | 20ada11 | 2016-08-29 08:51:15 -0700 | [diff] [blame] | 447 | // Leave the symbols in the shared library so that stack unwinders can |
| 448 | // produce meaningful name resolution. |
| 449 | strip: { |
| 450 | keep_symbols: true, |
| 451 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 452 | } |
| 453 | |
| 454 | art_cc_library { |
| 455 | name: "libartd", |
| 456 | defaults: [ |
Colin Cross | c564406 | 2016-08-30 15:41:08 -0700 | [diff] [blame] | 457 | "art_debug_defaults", |
| 458 | "libart_defaults", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 459 | ], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 460 | } |
| 461 | |
| 462 | subdirs = [ |
| 463 | "openjdkjvm", |
| 464 | "openjdkjvmti", |
| 465 | "simulator", |
| 466 | ] |