blob: 5aea771d940123b9593bfeb7478a0c18ebc895e6 [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
40 // -Wno-error=format-zero-length needed for gcc to compile.
41 cflags: [
42 "-Wall",
43 "-Werror",
44 "-Wno-error=format-zero-length",
45 ],
Jiyong Parke87e0dc2019-10-02 17:09:33 +090046
47 apex_available: [
48 "//apex_available:platform",
49 "com.android.runtime",
50 ],
Colin Crossbaa48992016-07-13 11:15:21 -070051}
52
53// ==============================================================
54// libc_malloc_debug.so
55// ==============================================================
56cc_library {
57 name: "libc_malloc_debug",
58
59 srcs: [
Colin Crossbaa48992016-07-13 11:15:21 -070060 "Config.cpp",
61 "DebugData.cpp",
62 "debug_disable.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070063 "GuardData.cpp",
64 "malloc_debug.cpp",
Christopher Ferris4da25032018-03-07 13:38:48 -080065 "PointerData.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070066 "RecordData.cpp",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070067 "UnwindBacktrace.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070068 ],
69
70 stl: "libc++_static",
71
Colin Crossbaa48992016-07-13 11:15:21 -070072 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070073 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070074 "libbase",
75 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070076 ],
77
Christopher Ferris93bdd6a2018-04-05 11:12:38 -070078 shared_libs: [
79 "libunwindstack",
80 ],
81
Colin Crossbaa48992016-07-13 11:15:21 -070082 multilib: {
83 lib32: {
84 version_script: "exported32.map",
85 },
86 lib64: {
87 version_script: "exported64.map",
88 },
89 },
90 allow_undefined_symbols: true,
91 include_dirs: ["bionic/libc"],
92
93 sanitize: {
94 never: true,
95 },
96 native_coverage: false,
97
98 // -Wno-error=format-zero-length needed for gcc to compile.
99 cflags: [
100 "-Wall",
101 "-Werror",
102 "-fno-stack-protector",
103 "-Wno-error=format-zero-length",
Christopher Ferris4da25032018-03-07 13:38:48 -0800104 "-Wthread-safety",
Colin Crossbaa48992016-07-13 11:15:21 -0700105 ],
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900106
107 apex_available: [
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900108 "com.android.runtime",
109 ],
Jiyong Parkf302cfb2019-10-07 15:52:21 +0900110 static: {
111 apex_available: [
112 "//apex_available:platform",
113 ],
114 },
Colin Crossbaa48992016-07-13 11:15:21 -0700115}
116
117// ==============================================================
118// Unit Tests
119// ==============================================================
120cc_test {
Colin Crossbaa48992016-07-13 11:15:21 -0700121 name: "malloc_debug_unit_tests",
Colin Cross0cc60af2021-09-30 14:04:39 -0700122 test_suites: ["device-tests"],
Colin Crossbaa48992016-07-13 11:15:21 -0700123
124 srcs: [
125 "tests/backtrace_fake.cpp",
126 "tests/log_fake.cpp",
127 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700128 "tests/malloc_debug_config_tests.cpp",
129 "tests/malloc_debug_unit_tests.cpp",
130 ],
131
Colin Crossbaa48992016-07-13 11:15:21 -0700132 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800133 include_dirs: [
134 "bionic/libc",
135 "bionic/libc/async_safe/include",
Florian Mayer0aa87b82022-04-05 21:15:05 +0000136 "bionic", // For SKIP_WITH_HWASAN.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800137 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700138
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700139 header_libs: [
140 "bionic_libc_platform_headers",
141 ],
142
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700143 static_libs: [
144 "libc_malloc_debug",
Christopher Ferris6c619a02019-03-01 17:59:51 -0800145 "libtinyxml2",
Christopher Ferris93bdd6a2018-04-05 11:12:38 -0700146 ],
147
148 shared_libs: [
149 "libbase",
150 "libunwindstack",
151 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700152
153 cflags: [
154 "-Wall",
155 "-Werror",
156 "-Wno-error=format-zero-length",
Christopher Ferris2e1a40a2018-06-13 10:46:34 -0700157 "-O0",
Colin Crossbaa48992016-07-13 11:15:21 -0700158 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700159}
Christopher Ferris97b47472018-07-10 14:45:24 -0700160
161// ==============================================================
162// System Tests
163// ==============================================================
164cc_test {
165 name: "malloc_debug_system_tests",
Christopher Ferrise4619f72019-11-11 14:17:44 -0800166 isolated: true,
Christopher Ferris97b47472018-07-10 14:45:24 -0700167
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700168 include_dirs: [
169 "bionic/libc",
Florian Mayerdca72292022-04-13 14:39:36 -0700170 "bionic", // For SKIP_WITH_HWASAN.
Christopher Ferris2b0638e2019-09-11 19:05:29 -0700171 ],
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",
Christopher Ferris9bf78172020-05-20 15:37:30 -0700183 "libbacktrace",
Christopher Ferris97b47472018-07-10 14:45:24 -0700184 "liblog",
185 "libunwindstack",
186 ],
187
188 cflags: [
189 "-Wall",
190 "-Werror",
191 "-O0",
192 ],
Christopher Ferrise4619f72019-11-11 14:17:44 -0800193 test_suites: ["general-tests"],
Christopher Ferris97b47472018-07-10 14:45:24 -0700194}