blob: ede24315f5c7be6ac431511e359812f3813ea86e [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 {
6
7 name: "libc_malloc_debug_backtrace",
8
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: [
17 "libasync_safe",
18 "libdemangle",
19 ],
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
30 // -Wno-error=format-zero-length needed for gcc to compile.
31 cflags: [
32 "-Wall",
33 "-Werror",
34 "-Wno-error=format-zero-length",
35 ],
Colin Crossbaa48992016-07-13 11:15:21 -070036}
37
38// ==============================================================
39// libc_malloc_debug.so
40// ==============================================================
41cc_library {
42 name: "libc_malloc_debug",
43
44 srcs: [
45 "BacktraceData.cpp",
46 "Config.cpp",
47 "DebugData.cpp",
48 "debug_disable.cpp",
49 "FreeTrackData.cpp",
50 "GuardData.cpp",
51 "malloc_debug.cpp",
52 "RecordData.cpp",
53 "TrackData.cpp",
54 ],
55
56 stl: "libc++_static",
57
58 // Only need this for arm since libc++ uses its own unwind code that
59 // doesn't mix with the other default unwind code.
60 arch: {
61 arm: {
62 static_libs: ["libunwind_llvm"],
63 },
64 },
65
66 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070067 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070068 "libbase",
69 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070070 ],
71
72 multilib: {
73 lib32: {
74 version_script: "exported32.map",
75 },
76 lib64: {
77 version_script: "exported64.map",
78 },
79 },
80 allow_undefined_symbols: true,
81 include_dirs: ["bionic/libc"],
82
83 sanitize: {
84 never: true,
85 },
86 native_coverage: false,
87
88 // -Wno-error=format-zero-length needed for gcc to compile.
89 cflags: [
90 "-Wall",
91 "-Werror",
92 "-fno-stack-protector",
93 "-Wno-error=format-zero-length",
94 ],
Colin Crossbaa48992016-07-13 11:15:21 -070095}
96
97// ==============================================================
98// Unit Tests
99// ==============================================================
100cc_test {
101
102 name: "malloc_debug_unit_tests",
103 multilib: {
104 lib32: {
105 suffix: "32",
106 },
107 lib64: {
108 suffix: "64",
109 },
110 },
111
112 srcs: [
113 "tests/backtrace_fake.cpp",
114 "tests/log_fake.cpp",
115 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700116 "tests/malloc_debug_config_tests.cpp",
117 "tests/malloc_debug_unit_tests.cpp",
118 ],
119
120 whole_static_libs: ["libc_malloc_debug"],
121
122 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800123 include_dirs: [
124 "bionic/libc",
125 "bionic/libc/async_safe/include",
126 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700127
128 shared_libs: ["libbase"],
129
130 cflags: [
131 "-Wall",
132 "-Werror",
133 "-Wno-error=format-zero-length",
134 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700135}