blob: c92df4e298ff5b15a3e147210c18d4bac498ba0e [file] [log] [blame]
Colin Cross1f7f3bd2016-07-27 10:12:38 -07001//
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.
21JIT_DEBUG_REGISTER_CODE_LDFLAGS = ["-Wl,--keep-unique,__jit_debug_register_code"]
22
23cc_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",
100 "interpreter/interpreter_goto_table_impl.cc",
101 "interpreter/interpreter_switch_impl.cc",
102 "interpreter/unstarted_runtime.cc",
103 "java_vm_ext.cc",
104 "jdwp/jdwp_event.cc",
105 "jdwp/jdwp_expand_buf.cc",
106 "jdwp/jdwp_handler.cc",
107 "jdwp/jdwp_main.cc",
108 "jdwp/jdwp_request.cc",
109 "jdwp/jdwp_socket.cc",
110 "jdwp/object_registry.cc",
111 "jni_env_ext.cc",
112 "jit/debugger_interface.cc",
113 "jit/jit.cc",
114 "jit/jit_code_cache.cc",
115 "jit/offline_profiling_info.cc",
116 "jit/profiling_info.cc",
117 "jit/profile_saver.cc",
118 "jni_internal.cc",
119 "jobject_comparator.cc",
120 "linear_alloc.cc",
121 "mem_map.cc",
122 "memory_region.cc",
123 "mirror/abstract_method.cc",
124 "mirror/array.cc",
125 "mirror/class.cc",
126 "mirror/dex_cache.cc",
127 "mirror/field.cc",
128 "mirror/method.cc",
129 "mirror/object.cc",
130 "mirror/reference.cc",
131 "mirror/stack_trace_element.cc",
132 "mirror/string.cc",
133 "mirror/throwable.cc",
134 "monitor.cc",
135 "native_bridge_art_interface.cc",
136 "native_stack_dump.cc",
137 "native/dalvik_system_DexFile.cc",
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",
223 "entrypoints/quick/quick_field_entrypoints.cc",
224 "entrypoints/quick/quick_fillarray_entrypoints.cc",
225 "entrypoints/quick/quick_instrumentation_entrypoints.cc",
226 "entrypoints/quick/quick_jni_entrypoints.cc",
227 "entrypoints/quick/quick_lock_entrypoints.cc",
228 "entrypoints/quick/quick_math_entrypoints.cc",
229 "entrypoints/quick/quick_thread_entrypoints.cc",
230 "entrypoints/quick/quick_throw_entrypoints.cc",
231 "entrypoints/quick/quick_trampoline_entrypoints.cc",
232 ],
233
234 arch: {
235 arm: {
236 clang_asflags: ["-no-integrated-as"],
237 srcs: [
238 "interpreter/mterp/mterp.cc",
239 "interpreter/mterp/out/mterp_arm.S",
240 "arch/arm/context_arm.cc",
241 "arch/arm/entrypoints_init_arm.cc",
242 "arch/arm/instruction_set_features_assembly_tests.S",
243 "arch/arm/jni_entrypoints_arm.S",
244 "arch/arm/memcmp16_arm.S",
245 "arch/arm/quick_entrypoints_arm.S",
246 "arch/arm/quick_entrypoints_cc_arm.cc",
247 "arch/arm/thread_arm.cc",
248 "arch/arm/fault_handler_arm.cc",
249 ],
250 },
251 arm64: {
252 srcs: [
253 "interpreter/mterp/mterp.cc",
254 "interpreter/mterp/out/mterp_arm64.S",
255 "arch/arm64/context_arm64.cc",
256 "arch/arm64/entrypoints_init_arm64.cc",
257 "arch/arm64/jni_entrypoints_arm64.S",
258 "arch/arm64/memcmp16_arm64.S",
259 "arch/arm64/quick_entrypoints_arm64.S",
260 "arch/arm64/thread_arm64.cc",
261 "monitor_pool.cc",
262 "arch/arm64/fault_handler_arm64.cc",
263 ],
264 },
265 x86: {
266 srcs: [
267 "interpreter/mterp/mterp.cc",
268 "interpreter/mterp/out/mterp_x86.S",
269 "arch/x86/context_x86.cc",
270 "arch/x86/entrypoints_init_x86.cc",
271 "arch/x86/jni_entrypoints_x86.S",
272 "arch/x86/memcmp16_x86.S",
273 "arch/x86/quick_entrypoints_x86.S",
274 "arch/x86/thread_x86.cc",
275 "arch/x86/fault_handler_x86.cc",
276 ],
277 },
278 x86_64: {
279 srcs: [
280 // Note that the fault_handler_x86.cc is not a mistake. This file is
281 // shared between the x86 and x86_64 architectures.
282 "interpreter/mterp/mterp.cc",
283 "interpreter/mterp/out/mterp_x86_64.S",
284 "arch/x86_64/context_x86_64.cc",
285 "arch/x86_64/entrypoints_init_x86_64.cc",
286 "arch/x86_64/jni_entrypoints_x86_64.S",
287 "arch/x86_64/memcmp16_x86_64.S",
288 "arch/x86_64/quick_entrypoints_x86_64.S",
289 "arch/x86_64/thread_x86_64.cc",
290 "monitor_pool.cc",
291 "arch/x86/fault_handler_x86.cc",
292 ],
293 },
294 mips: {
295 srcs: [
296 "interpreter/mterp/mterp.cc",
297 "interpreter/mterp/out/mterp_mips.S",
298 "arch/mips/context_mips.cc",
299 "arch/mips/entrypoints_init_mips.cc",
300 "arch/mips/jni_entrypoints_mips.S",
301 "arch/mips/memcmp16_mips.S",
302 "arch/mips/quick_entrypoints_mips.S",
303 "arch/mips/thread_mips.cc",
304 "arch/mips/fault_handler_mips.cc",
305 ],
306 },
307 mips64: {
308 srcs: [
309 "interpreter/mterp/mterp.cc",
310 "interpreter/mterp/out/mterp_mips64.S",
311 "arch/mips64/context_mips64.cc",
312 "arch/mips64/entrypoints_init_mips64.cc",
313 "arch/mips64/jni_entrypoints_mips64.S",
314 "arch/mips64/memcmp16_mips64.S",
315 "arch/mips64/quick_entrypoints_mips64.S",
316 "arch/mips64/thread_mips64.cc",
317 "monitor_pool.cc",
318 "arch/mips64/fault_handler_mips64.cc",
319 ],
320 },
321 },
322 target: {
323 android: {
324 srcs: [
325 "jdwp/jdwp_adb.cc",
326 "monitor_android.cc",
327 "runtime_android.cc",
328 "thread_android.cc",
329 ],
330 shared_libs: [
331 "libdl",
332 // For android::FileMap used by libziparchive.
333 "libutils",
334 ],
335 static_libs: [
336 // ZipArchive support, the order matters here to get all symbols.
337 "libziparchive",
338 "libz",
339 "libbase",
340 ],
341 },
342 android_arm: {
343 ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
344 },
345 android_arm64: {
346 ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
347 },
348 android_x86: {
349 ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
350 },
351 android_x86_64: {
352 ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
353 },
354 host: {
355 srcs: [
356 "monitor_linux.cc",
357 "runtime_linux.cc",
358 "thread_linux.cc",
359 ],
360 shared_libs: [
361 "libziparchive",
Colin Cross19f28f12016-08-25 16:42:09 -0700362 "libz-host",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700363 ],
364 },
365 },
366 cflags: ["-DBUILDING_LIBART=1"],
367 generated_sources: ["art_operator_srcs"],
368 clang: true,
369 include_dirs: [
370 "art/cmdline",
371 "art/sigchainlib",
372 "art",
373 ],
374 shared_libs: [
375 "libnativehelper",
376 "libnativebridge",
377 "libnativeloader",
378 "libbacktrace",
379 "liblz4",
380 // For liblog, atrace, properties, ashmem, set_sched_policy and socket_peer_is_trusted.
381 "libcutils",
382 ],
383 static: {
384 static_libs: ["libsigchain_dummy"],
385 },
386 shared: {
387 shared_libs: ["libsigchain"],
388 },
389 export_include_dirs: ["."],
390}
391
392gensrcs {
393 name: "art_operator_srcs",
394 cmd: "art/tools/generate-operator-out.py art/runtime $in > $out",
395 srcs: [
396 "arch/instruction_set.h",
397 "base/allocator.h",
398 "base/enums.h",
399 "base/mutex.h",
400 "debugger.h",
401 "base/unix_file/fd_file.h",
402 "dex_file.h",
403 "dex_instruction.h",
404 "dex_instruction_utils.h",
405 "gc_root.h",
406 "gc/allocator_type.h",
407 "gc/allocator/rosalloc.h",
408 "gc/collector_type.h",
409 "gc/collector/gc_type.h",
410 "gc/heap.h",
411 "gc/space/region_space.h",
412 "gc/space/space.h",
413 "gc/weak_root_state.h",
414 "image.h",
415 "instrumentation.h",
416 "indirect_reference_table.h",
417 "invoke_type.h",
418 "jdwp/jdwp.h",
419 "jdwp/jdwp_constants.h",
420 "lock_word.h",
421 "mirror/class.h",
422 "oat.h",
423 "object_callbacks.h",
424 "process_state.h",
425 "quick/inline_method_analyser.h",
426 "runtime.h",
427 "stack.h",
428 "thread.h",
429 "thread_state.h",
430 "ti/agent.h",
431 "verifier/method_verifier.h",
432 ],
433 output_extension: "operator_out.cc",
434}
435
436// We always build dex2oat and dependencies, even if the host build is otherwise disabled, since
437// they are used to cross compile for the target.
438
439art_cc_library {
440 name: "libart",
441 defaults: ["libart_defaults"],
Andreas Gampe20ada112016-08-29 08:51:15 -0700442 // Leave the symbols in the shared library so that stack unwinders can
443 // produce meaningful name resolution.
444 strip: {
445 keep_symbols: true,
446 },
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700447}
448
449art_cc_library {
450 name: "libartd",
451 defaults: [
452 "libart_defaults",
453 "art_debug_defaults",
454 ],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700455}
456
457subdirs = [
458 "openjdkjvm",
459 "openjdkjvmti",
460 "simulator",
461]