blob: 760039b9c07298b06f5f7b42db0fe19c51975ed5 [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
Colin Crossbaa48992016-07-13 11:15:21 -070068 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070069 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070070 "libbase",
71 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070072 ],
73
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070074 shared_libs: [
75 "libunwindstack",
76 ],
77
Colin Crossbaa48992016-07-13 11:15:21 -070078 multilib: {
79 lib32: {
80 version_script: "exported32.map",
81 },
82 lib64: {
83 version_script: "exported64.map",
84 },
85 },
86 allow_undefined_symbols: true,
87 include_dirs: ["bionic/libc"],
88
89 sanitize: {
90 never: true,
91 },
92 native_coverage: false,
93
94 // -Wno-error=format-zero-length needed for gcc to compile.
95 cflags: [
96 "-Wall",
97 "-Werror",
98 "-fno-stack-protector",
99 "-Wno-error=format-zero-length",
Christopher Ferris4da25032018-03-07 13:38:48 -0800100 "-Wthread-safety",
Colin Crossbaa48992016-07-13 11:15:21 -0700101 ],
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900102
103 apex_available: [
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900104 "com.android.runtime",
105 ],
Jiyong Parkf302cfb2019-10-07 15:52:21 +0900106 static: {
107 apex_available: [
108 "//apex_available:platform",
109 ],
110 },
Colin Crossbaa48992016-07-13 11:15:21 -0700111}
112
113// ==============================================================
114// Unit Tests
115// ==============================================================
116cc_test {
Colin Crossbaa48992016-07-13 11:15:21 -0700117 name: "malloc_debug_unit_tests",
Colin Crossbaa48992016-07-13 11:15:21 -0700118
119 srcs: [
120 "tests/backtrace_fake.cpp",
121 "tests/log_fake.cpp",
122 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700123 "tests/malloc_debug_config_tests.cpp",
124 "tests/malloc_debug_unit_tests.cpp",
125 ],
126
Colin Crossbaa48992016-07-13 11:15:21 -0700127 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800128 include_dirs: [
129 "bionic/libc",
130 "bionic/libc/async_safe/include",
131 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700132
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700133 header_libs: [
134 "bionic_libc_platform_headers",
135 ],
136
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700137 static_libs: [
138 "libc_malloc_debug",
Christopher Ferris6c619a02019-03-01 17:59:51 -0800139 "libtinyxml2",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700140 ],
141
142 shared_libs: [
143 "libbase",
144 "libunwindstack",
145 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700146
147 cflags: [
148 "-Wall",
149 "-Werror",
150 "-Wno-error=format-zero-length",
Christopher Ferris2e1a40a2018-06-13 10:46:34 -0700151 "-O0",
Colin Crossbaa48992016-07-13 11:15:21 -0700152 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700153}
Christopher Ferris97b47472018-07-10 14:45:24 -0700154
155// ==============================================================
156// System Tests
157// ==============================================================
158cc_test {
159 name: "malloc_debug_system_tests",
Christopher Ferrise4619f72019-11-11 14:17:44 -0800160 isolated: true,
Christopher Ferris97b47472018-07-10 14:45:24 -0700161
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700162 include_dirs: [
163 "bionic/libc",
164 ],
165
166 header_libs: [
167 "bionic_libc_platform_headers",
168 ],
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -0800169
Christopher Ferris97b47472018-07-10 14:45:24 -0700170 srcs: [
171 "tests/malloc_debug_system_tests.cpp",
172 ],
173
174 shared_libs: [
175 "libbase",
Christopher Ferris9bf78172020-05-20 15:37:30 -0700176 "libbacktrace",
Christopher Ferris97b47472018-07-10 14:45:24 -0700177 "liblog",
178 "libunwindstack",
179 ],
180
181 cflags: [
182 "-Wall",
183 "-Werror",
184 "-O0",
185 ],
Christopher Ferrise4619f72019-11-11 14:17:44 -0800186 test_suites: ["general-tests"],
Christopher Ferris97b47472018-07-10 14:45:24 -0700187}