1 // 2 // Copyright (C) 2016 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 art_cc_defaults { 18 name: "art_test_defaults", 19 host_supported: true, 20 target: { 21 android_arm: { 22 relative_install_path: "art/arm", 23 }, 24 android_arm64: { 25 relative_install_path: "art/arm64", 26 }, 27 android_mips: { 28 relative_install_path: "art/mips", 29 }, 30 android_mips64: { 31 relative_install_path: "art/mips64", 32 }, 33 android_x86: { 34 relative_install_path: "art/x86", 35 }, 36 android_x86_64: { 37 relative_install_path: "art/x86_64", 38 }, 39 darwin: { 40 enabled: false, 41 }, 42 }, 43 cflags: [ 44 "-Wno-frame-larger-than=", 45 ], 46 } 47 48 art_cc_defaults { 49 name: "art_gtest_defaults", 50 test_per_src: true, 51 // These really are gtests, but the gtest library comes from libart-gtest.so 52 gtest: false, 53 defaults: [ 54 "art_defaults", 55 "art_debug_defaults", 56 "art_test_defaults", 57 ], 58 59 shared_libs: [ 60 "libartd", 61 "libartd-disassembler", 62 "libvixld-arm", 63 "libvixld-arm64", 64 "libart-gtest", 65 66 "libbase", 67 "libicuuc", 68 "libicui18n", 69 "libnativehelper", 70 ], 71 whole_static_libs: [ 72 "libsigchain", 73 ], 74 include_dirs: [ 75 "art", 76 "art/cmdline", 77 ], 78 79 target: { 80 linux: { 81 ldflags: [ 82 // Allow jni_compiler_test to find Java_MyClassNatives_bar 83 // within itself using dlopen(NULL, ...). 84 // Mac OS linker doesn't understand --export-dynamic. 85 "-Wl,--export-dynamic", 86 "-Wl,-u,Java_MyClassNatives_bar", 87 "-Wl,-u,Java_MyClassNatives_sbar", 88 ], 89 shared_libs: [ 90 "libziparchive", 91 "libz-host", 92 ], 93 host_ldlibs: [ 94 "-ldl", 95 "-lpthread", 96 ], 97 cflags: [ 98 // gtest issue 99 "-Wno-used-but-marked-unused", 100 "-Wno-deprecated", 101 "-Wno-missing-noreturn", 102 ], 103 }, 104 android: { 105 ldflags: [ 106 // Allow jni_compiler_test to find Java_MyClassNatives_bar 107 // within itself using dlopen(NULL, ...). 108 "-Wl,--export-dynamic", 109 "-Wl,-u,Java_MyClassNatives_bar", 110 "-Wl,-u,Java_MyClassNatives_sbar", 111 ], 112 shared_libs: [ 113 "liblog", 114 "libdl", 115 "libz", 116 ], 117 cflags: [ 118 // gtest issue 119 "-Wno-used-but-marked-unused", 120 "-Wno-deprecated", 121 "-Wno-missing-noreturn", 122 ], 123 }, 124 }, 125 } 126 127 art_cc_defaults { 128 name: "libart-gtest-defaults", 129 host_supported: true, 130 defaults: [ 131 "art_defaults", 132 "art_debug_defaults", 133 ], 134 shared_libs: [ 135 "libartd", 136 "libartd-compiler", 137 ], 138 static_libs: [ 139 "libgtest", 140 ], 141 target: { 142 android32: { 143 cflags: ["-DART_TARGET_NATIVETEST_DIR=/data/nativetest/art"], 144 }, 145 android64: { 146 cflags: ["-DART_TARGET_NATIVETEST_DIR=/data/nativetest64/art"], 147 }, 148 android: { 149 cflags: [ 150 // gtest issue 151 "-Wno-used-but-marked-unused", 152 "-Wno-deprecated", 153 "-Wno-missing-noreturn", 154 ], 155 }, 156 linux: { 157 cflags: [ 158 // gtest issue 159 "-Wno-used-but-marked-unused", 160 "-Wno-deprecated", 161 "-Wno-missing-noreturn", 162 ], 163 }, 164 darwin: { 165 enabled: false, 166 }, 167 }, 168 } 169 170 art_cc_library { 171 name: "libart-gtest", 172 host_supported: true, 173 whole_static_libs: [ 174 "libart-compiler-gtest", 175 "libart-runtime-gtest", 176 "libgtest" 177 ], 178 shared_libs: [ 179 "libartd", 180 "libartd-compiler", 181 "libbase", 182 "libbacktrace" 183 ], 184 target: { 185 android: { 186 shared_libs: [ 187 "libdl", 188 ], 189 }, 190 host: { 191 host_ldlibs: [ 192 "-ldl", 193 "-lpthread", 194 ], 195 }, 196 darwin: { 197 enabled: false, 198 }, 199 }, 200 } 201 202 cc_defaults { 203 name: "libartagent-defaults", 204 defaults: [ 205 "art_defaults", 206 "art_test_defaults", 207 ], 208 shared_libs: [ 209 "libbacktrace", 210 "libbase", 211 "libnativehelper", 212 ], 213 target: { 214 android: { 215 shared_libs: ["libdl"], 216 }, 217 host: { 218 host_ldlibs: [ 219 "-ldl", 220 "-lpthread", 221 ], 222 }, 223 }, 224 } 225 226 art_cc_test_library { 227 name: "libartagent", 228 srcs: ["900-hello-plugin/load_unload.cc"], 229 defaults: ["libartagent-defaults"], 230 shared_libs: ["libart"], 231 } 232 233 art_cc_test_library { 234 name: "libartagentd", 235 srcs: ["900-hello-plugin/load_unload.cc"], 236 defaults: [ 237 "libartagent-defaults", 238 "art_debug_defaults", 239 ], 240 shared_libs: ["libartd"], 241 } 242 243 art_cc_defaults { 244 name: "libtiagent-base-defaults", 245 defaults: ["libartagent-defaults"], 246 srcs: [ 247 // These are the ART-independent parts. 248 "ti-agent/agent_common.cc", 249 "ti-agent/agent_startup.cc", 250 "ti-agent/jni_binder.cc", 251 "ti-agent/jvmti_helper.cc", 252 "ti-agent/test_env.cc", 253 "ti-agent/common_helper.cc", 254 // This is the list of non-special OnLoad things and excludes BCI and anything that depends 255 // on ART internals. 256 "903-hello-tagging/tagging.cc", 257 "904-object-allocation/tracking.cc", 258 "905-object-free/tracking_free.cc", 259 "906-iterate-heap/iterate_heap.cc", 260 "907-get-loaded-classes/get_loaded_classes.cc", 261 "908-gc-start-finish/gc_callbacks.cc", 262 "910-methods/methods.cc", 263 "911-get-stack-trace/stack_trace.cc", 264 "912-classes/classes.cc", 265 "913-heaps/heaps.cc", 266 "918-fields/fields.cc", 267 "920-objects/objects.cc", 268 "922-properties/properties.cc", 269 "923-monitors/monitors.cc", 270 "924-threads/threads.cc", 271 "925-threadgroups/threadgroups.cc", 272 "927-timers/timers.cc", 273 "928-jni-table/jni_table.cc", 274 "929-search/search.cc", 275 "931-agent-thread/agent_thread.cc", 276 "933-misc-events/misc_events.cc", 277 "945-obsolete-native/obsolete_native.cc", 278 "984-obsolete-invoke/obsolete_invoke.cc", 279 "986-native-method-bind/native_bind.cc", 280 "987-agent-bind/agent_bind.cc", 281 ], 282 shared_libs: [ 283 "libbase", 284 ], 285 header_libs: ["libopenjdkjvmti_headers"], 286 include_dirs: ["art/test/ti-agent"], 287 } 288 289 art_cc_defaults { 290 name: "libtiagent-defaults", 291 defaults: ["libtiagent-base-defaults"], 292 srcs: [ 293 // This is to get the IsInterpreted native method. 294 "common/stack_inspect.cc", 295 "common/runtime_state.cc", 296 "ti-agent/common_load.cc", 297 // This includes the remaining test functions. We should try to refactor things to 298 // make this list smaller. 299 "901-hello-ti-agent/basics.cc", 300 "909-attach-agent/attach.cc", 301 "912-classes/classes_art.cc", 302 "936-search-onload/search_onload.cc", 303 "983-source-transform-verify/source_transform.cc", 304 ], 305 } 306 307 art_cc_test_library { 308 name: "libtiagent", 309 defaults: ["libtiagent-defaults"], 310 shared_libs: ["libart"], 311 } 312 313 art_cc_test_library { 314 name: "libtiagentd", 315 defaults: [ 316 "libtiagent-defaults", 317 "art_debug_defaults", 318 ], 319 shared_libs: ["libartd"], 320 } 321 322 art_cc_defaults { 323 name: "libtistress-defaults", 324 defaults: ["libartagent-defaults"], 325 srcs: [ 326 "ti-stress/stress.cc", 327 ], 328 shared_libs: [ 329 "libbase", 330 ], 331 header_libs: ["libopenjdkjvmti_headers"], 332 } 333 334 art_cc_test_library { 335 name: "libtistress", 336 defaults: [ "libtistress-defaults"], 337 shared_libs: ["libart"], 338 } 339 340 art_cc_test_library { 341 name: "libtistressd", 342 defaults: [ 343 "libtistress-defaults", 344 "art_debug_defaults", 345 ], 346 shared_libs: ["libartd"], 347 } 348 349 art_cc_test_library { 350 name: "libctstiagent", 351 defaults: ["libtiagent-base-defaults"], 352 export_include_dirs: ["ti-agent"], 353 } 354 355 cc_defaults { 356 name: "libarttest-defaults", 357 defaults: [ 358 "art_defaults", 359 "art_test_defaults", 360 ], 361 srcs: [ 362 "common/runtime_state.cc", 363 "common/stack_inspect.cc", 364 "004-JniTest/jni_test.cc", 365 "004-SignalTest/signaltest.cc", 366 "004-ReferenceMap/stack_walk_refmap_jni.cc", 367 "004-StackWalk/stack_walk_jni.cc", 368 "004-ThreadStress/thread_stress.cc", 369 "004-UnsafeTest/unsafe_test.cc", 370 "044-proxy/native_proxy.cc", 371 "051-thread/thread_test.cc", 372 "117-nopatchoat/nopatchoat.cc", 373 "1337-gc-coverage/gc_coverage.cc", 374 "136-daemon-jni-shutdown/daemon_jni_shutdown.cc", 375 "137-cfi/cfi.cc", 376 "139-register-natives/regnative.cc", 377 "141-class-unload/jni_unload.cc", 378 "148-multithread-gc-annotations/gc_coverage.cc", 379 "149-suspend-all-stress/suspend_all.cc", 380 "154-gc-loop/heap_interface.cc", 381 "454-get-vreg/get_vreg_jni.cc", 382 "457-regs/regs_jni.cc", 383 "461-get-reference-vreg/get_reference_vreg_jni.cc", 384 "466-get-live-vreg/get_live_vreg_jni.cc", 385 "497-inlining-and-class-loader/clear_dex_cache.cc", 386 "543-env-long-ref/env_long_ref.cc", 387 "566-polymorphic-inlining/polymorphic_inline.cc", 388 "570-checker-osr/osr.cc", 389 "595-profile-saving/profile-saving.cc", 390 "596-app-images/app_images.cc", 391 "596-monitor-inflation/monitor_inflation.cc", 392 "597-deopt-new-string/deopt.cc", 393 "626-const-class-linking/clear_dex_cache_types.cc", 394 "642-fp-callees/fp_callees.cc", 395 "647-jni-get-field-id/get_field_id.cc", 396 "656-annotation-lookup-generic-jni/test.cc" 397 ], 398 shared_libs: [ 399 "libbacktrace", 400 "libbase", 401 "libnativehelper", 402 ], 403 target: { 404 android: { 405 shared_libs: ["libdl"], 406 }, 407 host: { 408 host_ldlibs: [ 409 "-ldl", 410 "-lpthread", 411 ], 412 }, 413 }, 414 } 415 416 art_cc_test_library { 417 name: "libarttest", 418 defaults: ["libarttest-defaults"], 419 shared_libs: ["libart"], 420 } 421 422 art_cc_test_library { 423 name: "libarttestd", 424 defaults: [ 425 "libarttest-defaults", 426 "art_debug_defaults", 427 ], 428 shared_libs: ["libartd"], 429 } 430 431 art_cc_test_library { 432 name: "libnativebridgetest", 433 shared_libs: ["libart"], 434 defaults: [ 435 "art_defaults", 436 "art_debug_defaults", 437 "art_test_defaults", 438 ], 439 srcs: ["115-native-bridge/nativebridge.cc"], 440 target: { 441 android: { 442 shared_libs: ["libdl"], 443 }, 444 host: { 445 host_ldlibs: [ 446 "-ldl", 447 "-lpthread", 448 ], 449 }, 450 linux: { 451 host_ldlibs: ["-lrt"], 452 }, 453 }, 454 } 455