blob: 0601ce9f96ef63f33bd957b3e072a9bbbd38c3e2 [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 Cross0cc60af2021-09-30 14:04:39 -0700128 test_suites: ["device-tests"],
Colin Crossbaa48992016-07-13 11:15:21 -0700129
130 srcs: [
131 "tests/backtrace_fake.cpp",
132 "tests/log_fake.cpp",
133 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700134 "tests/malloc_debug_config_tests.cpp",
135 "tests/malloc_debug_unit_tests.cpp",
136 ],
137
Colin Crossbaa48992016-07-13 11:15:21 -0700138 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800139 include_dirs: [
140 "bionic/libc",
141 "bionic/libc/async_safe/include",
142 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700143
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700144 header_libs: [
145 "bionic_libc_platform_headers",
146 ],
147
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700148 static_libs: [
149 "libc_malloc_debug",
Christopher Ferris6c619a02019-03-01 17:59:51 -0800150 "libtinyxml2",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700151 ],
152
153 shared_libs: [
154 "libbase",
155 "libunwindstack",
156 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700157
158 cflags: [
159 "-Wall",
160 "-Werror",
161 "-Wno-error=format-zero-length",
Christopher Ferris2e1a40a2018-06-13 10:46:34 -0700162 "-O0",
Colin Crossbaa48992016-07-13 11:15:21 -0700163 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700164}
Christopher Ferris97b47472018-07-10 14:45:24 -0700165
166// ==============================================================
167// System Tests
168// ==============================================================
169cc_test {
170 name: "malloc_debug_system_tests",
Christopher Ferrise4619f72019-11-11 14:17:44 -0800171 isolated: true,
Christopher Ferris97b47472018-07-10 14:45:24 -0700172
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700173 include_dirs: [
174 "bionic/libc",
175 ],
176
177 header_libs: [
178 "bionic_libc_platform_headers",
179 ],
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -0800180
Christopher Ferris97b47472018-07-10 14:45:24 -0700181 srcs: [
182 "tests/malloc_debug_system_tests.cpp",
183 ],
184
185 shared_libs: [
186 "libbase",
Christopher Ferris9bf78172020-05-20 15:37:30 -0700187 "libbacktrace",
Christopher Ferris97b47472018-07-10 14:45:24 -0700188 "liblog",
189 "libunwindstack",
190 ],
191
192 cflags: [
193 "-Wall",
194 "-Werror",
195 "-O0",
196 ],
Christopher Ferrise4619f72019-11-11 14:17:44 -0800197 test_suites: ["general-tests"],
Christopher Ferris97b47472018-07-10 14:45:24 -0700198}