blob: 3b3a22ee757be519fbedfbb5f65dc897e74c5d52 [file] [log] [blame]
Colin Crossbaa48992016-07-13 11:15:21 -07001// ==============================================================
2// libc_malloc_debug_backtrace.a
3// ==============================================================
4// Used by libmemunreachable
Bob Badouraa7d8352021-02-19 13:06:22 -08005package {
6 // See: http://go/android-license-faq
7 // A large-scale-change added 'default_applicable_licenses' to import
8 // all of the 'license_kinds' from "bionic_libc_license"
9 // to get the below license kinds:
10 // SPDX-license-identifier-Apache-2.0
11 // SPDX-license-identifier-BSD
12 default_applicable_licenses: ["bionic_libc_license"],
13}
14
Colin Crossbaa48992016-07-13 11:15:21 -070015cc_library_static {
Colin Crossbaa48992016-07-13 11:15:21 -070016 name: "libc_malloc_debug_backtrace",
Colin Crossb9667b52019-05-17 13:45:18 -070017 vendor_available: true,
Colin Crossbaa48992016-07-13 11:15:21 -070018
19 srcs: [
20 "backtrace.cpp",
21 "MapData.cpp",
22 ],
23
24 stl: "libc++_static",
25
Elliott Hughesd50a1de2018-02-05 17:30:57 -080026 whole_static_libs: [
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070027 "libbase",
Elliott Hughesd50a1de2018-02-05 17:30:57 -080028 "libasync_safe",
Elliott Hughesd50a1de2018-02-05 17:30:57 -080029 ],
Colin Crossbaa48992016-07-13 11:15:21 -070030
31 include_dirs: ["bionic/libc"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070032
Colin Crossbaa48992016-07-13 11:15:21 -070033 export_include_dirs: ["."],
34
35 sanitize: {
36 never: true,
37 },
38 native_coverage: false,
39
Dan Albert4ea19212019-07-23 13:31:14 -070040 target: {
41 android: {
42 static_libs: ["libc++demangle"],
43 },
44 },
45
Colin Crossbaa48992016-07-13 11:15:21 -070046 // -Wno-error=format-zero-length needed for gcc to compile.
47 cflags: [
48 "-Wall",
49 "-Werror",
50 "-Wno-error=format-zero-length",
51 ],
Jiyong Parke87e0dc2019-10-02 17:09:33 +090052
53 apex_available: [
54 "//apex_available:platform",
55 "com.android.runtime",
56 ],
Colin Crossbaa48992016-07-13 11:15:21 -070057}
58
59// ==============================================================
60// libc_malloc_debug.so
61// ==============================================================
62cc_library {
63 name: "libc_malloc_debug",
64
65 srcs: [
Colin Crossbaa48992016-07-13 11:15:21 -070066 "Config.cpp",
67 "DebugData.cpp",
68 "debug_disable.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070069 "GuardData.cpp",
70 "malloc_debug.cpp",
Christopher Ferris4da25032018-03-07 13:38:48 -080071 "PointerData.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070072 "RecordData.cpp",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070073 "UnwindBacktrace.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070074 ],
75
76 stl: "libc++_static",
77
Colin Crossbaa48992016-07-13 11:15:21 -070078 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070079 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070080 "libbase",
81 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070082 ],
83
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070084 shared_libs: [
85 "libunwindstack",
86 ],
87
Colin Crossbaa48992016-07-13 11:15:21 -070088 multilib: {
89 lib32: {
90 version_script: "exported32.map",
91 },
92 lib64: {
93 version_script: "exported64.map",
94 },
95 },
96 allow_undefined_symbols: true,
97 include_dirs: ["bionic/libc"],
98
99 sanitize: {
100 never: true,
101 },
102 native_coverage: false,
103
104 // -Wno-error=format-zero-length needed for gcc to compile.
105 cflags: [
106 "-Wall",
107 "-Werror",
108 "-fno-stack-protector",
109 "-Wno-error=format-zero-length",
Christopher Ferris4da25032018-03-07 13:38:48 -0800110 "-Wthread-safety",
Colin Crossbaa48992016-07-13 11:15:21 -0700111 ],
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900112
113 apex_available: [
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900114 "com.android.runtime",
115 ],
Jiyong Parkf302cfb2019-10-07 15:52:21 +0900116 static: {
117 apex_available: [
118 "//apex_available:platform",
119 ],
120 },
Colin Crossbaa48992016-07-13 11:15:21 -0700121}
122
123// ==============================================================
124// Unit Tests
125// ==============================================================
126cc_test {
Colin Crossbaa48992016-07-13 11:15:21 -0700127 name: "malloc_debug_unit_tests",
Colin Crossbaa48992016-07-13 11:15:21 -0700128
129 srcs: [
130 "tests/backtrace_fake.cpp",
131 "tests/log_fake.cpp",
132 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700133 "tests/malloc_debug_config_tests.cpp",
134 "tests/malloc_debug_unit_tests.cpp",
135 ],
136
Colin Crossbaa48992016-07-13 11:15:21 -0700137 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800138 include_dirs: [
139 "bionic/libc",
140 "bionic/libc/async_safe/include",
141 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700142
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700143 header_libs: [
144 "bionic_libc_platform_headers",
145 ],
146
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700147 static_libs: [
148 "libc_malloc_debug",
Christopher Ferris6c619a02019-03-01 17:59:51 -0800149 "libtinyxml2",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700150 ],
151
152 shared_libs: [
153 "libbase",
154 "libunwindstack",
155 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700156
157 cflags: [
158 "-Wall",
159 "-Werror",
160 "-Wno-error=format-zero-length",
Christopher Ferris2e1a40a2018-06-13 10:46:34 -0700161 "-O0",
Colin Crossbaa48992016-07-13 11:15:21 -0700162 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700163}
Christopher Ferris97b47472018-07-10 14:45:24 -0700164
165// ==============================================================
166// System Tests
167// ==============================================================
168cc_test {
169 name: "malloc_debug_system_tests",
Christopher Ferrise4619f72019-11-11 14:17:44 -0800170 isolated: true,
Christopher Ferris97b47472018-07-10 14:45:24 -0700171
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700172 include_dirs: [
173 "bionic/libc",
174 ],
175
176 header_libs: [
177 "bionic_libc_platform_headers",
178 ],
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -0800179
Christopher Ferris97b47472018-07-10 14:45:24 -0700180 srcs: [
181 "tests/malloc_debug_system_tests.cpp",
182 ],
183
184 shared_libs: [
185 "libbase",
Christopher Ferris9bf78172020-05-20 15:37:30 -0700186 "libbacktrace",
Christopher Ferris97b47472018-07-10 14:45:24 -0700187 "liblog",
188 "libunwindstack",
189 ],
190
191 cflags: [
192 "-Wall",
193 "-Werror",
194 "-O0",
195 ],
Christopher Ferrise4619f72019-11-11 14:17:44 -0800196 test_suites: ["general-tests"],
Christopher Ferris97b47472018-07-10 14:45:24 -0700197}