1// ============================================================== 2// libc_malloc_debug_backtrace.a 3// ============================================================== 4// Used by libmemunreachable 5cc_library_static { 6 7 name: "libc_malloc_debug_backtrace", 8 9 srcs: [ 10 "backtrace.cpp", 11 "MapData.cpp", 12 ], 13 14 stl: "libc++_static", 15 16 whole_static_libs: ["libasync_safe", "libdemangle"], 17 18 include_dirs: ["bionic/libc"], 19 20 export_include_dirs: ["."], 21 22 sanitize: { 23 never: true, 24 }, 25 native_coverage: false, 26 27 // -Wno-error=format-zero-length needed for gcc to compile. 28 cflags: [ 29 "-Wall", 30 "-Werror", 31 "-Wno-error=format-zero-length", 32 ], 33} 34 35// ============================================================== 36// libc_malloc_debug.so 37// ============================================================== 38cc_library { 39 name: "libc_malloc_debug", 40 41 srcs: [ 42 "BacktraceData.cpp", 43 "Config.cpp", 44 "DebugData.cpp", 45 "debug_disable.cpp", 46 "FreeTrackData.cpp", 47 "GuardData.cpp", 48 "malloc_debug.cpp", 49 "RecordData.cpp", 50 "TrackData.cpp", 51 ], 52 53 stl: "libc++_static", 54 55 // Only need this for arm since libc++ uses its own unwind code that 56 // doesn't mix with the other default unwind code. 57 arch: { 58 arm: { 59 static_libs: ["libunwind_llvm"], 60 }, 61 }, 62 63 static_libs: [ 64 "libasync_safe", 65 "libbase", 66 "libc_malloc_debug_backtrace", 67 ], 68 69 multilib: { 70 lib32: { 71 version_script: "exported32.map", 72 }, 73 lib64: { 74 version_script: "exported64.map", 75 }, 76 }, 77 allow_undefined_symbols: true, 78 include_dirs: ["bionic/libc"], 79 80 sanitize: { 81 never: true, 82 }, 83 native_coverage: false, 84 85 // -Wno-error=format-zero-length needed for gcc to compile. 86 cflags: [ 87 "-Wall", 88 "-Werror", 89 "-fno-stack-protector", 90 "-Wno-error=format-zero-length", 91 ], 92} 93 94// ============================================================== 95// Unit Tests 96// ============================================================== 97cc_test { 98 99 name: "malloc_debug_unit_tests", 100 multilib: { 101 lib32: { 102 suffix: "32", 103 }, 104 lib64: { 105 suffix: "64", 106 }, 107 }, 108 109 srcs: [ 110 "tests/backtrace_fake.cpp", 111 "tests/log_fake.cpp", 112 "tests/libc_fake.cpp", 113 "tests/malloc_debug_config_tests.cpp", 114 "tests/malloc_debug_unit_tests.cpp", 115 ], 116 117 whole_static_libs: ["libc_malloc_debug"], 118 119 local_include_dirs: ["tests"], 120 include_dirs: ["bionic/libc", "bionic/libc/async_safe/include"], 121 122 shared_libs: ["libbase"], 123 124 cflags: [ 125 "-Wall", 126 "-Werror", 127 "-Wno-error=format-zero-length", 128 ], 129} 130