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.
21package {
22    // See: http://go/android-license-faq
23    // A large-scale-change added 'default_applicable_licenses' to import
24    // all of the 'license_kinds' from "art_license"
25    // to get the below license kinds:
26    //   SPDX-license-identifier-Apache-2.0
27    default_applicable_licenses: ["art_license"],
28}
29
30JIT_DEBUG_REGISTER_CODE_LDFLAGS = [
31    "-Wl,--keep-unique,__jit_debug_register_code",
32    "-Wl,--keep-unique,__dex_debug_register_code",
33]
34
35// These are defaults for native shared libaries that are expected to be
36// in stack traces often.
37libart_cc_defaults {
38    name: "libart_nativeunwind_defaults",
39    target: {
40        android_arm: {
41            // Arm 32 bit does not produce complete exidx unwind information
42            // so keep the .debug_frame which is relatively small and does
43            // include needed unwind information.
44            // See b/132992102 and b/145790995 for details.
45            strip: {
46                keep_symbols_and_debug_frame: true,
47            },
48        },
49        // For all other architectures, leave the symbols in the shared library
50        // so that stack unwinders can produce meaningful name resolution.
51        android_arm64: {
52            strip: {
53                keep_symbols: true,
54            },
55        },
56        android_x86: {
57            strip: {
58                keep_symbols: true,
59            },
60        },
61        android_x86_64: {
62            strip: {
63                keep_symbols: true,
64            },
65        },
66    },
67}
68
69libart_cc_defaults {
70    name: "libart_defaults",
71    defaults: ["art_defaults"],
72    host_supported: true,
73    srcs: [
74        "app_info.cc",
75        "aot_class_linker.cc",
76        "art_field.cc",
77        "sdk_checker.cc",
78        "art_method.cc",
79        "backtrace_helper.cc",
80        "barrier.cc",
81        "base/locks.cc",
82        "base/mem_map_arena_pool.cc",
83        "base/mutex.cc",
84        "base/quasi_atomic.cc",
85        "base/timing_logger.cc",
86        "cha.cc",
87        "class_linker.cc",
88        "class_loader_context.cc",
89        "class_root.cc",
90        "class_table.cc",
91        "common_throws.cc",
92        "compat_framework.cc",
93        "debug_print.cc",
94        "debugger.cc",
95        "dex/dex_file_annotations.cc",
96        "dex_register_location.cc",
97        "elf_file.cc",
98        "exec_utils.cc",
99        "fault_handler.cc",
100        "gc/allocation_record.cc",
101        "gc/allocator/dlmalloc.cc",
102        "gc/allocator/rosalloc.cc",
103        "gc/accounting/bitmap.cc",
104        "gc/accounting/card_table.cc",
105        "gc/accounting/heap_bitmap.cc",
106        "gc/accounting/mod_union_table.cc",
107        "gc/accounting/remembered_set.cc",
108        "gc/accounting/space_bitmap.cc",
109        "gc/collector/concurrent_copying.cc",
110        "gc/collector/garbage_collector.cc",
111        "gc/collector/immune_region.cc",
112        "gc/collector/immune_spaces.cc",
113        "gc/collector/mark_sweep.cc",
114        "gc/collector/partial_mark_sweep.cc",
115        "gc/collector/semi_space.cc",
116        "gc/collector/sticky_mark_sweep.cc",
117        "gc/gc_cause.cc",
118        "gc/heap.cc",
119        "gc/reference_processor.cc",
120        "gc/reference_queue.cc",
121        "gc/scoped_gc_critical_section.cc",
122        "gc/space/bump_pointer_space.cc",
123        "gc/space/dlmalloc_space.cc",
124        "gc/space/image_space.cc",
125        "gc/space/large_object_space.cc",
126        "gc/space/malloc_space.cc",
127        "gc/space/region_space.cc",
128        "gc/space/rosalloc_space.cc",
129        "gc/space/space.cc",
130        "gc/space/zygote_space.cc",
131        "gc/task_processor.cc",
132        "gc/verification.cc",
133        "handle.cc",
134        "hidden_api.cc",
135        "hprof/hprof.cc",
136        "image.cc",
137        "index_bss_mapping.cc",
138        "indirect_reference_table.cc",
139        "instrumentation.cc",
140        "intern_table.cc",
141        "interpreter/interpreter.cc",
142        "interpreter/interpreter_cache.cc",
143        "interpreter/interpreter_common.cc",
144        "interpreter/interpreter_intrinsics.cc",
145        "interpreter/interpreter_switch_impl0.cc",
146        "interpreter/interpreter_switch_impl1.cc",
147        "interpreter/interpreter_switch_impl2.cc",
148        "interpreter/interpreter_switch_impl3.cc",
149        "interpreter/lock_count_data.cc",
150        "interpreter/shadow_frame.cc",
151        "interpreter/unstarted_runtime.cc",
152        "java_frame_root_info.cc",
153        "javaheapprof/javaheapsampler.cc",
154        "jit/debugger_interface.cc",
155        "jit/jit.cc",
156        "jit/jit_code_cache.cc",
157        "jit/jit_memory_region.cc",
158        "jit/profiling_info.cc",
159        "jit/profile_saver.cc",
160        "jni/check_jni.cc",
161        "jni/java_vm_ext.cc",
162        "jni/jni_env_ext.cc",
163        "jni/jni_id_manager.cc",
164        "jni/jni_internal.cc",
165        "linear_alloc.cc",
166        "method_handles.cc",
167        "metrics/reporter.cc",
168        "mirror/array.cc",
169        "mirror/class.cc",
170        "mirror/class_ext.cc",
171        "mirror/dex_cache.cc",
172        "mirror/emulated_stack_frame.cc",
173        "mirror/executable.cc",
174        "mirror/field.cc",
175        "mirror/method.cc",
176        "mirror/method_handle_impl.cc",
177        "mirror/method_handles_lookup.cc",
178        "mirror/method_type.cc",
179        "mirror/object.cc",
180        "mirror/stack_trace_element.cc",
181        "mirror/string.cc",
182        "mirror/throwable.cc",
183        "mirror/var_handle.cc",
184        "monitor.cc",
185        "monitor_objects_stack_visitor.cc",
186        "native_bridge_art_interface.cc",
187        "native_stack_dump.cc",
188        "native/dalvik_system_DexFile.cc",
189        "native/dalvik_system_BaseDexClassLoader.cc",
190        "native/dalvik_system_VMDebug.cc",
191        "native/dalvik_system_VMRuntime.cc",
192        "native/dalvik_system_VMStack.cc",
193        "native/dalvik_system_ZygoteHooks.cc",
194        "native/java_lang_Class.cc",
195        "native/java_lang_Object.cc",
196        "native/java_lang_String.cc",
197        "native/java_lang_StringFactory.cc",
198        "native/java_lang_System.cc",
199        "native/java_lang_Thread.cc",
200        "native/java_lang_Throwable.cc",
201        "native/java_lang_VMClassLoader.cc",
202        "native/java_lang_invoke_MethodHandleImpl.cc",
203        "native/java_lang_ref_FinalizerReference.cc",
204        "native/java_lang_ref_Reference.cc",
205        "native/java_lang_reflect_Array.cc",
206        "native/java_lang_reflect_Constructor.cc",
207        "native/java_lang_reflect_Executable.cc",
208        "native/java_lang_reflect_Field.cc",
209        "native/java_lang_reflect_Method.cc",
210        "native/java_lang_reflect_Parameter.cc",
211        "native/java_lang_reflect_Proxy.cc",
212        "native/java_util_concurrent_atomic_AtomicLong.cc",
213        "native/libcore_util_CharsetUtils.cc",
214        "native/org_apache_harmony_dalvik_ddmc_DdmServer.cc",
215        "native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc",
216        "native/sun_misc_Unsafe.cc",
217        "non_debuggable_classes.cc",
218        "nterp_helpers.cc",
219        "oat.cc",
220        "oat_file.cc",
221        "oat_file_assistant.cc",
222        "oat_file_manager.cc",
223        "oat_quick_method_header.cc",
224        "object_lock.cc",
225        "offsets.cc",
226        "parsed_options.cc",
227        "plugin.cc",
228        "quick_exception_handler.cc",
229        "read_barrier.cc",
230        "reference_table.cc",
231        "reflection.cc",
232        "reflective_handle_scope.cc",
233        "reflective_value_visitor.cc",
234        "runtime.cc",
235        "runtime_callbacks.cc",
236        "runtime_common.cc",
237        "runtime_intrinsics.cc",
238        "runtime_options.cc",
239        "scoped_thread_state_change.cc",
240        "signal_catcher.cc",
241        "stack.cc",
242        "stack_map.cc",
243        "string_builder_append.cc",
244        "thread.cc",
245        "thread_list.cc",
246        "thread_pool.cc",
247        "ti/agent.cc",
248        "trace.cc",
249        "transaction.cc",
250        "var_handles.cc",
251        "vdex_file.cc",
252        "verifier/class_verifier.cc",
253        "verifier/instruction_flags.cc",
254        "verifier/method_verifier.cc",
255        "verifier/reg_type.cc",
256        "verifier/reg_type_cache.cc",
257        "verifier/register_line.cc",
258        "verifier/verifier_deps.cc",
259        "verify_object.cc",
260        "well_known_classes.cc",
261
262        "arch/context.cc",
263        "arch/instruction_set_features.cc",
264        "arch/memcmp16.cc",
265        "arch/arm/instruction_set_features_arm.cc",
266        "arch/arm/registers_arm.cc",
267        "arch/arm64/instruction_set_features_arm64.cc",
268        "arch/arm64/registers_arm64.cc",
269        "arch/x86/instruction_set_features_x86.cc",
270        "arch/x86/registers_x86.cc",
271        "arch/x86_64/registers_x86_64.cc",
272        "entrypoints/entrypoint_utils.cc",
273        "entrypoints/jni/jni_entrypoints.cc",
274        "entrypoints/math_entrypoints.cc",
275        "entrypoints/quick/quick_alloc_entrypoints.cc",
276        "entrypoints/quick/quick_cast_entrypoints.cc",
277        "entrypoints/quick/quick_deoptimization_entrypoints.cc",
278        "entrypoints/quick/quick_dexcache_entrypoints.cc",
279        "entrypoints/quick/quick_entrypoints_enum.cc",
280        "entrypoints/quick/quick_field_entrypoints.cc",
281        "entrypoints/quick/quick_fillarray_entrypoints.cc",
282        "entrypoints/quick/quick_jni_entrypoints.cc",
283        "entrypoints/quick/quick_lock_entrypoints.cc",
284        "entrypoints/quick/quick_math_entrypoints.cc",
285        "entrypoints/quick/quick_string_builder_append_entrypoints.cc",
286        "entrypoints/quick/quick_thread_entrypoints.cc",
287        "entrypoints/quick/quick_throw_entrypoints.cc",
288        "entrypoints/quick/quick_trampoline_entrypoints.cc",
289    ],
290
291    arch: {
292        arm: {
293            srcs: [
294                "interpreter/mterp/mterp.cc",
295                "interpreter/mterp/nterp.cc",
296                ":libart_mterp.arm",
297                ":libart_mterp.armng",
298                "arch/arm/context_arm.cc",
299                "arch/arm/entrypoints_init_arm.cc",
300                "arch/arm/instruction_set_features_assembly_tests.S",
301                "arch/arm/jni_entrypoints_arm.S",
302                "arch/arm/memcmp16_arm.S",
303                "arch/arm/quick_entrypoints_arm.S",
304                "arch/arm/quick_entrypoints_cc_arm.cc",
305                "arch/arm/thread_arm.cc",
306                "arch/arm/fault_handler_arm.cc",
307            ],
308        },
309        arm64: {
310            srcs: [
311                "interpreter/mterp/mterp.cc",
312                "interpreter/mterp/nterp.cc",
313                ":libart_mterp.arm64",
314                ":libart_mterp.arm64ng",
315                "arch/arm64/context_arm64.cc",
316                "arch/arm64/entrypoints_init_arm64.cc",
317                "arch/arm64/jni_entrypoints_arm64.S",
318                "arch/arm64/memcmp16_arm64.S",
319                "arch/arm64/quick_entrypoints_arm64.S",
320                "arch/arm64/thread_arm64.cc",
321                "monitor_pool.cc",
322                "arch/arm64/fault_handler_arm64.cc",
323            ],
324        },
325        x86: {
326            srcs: [
327                "interpreter/mterp/mterp.cc",
328                "interpreter/mterp/nterp_stub.cc",
329                ":libart_mterp.x86",
330                "arch/x86/__x86.get_pc_thunk.S",
331                "arch/x86/context_x86.cc",
332                "arch/x86/entrypoints_init_x86.cc",
333                "arch/x86/jni_entrypoints_x86.S",
334                "arch/x86/memcmp16_x86.S",
335                "arch/x86/quick_entrypoints_x86.S",
336                "arch/x86/thread_x86.cc",
337                "arch/x86/fault_handler_x86.cc",
338            ],
339            avx: {
340                asflags: ["-DMTERP_USE_AVX"],
341            },
342            avx2: {
343                asflags: ["-DMTERP_USE_AVX"],
344            },
345        },
346        x86_64: {
347            srcs: [
348                // Note that the fault_handler_x86.cc is not a mistake.  This file is
349                // shared between the x86 and x86_64 architectures.
350                "interpreter/mterp/mterp.cc",
351                "interpreter/mterp/nterp.cc",
352                ":libart_mterp.x86_64",
353                ":libart_mterp.x86_64ng",
354                "arch/x86_64/context_x86_64.cc",
355                "arch/x86_64/entrypoints_init_x86_64.cc",
356                "arch/x86_64/jni_entrypoints_x86_64.S",
357                "arch/x86_64/memcmp16_x86_64.S",
358                "arch/x86_64/quick_entrypoints_x86_64.S",
359                "arch/x86_64/thread_x86_64.cc",
360                "monitor_pool.cc",
361                "arch/x86/fault_handler_x86.cc",
362            ],
363            avx: {
364                asflags: ["-DMTERP_USE_AVX"],
365            },
366            avx2: {
367                asflags: ["-DMTERP_USE_AVX"],
368            },
369        },
370    },
371
372    target: {
373        android: {
374            srcs: [
375                "monitor_android.cc",
376                "runtime_android.cc",
377                "thread_android.cc",
378                "metrics/statsd.cc",
379            ],
380            header_libs: [
381                "libnativeloader-headers", // For dlext_namespaces.h
382            ],
383            shared_libs: [
384                "libdl_android",
385                "libicu",
386                "libstatssocket",
387                "libz", // For adler32.
388                "heapprofd_client_api",
389            ],
390            static_libs: [
391                "libstatslog_art",
392                "libxml2",
393            ],
394            generated_sources: [
395                "apex-info-list",
396            ],
397        },
398        android_arm: {
399            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
400        },
401        android_arm64: {
402            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
403        },
404        android_x86: {
405            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
406        },
407        android_x86_64: {
408            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
409        },
410        host: {
411            srcs: [
412                "monitor_linux.cc",
413                "runtime_linux.cc",
414                "thread_linux.cc",
415            ],
416            header_libs: [
417                "libicuuc_headers",
418            ],
419            shared_libs: [
420                "libz", // For adler32.
421            ],
422        },
423    },
424
425    generated_sources: [
426        "art_operator_srcs",
427    ],
428    // asm_support_gen.h (used by asm_support.h) is generated with cpp-define-generator
429    generated_headers: ["cpp-define-generator-asm-support"],
430    // export our headers so the libart(d)-gtest targets can use it as well.
431    export_generated_headers: ["cpp-define-generator-asm-support"],
432
433    header_libs: [
434        "art_cmdlineparser_headers",
435        "cpp-define-generator-definitions",
436        "jni_platform_headers",
437        "libnativehelper_header_only",
438    ],
439    whole_static_libs: [
440        "libcpu_features",
441    ],
442    shared_libs: [
443        "libartpalette",
444        "libbacktrace",
445        "libbase", // For common macros.
446        "liblog",
447        "liblz4",
448        "liblzma", // libelffile(d) dependency; must be repeated here since it's a static lib.
449        "libnativebridge",
450        "libnativeloader",
451        "libsigchain",
452        "libunwindstack",
453    ],
454    static_libs: ["libodrstatslog"],
455
456    runtime_libs: [
457        // Libraries loaded at runtime. Exceptions:
458        // - libart(d)-compiler.so and libopenjdk(d).so cannot be listed here
459        //   due to cyclic dependency.
460        // - libicu_jni.so is only loaded to handle dependency order in VM
461        //   startup (see Runtime::InitNativeMethods), but its API is internal
462        //   to com.android.i18n and not used by ART/libcore. Therefore it's not
463        //   listed here to avoid visibility issues. Instead it's linked from
464        //   the ART module namespace through an entry in requireNativeLibs in
465        //   manifest-art.json.
466        "libjavacore",
467    ],
468
469    export_include_dirs: ["."],
470    // ART's macros.h depends on libbase's macros.h.
471    // Note: runtime_options.h depends on cmdline. But we don't really want to export this
472    //       generically. dex2oat takes care of it itself.
473    export_shared_lib_headers: ["libbase"],
474}
475
476libart_static_cc_defaults {
477    name: "libart_static_base_defaults",
478    whole_static_libs: [
479        "libartpalette",
480        "libbacktrace",
481        "libbase",
482        "liblog",
483        "liblz4",
484        "liblzma", // libelffile dependency; must be repeated here since it's a static lib.
485        "libnativebridge",
486        "libnativeloader",
487        "libodrstatslog",
488        "libsigchain_fake",
489        "libunwindstack",
490        "libz",
491    ],
492    target: {
493        bionic: {
494            whole_static_libs: [
495                "libasync_safe", // libunwindstack dependency on Bionic.
496            ],
497        },
498    },
499}
500
501cc_defaults {
502    name: "libart_static_defaults",
503    defaults: [
504        "libart_static_base_defaults",
505        "libartbase_static_defaults",
506        "libdexfile_static_defaults",
507        "libdexfile_support_static_defaults",
508        "libprofile_static_defaults",
509    ],
510    whole_static_libs: [
511        "libart",
512        "libelffile",
513    ],
514}
515
516cc_defaults {
517    name: "libartd_static_defaults",
518    defaults: [
519        "libart_static_base_defaults",
520        "libartbased_static_defaults",
521        "libdexfiled_static_defaults",
522        "libdexfiled_support_static_defaults",
523        "libprofiled_static_defaults",
524    ],
525    whole_static_libs: [
526        "libartd",
527        "libelffiled",
528    ],
529}
530
531gensrcs {
532    name: "art_operator_srcs",
533    cmd: "$(location generate_operator_out) art/runtime $(in) > $(out)",
534    tools: ["generate_operator_out"],
535    srcs: [
536        "base/callee_save_type.h",
537        "base/locks.h",
538        "class_status.h",
539        "compilation_kind.h",
540        "gc_root.h",
541        "gc/allocator_type.h",
542        "gc/allocator/rosalloc.h",
543        "gc/collector_type.h",
544        "gc/collector/gc_type.h",
545        "gc/space/region_space.h",
546        "gc/space/space.h",
547        "gc/weak_root_state.h",
548        "image.h",
549        "instrumentation.h",
550        "indirect_reference_table.h",
551        "jdwp_provider.h",
552        "jni_id_type.h",
553        "lock_word.h",
554        "oat_file.h",
555        "process_state.h",
556        "reflective_value_visitor.h",
557        "stack.h",
558        "suspend_reason.h",
559        "thread.h",
560        "thread_state.h",
561        "trace.h",
562        "verifier/verifier_enums.h",
563    ],
564    output_extension: "operator_out.cc",
565}
566
567// We always build dex2oat and dependencies, even if the host build is otherwise disabled, since
568// they are used to cross compile for the target.
569
570art_cc_library {
571    name: "libart",
572    defaults: [
573        "libart_defaults",
574        "libart_nativeunwind_defaults",
575        "art_hugepage_defaults",
576        "art_pgo_defaults",
577    ],
578    whole_static_libs: [
579    ],
580    static_libs: [
581        "libelffile",
582    ],
583    shared_libs: [
584        "libartbase",
585        "libdexfile",
586        "libprofile",
587    ],
588    export_shared_lib_headers: [
589        "libdexfile",
590    ],
591    target: {
592        android: {
593            lto: {
594                thin: true,
595            },
596        },
597    },
598    apex_available: [
599        "com.android.art",
600        "com.android.art.debug",
601    ],
602}
603
604art_cc_library {
605    name: "libartd",
606    defaults: [
607        "art_debug_defaults",
608        "libart_defaults",
609    ],
610    whole_static_libs: [
611    ],
612    static_libs: [
613        "libelffiled",
614    ],
615    shared_libs: [
616        "libartbased",
617        "libdexfiled",
618        "libprofiled",
619    ],
620    export_shared_lib_headers: [
621        "libdexfiled",
622    ],
623    apex_available: [
624        "com.android.art.debug",
625        // TODO(b/183882457): This lib doesn't go into com.android.art, but
626        // apex_available lists need to be the same for internal libs to avoid
627        // stubs, and this depends on libsigchain.
628        "com.android.art",
629    ],
630}
631
632art_cc_defaults {
633    name: "libart-runtime-gtest-defaults",
634    srcs: [
635        "common_runtime_test.cc",
636        "dexopt_test.cc",
637    ],
638    shared_libs: [
639        "libbase",
640        "libbacktrace",
641    ],
642    header_libs: [
643        "libnativehelper_header_only",
644    ],
645}
646
647art_cc_library {
648    name: "libart-runtime-gtest",
649    defaults: [
650        "libart-runtime-gtest-defaults",
651        "libart-gtest-defaults",
652    ],
653    shared_libs: [
654        "libart",
655        "libartbase-art-gtest",
656    ],
657}
658
659art_cc_library {
660    name: "libartd-runtime-gtest",
661    defaults: [
662        "libart-runtime-gtest-defaults",
663        "libartd-gtest-defaults",
664    ],
665    shared_libs: [
666        "libartd",
667        "libartbased-art-gtest",
668    ],
669}
670
671art_cc_defaults {
672    name: "art_runtime_tests_defaults",
673    data: [
674        ":art-gtest-jars-AllFields",
675        ":art-gtest-jars-ErroneousA",
676        ":art-gtest-jars-ErroneousB",
677        ":art-gtest-jars-ErroneousInit",
678        ":art-gtest-jars-Extension1",
679        ":art-gtest-jars-Extension2",
680        ":art-gtest-jars-ForClassLoaderA",
681        ":art-gtest-jars-ForClassLoaderB",
682        ":art-gtest-jars-ForClassLoaderC",
683        ":art-gtest-jars-ForClassLoaderD",
684        ":art-gtest-jars-HiddenApiSignatures",
685        ":art-gtest-jars-IMTA",
686        ":art-gtest-jars-IMTB",
687        ":art-gtest-jars-Instrumentation",
688        ":art-gtest-jars-Interfaces",
689        ":art-gtest-jars-LinkageTest",
690        ":art-gtest-jars-Main",
691        ":art-gtest-jars-MainStripped",
692        ":art-gtest-jars-MainUncompressedAligned",
693        ":art-gtest-jars-MethodTypes",
694        ":art-gtest-jars-MultiDex",
695        ":art-gtest-jars-MultiDexModifiedSecondary",
696        ":art-gtest-jars-MultiDexUncompressedAligned",
697        ":art-gtest-jars-MyClass",
698        ":art-gtest-jars-MyClassNatives",
699        ":art-gtest-jars-Nested",
700        ":art-gtest-jars-Packages",
701        ":art-gtest-jars-ProfileTestMultiDex",
702        ":art-gtest-jars-ProtoCompare",
703        ":art-gtest-jars-ProtoCompare2",
704        ":art-gtest-jars-StaticLeafMethods",
705        ":art-gtest-jars-Statics",
706        ":art-gtest-jars-StaticsFromCode",
707        ":art-gtest-jars-Transaction",
708        ":art-gtest-jars-VerifierDeps",
709        ":art-gtest-jars-VerifierDepsMulti",
710        ":art-gtest-jars-XandY",
711    ],
712    srcs: [
713        "app_info_test.cc",
714        "arch/arch_test.cc",
715        "arch/instruction_set_features_test.cc",
716        "arch/memcmp16_test.cc",
717        "arch/stub_test.cc",
718        "arch/arm/instruction_set_features_arm_test.cc",
719        "arch/arm64/instruction_set_features_arm64_test.cc",
720        "arch/x86/instruction_set_features_x86_test.cc",
721        "arch/x86_64/instruction_set_features_x86_64_test.cc",
722        "barrier_test.cc",
723        "base/message_queue_test.cc",
724        "base/mutex_test.cc",
725        "base/timing_logger_test.cc",
726        "cha_test.cc",
727        "class_linker_test.cc",
728        "class_loader_context_test.cc",
729        "class_table_test.cc",
730        "entrypoints/math_entrypoints_test.cc",
731        "entrypoints/quick/quick_trampoline_entrypoints_test.cc",
732        "entrypoints_order_test.cc",
733        "exec_utils_test.cc",
734        "gc/accounting/card_table_test.cc",
735        "gc/accounting/mod_union_table_test.cc",
736        "gc/accounting/space_bitmap_test.cc",
737        "gc/collector/immune_spaces_test.cc",
738        "gc/heap_test.cc",
739        "gc/heap_verification_test.cc",
740        "gc/reference_queue_test.cc",
741        "gc/space/dlmalloc_space_static_test.cc",
742        "gc/space/dlmalloc_space_random_test.cc",
743        "gc/space/image_space_test.cc",
744        "gc/space/large_object_space_test.cc",
745        "gc/space/rosalloc_space_static_test.cc",
746        "gc/space/rosalloc_space_random_test.cc",
747        "gc/space/space_create_test.cc",
748        "gc/system_weak_test.cc",
749        "gc/task_processor_test.cc",
750        "gtest_test.cc",
751        "handle_scope_test.cc",
752        "hidden_api_test.cc",
753        "imtable_test.cc",
754        "indirect_reference_table_test.cc",
755        "instrumentation_test.cc",
756        "intern_table_test.cc",
757        "interpreter/safe_math_test.cc",
758        "interpreter/unstarted_runtime_test.cc",
759        "jit/jit_memory_region_test.cc",
760        "jit/profile_saver_test.cc",
761        "jit/profiling_info_test.cc",
762        "jni/java_vm_ext_test.cc",
763        "jni/jni_internal_test.cc",
764        "method_handles_test.cc",
765        "metrics/reporter_test.cc",
766        "mirror/dex_cache_test.cc",
767        "mirror/method_type_test.cc",
768        "mirror/object_test.cc",
769        "mirror/var_handle_test.cc",
770        "monitor_pool_test.cc",
771        "monitor_test.cc",
772        "oat_file_test.cc",
773        "oat_file_assistant_test.cc",
774        "parsed_options_test.cc",
775        "prebuilt_tools_test.cc",
776        "proxy_test.cc",
777        "reference_table_test.cc",
778        "runtime_callbacks_test.cc",
779        "runtime_test.cc",
780        "subtype_check_info_test.cc",
781        "subtype_check_test.cc",
782        "thread_pool_test.cc",
783        "transaction_test.cc",
784        "two_runtimes_test.cc",
785        "vdex_file_test.cc",
786        "verifier/method_verifier_test.cc",
787        "verifier/reg_type_test.cc",
788    ],
789    shared_libs: [
790        "libbacktrace",
791    ],
792    header_libs: [
793        "art_cmdlineparser_headers", // For parsed_options_test.
794    ],
795}
796
797// Version of ART gtest `art_runtime_tests` bundled with the ART APEX on target.
798// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
799art_cc_test {
800    name: "art_runtime_tests",
801    defaults: [
802        "art_gtest_defaults",
803        "art_runtime_tests_defaults",
804    ],
805    target: {
806        host: {
807            required: ["dex2oatd"],
808        },
809    },
810}
811
812// Standalone version of ART gtest `art_runtime_tests`, not bundled with the ART APEX on target.
813art_cc_test {
814    name: "art_standalone_runtime_tests",
815    defaults: [
816        "art_standalone_gtest_defaults",
817        "art_runtime_tests_defaults",
818    ],
819    target: {
820        host: {
821            required: ["dex2oat"],
822        },
823    },
824    // Some tests are currently failing (observed on
825    // `aosp_cf_x86_64_phone-userdebug`); use a special test configuration for
826    // `art_standalone_runtime_tests` to filter them out for now.
827    // TODO(b/162834439): Investigate these failures and re-enable these tests.
828    test_config: "art_standalone_runtime_tests.xml",
829}
830
831art_cc_defaults {
832    name: "art_runtime_compiler_tests_defaults",
833    srcs: [
834        "reflection_test.cc",
835        "module_exclusion_test.cc",
836    ],
837    data: [
838        ":art-gtest-jars-Main",
839        ":art-gtest-jars-NonStaticLeafMethods",
840        ":art-gtest-jars-StaticLeafMethods",
841    ],
842}
843
844// Version of ART gtest `art_runtime_compiler_tests` bundled with the ART APEX on target.
845// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
846art_cc_test {
847    name: "art_runtime_compiler_tests",
848    defaults: [
849        "art_gtest_defaults",
850        "art_runtime_compiler_tests_defaults",
851    ],
852    shared_libs: [
853        "libartd-compiler",
854    ],
855    target: {
856        host: {
857            required: ["dex2oatd"],
858        },
859    },
860}
861
862// Standalone version of ART gtest `art_runtime_compiler_tests`, not bundled with the ART APEX on
863// target.
864art_cc_test {
865    name: "art_standalone_runtime_compiler_tests",
866    defaults: [
867        "art_standalone_gtest_defaults",
868        "art_runtime_compiler_tests_defaults",
869    ],
870    shared_libs: [
871        "libart-compiler",
872    ],
873    target: {
874        host: {
875            required: ["dex2oat"],
876        },
877    },
878    test_config: "art_standalone_runtime_compiler_tests.xml",
879}
880
881cc_library_headers {
882    name: "libart_runtime_headers_ndk",
883    host_supported: true,
884    export_include_dirs: ["."],
885    sdk_version: "current",
886
887    apex_available: [
888        "com.android.art",
889        "com.android.art.debug",
890    ],
891    min_sdk_version: "S",
892}
893
894genrule {
895    name: "libart_mterp.arm",
896    out: ["mterp_arm.S"],
897    srcs: ["interpreter/mterp/arm/*.S"],
898    tool_files: [
899        "interpreter/mterp/gen_mterp.py",
900        "interpreter/mterp/common/gen_setup.py",
901        ":art_libdexfile_dex_instruction_list_header",
902    ],
903    cmd: "$(location interpreter/mterp/gen_mterp.py) $(out) $(in)",
904}
905
906genrule {
907    name: "libart_mterp.arm64",
908    out: ["mterp_arm64.S"],
909    srcs: ["interpreter/mterp/arm64/*.S"],
910    tool_files: [
911        "interpreter/mterp/gen_mterp.py",
912        "interpreter/mterp/common/gen_setup.py",
913        ":art_libdexfile_dex_instruction_list_header",
914    ],
915    cmd: "$(location interpreter/mterp/gen_mterp.py) $(out) $(in)",
916}
917
918genrule {
919    name: "libart_mterp.x86",
920    out: ["mterp_x86.S"],
921    srcs: ["interpreter/mterp/x86/*.S"],
922    tool_files: [
923        "interpreter/mterp/gen_mterp.py",
924        "interpreter/mterp/common/gen_setup.py",
925        ":art_libdexfile_dex_instruction_list_header",
926    ],
927    cmd: "$(location interpreter/mterp/gen_mterp.py) $(out) $(in)",
928}
929
930genrule {
931    name: "libart_mterp.x86_64",
932    out: ["mterp_x86_64.S"],
933    srcs: ["interpreter/mterp/x86_64/*.S"],
934    tool_files: [
935        "interpreter/mterp/gen_mterp.py",
936        "interpreter/mterp/common/gen_setup.py",
937        ":art_libdexfile_dex_instruction_list_header",
938    ],
939    cmd: "$(location interpreter/mterp/gen_mterp.py) $(out) $(in)",
940}
941
942genrule {
943    name: "libart_mterp.x86_64ng",
944    out: ["mterp_x86_64ng.S"],
945    srcs: [
946        "interpreter/mterp/x86_64ng/*.S",
947        "interpreter/mterp/x86_64/arithmetic.S",
948        "interpreter/mterp/x86_64/floating_point.S",
949    ],
950    tool_files: [
951        "interpreter/mterp/gen_mterp.py",
952        "interpreter/mterp/common/gen_setup.py",
953        ":art_libdexfile_dex_instruction_list_header",
954    ],
955    cmd: "$(location interpreter/mterp/gen_mterp.py) $(out) $(in)",
956}
957
958genrule {
959    name: "libart_mterp.arm64ng",
960    out: ["mterp_arm64ng.S"],
961    srcs: [
962        "interpreter/mterp/arm64ng/*.S",
963        "interpreter/mterp/arm64/arithmetic.S",
964        "interpreter/mterp/arm64/floating_point.S",
965    ],
966    tool_files: [
967        "interpreter/mterp/gen_mterp.py",
968        "interpreter/mterp/common/gen_setup.py",
969        ":art_libdexfile_dex_instruction_list_header",
970    ],
971    cmd: "$(location interpreter/mterp/gen_mterp.py) $(out) $(in)",
972}
973
974genrule {
975    name: "libart_mterp.armng",
976    out: ["mterp_armng.S"],
977    srcs: [
978        "interpreter/mterp/armng/*.S",
979    ],
980    tool_files: [
981        "interpreter/mterp/gen_mterp.py",
982        "interpreter/mterp/common/gen_setup.py",
983        ":art_libdexfile_dex_instruction_list_header",
984    ],
985    cmd: "$(location interpreter/mterp/gen_mterp.py) $(out) $(in)",
986}
987
988cc_library_static {
989    name: "libstatslog_art",
990    defaults: ["art_defaults"],
991    generated_sources: ["statslog_art.cpp"],
992    generated_headers: ["statslog_art.h"],
993    export_generated_headers: ["statslog_art.h"],
994    shared_libs: [
995        "liblog",
996        "libstatssocket",
997        "libutils",
998    ],
999    apex_available: [
1000        "com.android.art",
1001        "com.android.art.debug",
1002    ],
1003}
1004
1005genrule {
1006    name: "statslog_art.h",
1007    tools: ["stats-log-api-gen"],
1008    cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_art.h --module art --namespace art,metrics,statsd",
1009    out: [
1010        "statslog_art.h",
1011    ],
1012}
1013
1014genrule {
1015    name: "statslog_art.cpp",
1016    tools: ["stats-log-api-gen"],
1017    cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_art.cpp --module art --namespace art,metrics,statsd --importHeader statslog_art.h",
1018    out: [
1019        "statslog_art.cpp",
1020    ],
1021}
1022