blob: f808d0cdc724532e1842eb4ccf15c1e2f644baec [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 {
6
7 name: "libc_malloc_debug_backtrace",
8
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",
19 "libdemangle",
20 ],
Colin Crossbaa48992016-07-13 11:15:21 -070021
22 include_dirs: ["bionic/libc"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070023
Colin Crossbaa48992016-07-13 11:15:21 -070024 export_include_dirs: ["."],
25
26 sanitize: {
27 never: true,
28 },
29 native_coverage: false,
30
31 // -Wno-error=format-zero-length needed for gcc to compile.
32 cflags: [
33 "-Wall",
34 "-Werror",
35 "-Wno-error=format-zero-length",
36 ],
Colin Crossbaa48992016-07-13 11:15:21 -070037}
38
39// ==============================================================
40// libc_malloc_debug.so
41// ==============================================================
42cc_library {
43 name: "libc_malloc_debug",
44
45 srcs: [
Colin Crossbaa48992016-07-13 11:15:21 -070046 "Config.cpp",
47 "DebugData.cpp",
48 "debug_disable.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070049 "GuardData.cpp",
50 "malloc_debug.cpp",
Christopher Ferris4da25032018-03-07 13:38:48 -080051 "PointerData.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070052 "RecordData.cpp",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070053 "UnwindBacktrace.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070054 ],
55
56 stl: "libc++_static",
57
58 // Only need this for arm since libc++ uses its own unwind code that
59 // doesn't mix with the other default unwind code.
60 arch: {
61 arm: {
62 static_libs: ["libunwind_llvm"],
63 },
64 },
65
66 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070067 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070068 "libbase",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070069 "libdemangle",
Colin Crossbaa48992016-07-13 11:15:21 -070070 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070071 ],
72
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070073 shared_libs: [
74 "libunwindstack",
75 ],
76
Colin Crossbaa48992016-07-13 11:15:21 -070077 multilib: {
78 lib32: {
79 version_script: "exported32.map",
80 },
81 lib64: {
82 version_script: "exported64.map",
83 },
84 },
85 allow_undefined_symbols: true,
86 include_dirs: ["bionic/libc"],
87
88 sanitize: {
89 never: true,
90 },
91 native_coverage: false,
92
93 // -Wno-error=format-zero-length needed for gcc to compile.
94 cflags: [
95 "-Wall",
96 "-Werror",
97 "-fno-stack-protector",
98 "-Wno-error=format-zero-length",
Christopher Ferris4da25032018-03-07 13:38:48 -080099 "-Wthread-safety",
Colin Crossbaa48992016-07-13 11:15:21 -0700100 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700101}
102
103// ==============================================================
104// Unit Tests
105// ==============================================================
106cc_test {
Colin Crossbaa48992016-07-13 11:15:21 -0700107 name: "malloc_debug_unit_tests",
Colin Crossbaa48992016-07-13 11:15:21 -0700108
109 srcs: [
110 "tests/backtrace_fake.cpp",
111 "tests/log_fake.cpp",
112 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700113 "tests/malloc_debug_config_tests.cpp",
114 "tests/malloc_debug_unit_tests.cpp",
115 ],
116
Colin Crossbaa48992016-07-13 11:15:21 -0700117 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800118 include_dirs: [
119 "bionic/libc",
120 "bionic/libc/async_safe/include",
121 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700122
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700123 static_libs: [
124 "libc_malloc_debug",
125 "libdemangle",
Christopher Ferris6c619a02019-03-01 17:59:51 -0800126 "libtinyxml2",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700127 ],
128
129 shared_libs: [
130 "libbase",
131 "libunwindstack",
132 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700133
134 cflags: [
135 "-Wall",
136 "-Werror",
137 "-Wno-error=format-zero-length",
Christopher Ferris2e1a40a2018-06-13 10:46:34 -0700138 "-O0",
Colin Crossbaa48992016-07-13 11:15:21 -0700139 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700140}
Christopher Ferris97b47472018-07-10 14:45:24 -0700141
142// ==============================================================
143// System Tests
144// ==============================================================
145cc_test {
146 name: "malloc_debug_system_tests",
147
148 srcs: [
149 "tests/malloc_debug_system_tests.cpp",
150 ],
151
152 shared_libs: [
153 "libbase",
154 "liblog",
155 "libunwindstack",
156 ],
157
158 cflags: [
159 "-Wall",
160 "-Werror",
161 "-O0",
162 ],
163}