Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "libmemunreachable_defaults", |
| 3 | |
| 4 | cflags: [ |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 5 | "-Wall", |
| 6 | "-Wextra", |
| 7 | "-Werror", |
| 8 | ], |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 9 | shared_libs: [ |
| 10 | "libbase", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 11 | ], |
Christopher Ferris | 47dea71 | 2017-05-03 17:34:29 -0700 | [diff] [blame] | 12 | |
| 13 | target: { |
| 14 | android: { |
| 15 | static_libs: ["libasync_safe"], |
| 16 | }, |
| 17 | host: { |
| 18 | shared_libs: ["liblog"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 19 | }, |
Christopher Ferris | 47dea71 | 2017-05-03 17:34:29 -0700 | [diff] [blame] | 20 | }, |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 21 | } |
| 22 | |
Colin Cross | 51e6c25 | 2018-02-27 16:00:00 -0800 | [diff] [blame] | 23 | cc_library { |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 24 | name: "libmemunreachable", |
| 25 | defaults: ["libmemunreachable_defaults"], |
| 26 | srcs: [ |
| 27 | "Allocator.cpp", |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 28 | "Binder.cpp", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 29 | "HeapWalker.cpp", |
| 30 | "LeakFolding.cpp", |
| 31 | "LeakPipe.cpp", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 32 | "MemUnreachable.cpp", |
| 33 | "ProcessMappings.cpp", |
| 34 | "PtracerThread.cpp", |
| 35 | "ThreadCapture.cpp", |
| 36 | ], |
| 37 | |
| 38 | static_libs: [ |
| 39 | "libc_malloc_debug_backtrace", |
Yabin Cui | 3841acc | 2018-05-10 17:19:12 -0700 | [diff] [blame] | 40 | "libprocinfo", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 41 | ], |
| 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 Hsieh | 29e54f8 | 2018-03-09 14:43:17 -0800 | [diff] [blame] | 49 | |
| 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 Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 55 | export_include_dirs: ["include"], |
| 56 | local_include_dirs: ["include"], |
| 57 | } |
| 58 | |
| 59 | cc_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 Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 92 | |
| 93 | test_suites: ["device-tests"], |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 94 | } |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 95 | |
| 96 | cc_test { |
| 97 | name: "memunreachable_binder_test", |
| 98 | defaults: ["libmemunreachable_defaults"], |
| 99 | srcs: [ |
| 100 | "tests/Binder_test.cpp", |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 101 | ], |
Colin Cross | 51e6c25 | 2018-02-27 16:00:00 -0800 | [diff] [blame] | 102 | static_libs: ["libmemunreachable"], |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 103 | shared_libs: [ |
| 104 | "libbinder", |
| 105 | "libhwbinder", |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 106 | "libutils", |
| 107 | ], |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 108 | test_suites: ["device-tests"], |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 109 | } |