1cc_defaults { 2 name: "libmemunreachable_defaults", 3 4 cflags: [ 5 "-Wall", 6 "-Wextra", 7 "-Werror", 8 ], 9 shared_libs: [ 10 "libbase", 11 ], 12 13 target: { 14 android: { 15 static_libs: ["libasync_safe"], 16 }, 17 host: { 18 shared_libs: ["liblog"], 19 }, 20 }, 21 22 header_libs: ["bionic_libc_platform_headers"], 23 24 product_variables: { 25 experimental_mte: { 26 cflags: ["-DANDROID_EXPERIMENTAL_MTE"], 27 }, 28 }, 29} 30 31cc_library { 32 name: "libmemunreachable", 33 vendor_available: true, 34 defaults: ["libmemunreachable_defaults"], 35 srcs: [ 36 "Allocator.cpp", 37 "Binder.cpp", 38 "HeapWalker.cpp", 39 "LeakFolding.cpp", 40 "LeakPipe.cpp", 41 "MemUnreachable.cpp", 42 "ProcessMappings.cpp", 43 "PtracerThread.cpp", 44 "ThreadCapture.cpp", 45 ], 46 47 static_libs: [ 48 "libc_malloc_debug_backtrace", 49 "libprocinfo", 50 ], 51 export_include_dirs: ["include"], 52 local_include_dirs: ["include"], 53 version_script: "libmemunreachable.map", 54} 55 56// Integration test that runs against the public API of libmemunreachable 57cc_test { 58 name: "memunreachable_test", 59 defaults: ["libmemunreachable_defaults"], 60 srcs: [ 61 "tests/MemUnreachable_test.cpp", 62 ], 63 shared_libs: ["libmemunreachable"], 64 65 test_suites: ["device-tests"], 66} 67 68cc_test { 69 name: "memunreachable_unit_test", 70 defaults: ["libmemunreachable_defaults"], 71 host_supported: true, 72 srcs: [ 73 "tests/Allocator_test.cpp", 74 "tests/HeapWalker_test.cpp", 75 "tests/LeakFolding_test.cpp", 76 ], 77 78 target: { 79 android: { 80 srcs: [ 81 "tests/DisableMalloc_test.cpp", 82 "tests/MemUnreachable_test.cpp", 83 "tests/ThreadCapture_test.cpp", 84 ], 85 static_libs: [ 86 "libmemunreachable", 87 "libc_malloc_debug_backtrace", 88 ], 89 }, 90 host: { 91 srcs: [ 92 "Allocator.cpp", 93 "HeapWalker.cpp", 94 "LeakFolding.cpp", 95 "tests/HostMallocStub.cpp", 96 ], 97 }, 98 darwin: { 99 enabled: false, 100 }, 101 }, 102 103 test_suites: ["device-tests"], 104} 105 106cc_test { 107 name: "memunreachable_binder_test", 108 defaults: ["libmemunreachable_defaults"], 109 require_root: true, 110 111 srcs: [ 112 "tests/Binder_test.cpp", 113 ], 114 static_libs: ["libmemunreachable"], 115 shared_libs: [ 116 "libbinder", 117 "libhidlbase", 118 "libutils", 119 ], 120 test_suites: [ 121 "device-tests", 122 "vts" 123 ], 124} 125