blob: 7340f956fdd393c5ef5a57f37c6662a0fec33d06 [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
Dan Albert4ea19212019-07-23 13:31:14 -070030 target: {
31 android: {
32 static_libs: ["libc++demangle"],
33 },
34 },
35
Colin Crossbaa48992016-07-13 11:15:21 -070036 // -Wno-error=format-zero-length needed for gcc to compile.
37 cflags: [
38 "-Wall",
39 "-Werror",
40 "-Wno-error=format-zero-length",
41 ],
Jiyong Parke87e0dc2019-10-02 17:09:33 +090042
43 apex_available: [
44 "//apex_available:platform",
45 "com.android.runtime",
46 ],
Colin Crossbaa48992016-07-13 11:15:21 -070047}
48
49// ==============================================================
50// libc_malloc_debug.so
51// ==============================================================
52cc_library {
53 name: "libc_malloc_debug",
54
55 srcs: [
Colin Crossbaa48992016-07-13 11:15:21 -070056 "Config.cpp",
57 "DebugData.cpp",
58 "debug_disable.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070059 "GuardData.cpp",
60 "malloc_debug.cpp",
Christopher Ferris4da25032018-03-07 13:38:48 -080061 "PointerData.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070062 "RecordData.cpp",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070063 "UnwindBacktrace.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070064 ],
65
66 stl: "libc++_static",
67
68 // Only need this for arm since libc++ uses its own unwind code that
69 // doesn't mix with the other default unwind code.
70 arch: {
71 arm: {
72 static_libs: ["libunwind_llvm"],
73 },
74 },
75
76 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070077 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070078 "libbase",
79 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070080 ],
81
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070082 shared_libs: [
83 "libunwindstack",
84 ],
85
Colin Crossbaa48992016-07-13 11:15:21 -070086 multilib: {
87 lib32: {
88 version_script: "exported32.map",
89 },
90 lib64: {
91 version_script: "exported64.map",
92 },
93 },
94 allow_undefined_symbols: true,
95 include_dirs: ["bionic/libc"],
96
97 sanitize: {
98 never: true,
99 },
100 native_coverage: false,
101
102 // -Wno-error=format-zero-length needed for gcc to compile.
103 cflags: [
104 "-Wall",
105 "-Werror",
106 "-fno-stack-protector",
107 "-Wno-error=format-zero-length",
Christopher Ferris4da25032018-03-07 13:38:48 -0800108 "-Wthread-safety",
Colin Crossbaa48992016-07-13 11:15:21 -0700109 ],
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900110
111 apex_available: [
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900112 "com.android.runtime",
113 ],
Jiyong Parkf302cfb2019-10-07 15:52:21 +0900114 static: {
115 apex_available: [
116 "//apex_available:platform",
117 ],
118 },
Colin Crossbaa48992016-07-13 11:15:21 -0700119}
120
121// ==============================================================
122// Unit Tests
123// ==============================================================
124cc_test {
Colin Crossbaa48992016-07-13 11:15:21 -0700125 name: "malloc_debug_unit_tests",
Colin Crossbaa48992016-07-13 11:15:21 -0700126
127 srcs: [
128 "tests/backtrace_fake.cpp",
129 "tests/log_fake.cpp",
130 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700131 "tests/malloc_debug_config_tests.cpp",
132 "tests/malloc_debug_unit_tests.cpp",
133 ],
134
Colin Crossbaa48992016-07-13 11:15:21 -0700135 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800136 include_dirs: [
137 "bionic/libc",
138 "bionic/libc/async_safe/include",
139 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700140
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700141 header_libs: [
142 "bionic_libc_platform_headers",
143 ],
144
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700145 static_libs: [
146 "libc_malloc_debug",
Christopher Ferris6c619a02019-03-01 17:59:51 -0800147 "libtinyxml2",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700148 ],
149
150 shared_libs: [
151 "libbase",
152 "libunwindstack",
153 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700154
155 cflags: [
156 "-Wall",
157 "-Werror",
158 "-Wno-error=format-zero-length",
Christopher Ferris2e1a40a2018-06-13 10:46:34 -0700159 "-O0",
Colin Crossbaa48992016-07-13 11:15:21 -0700160 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700161}
Christopher Ferris97b47472018-07-10 14:45:24 -0700162
163// ==============================================================
164// System Tests
165// ==============================================================
166cc_test {
167 name: "malloc_debug_system_tests",
168
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700169 include_dirs: [
170 "bionic/libc",
171 ],
172
173 header_libs: [
174 "bionic_libc_platform_headers",
175 ],
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -0800176
Christopher Ferris97b47472018-07-10 14:45:24 -0700177 srcs: [
178 "tests/malloc_debug_system_tests.cpp",
179 ],
180
181 shared_libs: [
182 "libbase",
183 "liblog",
184 "libunwindstack",
185 ],
186
187 cflags: [
188 "-Wall",
189 "-Werror",
190 "-O0",
191 ],
192}