blob: d6b85319e7c16fef80eb44cf5b9b932440cac4c2 [file] [log] [blame]
Colin Crossbaa48992016-07-13 11:15:21 -07001// ==============================================================
2// libc_malloc_debug_backtrace.a
3// ==============================================================
4// Used by libmemunreachable
5cc_library_static {
Colin Crossbaa48992016-07-13 11:15:21 -07006 name: "libc_malloc_debug_backtrace",
Colin Crossb9667b52019-05-17 13:45:18 -07007 vendor_available: true,
Colin Crossbaa48992016-07-13 11:15:21 -07008
9 srcs: [
10 "backtrace.cpp",
11 "MapData.cpp",
12 ],
13
14 stl: "libc++_static",
15
Elliott Hughesd50a1de2018-02-05 17:30:57 -080016 whole_static_libs: [
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070017 "libbase",
Elliott Hughesd50a1de2018-02-05 17:30:57 -080018 "libasync_safe",
Elliott Hughesd50a1de2018-02-05 17:30:57 -080019 ],
Colin Crossbaa48992016-07-13 11:15:21 -070020
21 include_dirs: ["bionic/libc"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070022
Colin Crossbaa48992016-07-13 11:15:21 -070023 export_include_dirs: ["."],
24
25 sanitize: {
26 never: true,
27 },
28 native_coverage: false,
29
30 // -Wno-error=format-zero-length needed for gcc to compile.
31 cflags: [
32 "-Wall",
33 "-Werror",
34 "-Wno-error=format-zero-length",
35 ],
Colin Crossbaa48992016-07-13 11:15:21 -070036}
37
38// ==============================================================
39// libc_malloc_debug.so
40// ==============================================================
41cc_library {
42 name: "libc_malloc_debug",
43
44 srcs: [
Colin Crossbaa48992016-07-13 11:15:21 -070045 "Config.cpp",
46 "DebugData.cpp",
47 "debug_disable.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070048 "GuardData.cpp",
49 "malloc_debug.cpp",
Christopher Ferris4da25032018-03-07 13:38:48 -080050 "PointerData.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070051 "RecordData.cpp",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070052 "UnwindBacktrace.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070053 ],
54
55 stl: "libc++_static",
56
57 // Only need this for arm since libc++ uses its own unwind code that
58 // doesn't mix with the other default unwind code.
59 arch: {
60 arm: {
61 static_libs: ["libunwind_llvm"],
62 },
63 },
64
65 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070066 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070067 "libbase",
68 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070069 ],
70
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070071 shared_libs: [
72 "libunwindstack",
73 ],
74
Colin Crossbaa48992016-07-13 11:15:21 -070075 multilib: {
76 lib32: {
77 version_script: "exported32.map",
78 },
79 lib64: {
80 version_script: "exported64.map",
81 },
82 },
83 allow_undefined_symbols: true,
84 include_dirs: ["bionic/libc"],
85
86 sanitize: {
87 never: true,
88 },
89 native_coverage: false,
90
91 // -Wno-error=format-zero-length needed for gcc to compile.
92 cflags: [
93 "-Wall",
94 "-Werror",
95 "-fno-stack-protector",
96 "-Wno-error=format-zero-length",
Christopher Ferris4da25032018-03-07 13:38:48 -080097 "-Wthread-safety",
Colin Crossbaa48992016-07-13 11:15:21 -070098 ],
Colin Crossbaa48992016-07-13 11:15:21 -070099}
100
101// ==============================================================
102// Unit Tests
103// ==============================================================
104cc_test {
Colin Crossbaa48992016-07-13 11:15:21 -0700105 name: "malloc_debug_unit_tests",
Colin Crossbaa48992016-07-13 11:15:21 -0700106
107 srcs: [
108 "tests/backtrace_fake.cpp",
109 "tests/log_fake.cpp",
110 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700111 "tests/malloc_debug_config_tests.cpp",
112 "tests/malloc_debug_unit_tests.cpp",
113 ],
114
Colin Crossbaa48992016-07-13 11:15:21 -0700115 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800116 include_dirs: [
117 "bionic/libc",
118 "bionic/libc/async_safe/include",
119 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700120
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700121 static_libs: [
122 "libc_malloc_debug",
Christopher Ferris6c619a02019-03-01 17:59:51 -0800123 "libtinyxml2",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700124 ],
125
126 shared_libs: [
127 "libbase",
128 "libunwindstack",
129 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700130
131 cflags: [
132 "-Wall",
133 "-Werror",
134 "-Wno-error=format-zero-length",
Christopher Ferris2e1a40a2018-06-13 10:46:34 -0700135 "-O0",
Colin Crossbaa48992016-07-13 11:15:21 -0700136 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700137}
Christopher Ferris97b47472018-07-10 14:45:24 -0700138
139// ==============================================================
140// System Tests
141// ==============================================================
142cc_test {
143 name: "malloc_debug_system_tests",
144
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -0800145 include_dirs: ["bionic/libc"],
146
Christopher Ferris97b47472018-07-10 14:45:24 -0700147 srcs: [
148 "tests/malloc_debug_system_tests.cpp",
149 ],
150
151 shared_libs: [
152 "libbase",
153 "liblog",
154 "libunwindstack",
155 ],
156
157 cflags: [
158 "-Wall",
159 "-Werror",
160 "-O0",
161 ],
162}