blob: 248a9d25c7532f71470fb133260b6d774918a5b7 [file] [log] [blame]
Dan Willemsen194edf72016-08-26 15:01:36 -07001cc_defaults {
2 name: "libmemunreachable_defaults",
3
4 cflags: [
Dan Willemsen194edf72016-08-26 15:01:36 -07005 "-Wall",
6 "-Wextra",
7 "-Werror",
8 ],
Dan Willemsen194edf72016-08-26 15:01:36 -07009 shared_libs: [
10 "libbase",
Dan Willemsen194edf72016-08-26 15:01:36 -070011 ],
Christopher Ferris47dea712017-05-03 17:34:29 -070012
13 target: {
14 android: {
15 static_libs: ["libasync_safe"],
16 },
17 host: {
18 shared_libs: ["liblog"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080019 },
Christopher Ferris47dea712017-05-03 17:34:29 -070020 },
Dan Willemsen194edf72016-08-26 15:01:36 -070021}
22
Colin Cross51e6c252018-02-27 16:00:00 -080023cc_library {
Dan Willemsen194edf72016-08-26 15:01:36 -070024 name: "libmemunreachable",
25 defaults: ["libmemunreachable_defaults"],
26 srcs: [
27 "Allocator.cpp",
Colin Crossf572b912017-06-20 18:07:29 -070028 "Binder.cpp",
Dan Willemsen194edf72016-08-26 15:01:36 -070029 "HeapWalker.cpp",
30 "LeakFolding.cpp",
31 "LeakPipe.cpp",
Dan Willemsen194edf72016-08-26 15:01:36 -070032 "MemUnreachable.cpp",
33 "ProcessMappings.cpp",
34 "PtracerThread.cpp",
35 "ThreadCapture.cpp",
36 ],
37
38 static_libs: [
39 "libc_malloc_debug_backtrace",
Yabin Cui3841acc2018-05-10 17:19:12 -070040 "libprocinfo",
Dan Willemsen194edf72016-08-26 15:01:36 -070041 ],
42 // Only need this for arm since libc++ uses its own unwind code that
43 // doesn't mix with the other default unwind code.
44 arch: {
45 arm: {
46 static_libs: ["libunwind_llvm"],
47 },
48 },
Chih-Hung Hsieh29e54f82018-03-09 14:43:17 -080049
50 // TODO(b/78118944), clang lld link flags do not work with special link
51 // rules for libunwind_llvm yet. Linked aosp_arm-eng image failed to
52 // boot up in the emulator.
53 use_clang_lld: false,
54
Dan Willemsen194edf72016-08-26 15:01:36 -070055 export_include_dirs: ["include"],
56 local_include_dirs: ["include"],
57}
58
59cc_test {
60 name: "memunreachable_test",
61 defaults: ["libmemunreachable_defaults"],
62 host_supported: true,
63 srcs: [
64 "tests/Allocator_test.cpp",
65 "tests/HeapWalker_test.cpp",
66 "tests/LeakFolding_test.cpp",
67 ],
68
69 target: {
70 android: {
71 srcs: [
72 "tests/DisableMalloc_test.cpp",
73 "tests/MemUnreachable_test.cpp",
74 "tests/ThreadCapture_test.cpp",
75 ],
76 shared_libs: [
77 "libmemunreachable",
78 ],
79 },
80 host: {
81 srcs: [
82 "Allocator.cpp",
83 "HeapWalker.cpp",
84 "LeakFolding.cpp",
85 "tests/HostMallocStub.cpp",
86 ],
87 },
88 darwin: {
89 enabled: false,
90 },
91 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -070092
93 test_suites: ["device-tests"],
Dan Willemsen194edf72016-08-26 15:01:36 -070094}
Colin Crossf572b912017-06-20 18:07:29 -070095
96cc_test {
97 name: "memunreachable_binder_test",
98 defaults: ["libmemunreachable_defaults"],
99 srcs: [
100 "tests/Binder_test.cpp",
Colin Crossf572b912017-06-20 18:07:29 -0700101 ],
Colin Cross51e6c252018-02-27 16:00:00 -0800102 static_libs: ["libmemunreachable"],
Colin Crossf572b912017-06-20 18:07:29 -0700103 shared_libs: [
104 "libbinder",
105 "libhwbinder",
Colin Crossf572b912017-06-20 18:07:29 -0700106 "libutils",
107 ],
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700108 test_suites: ["device-tests"],
Colin Crossf572b912017-06-20 18:07:29 -0700109}