blob: 899987c428358272b90ad9097929b38badda31b9 [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: [
Colin Crossbaa48992016-07-13 11:15:21 -070045 "Config.cpp",
46 "DebugData.cpp",
47 "debug_disable.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070048 "GuardData.cpp",
49 "malloc_debug.cpp",
Christopher Ferris4da25032018-03-07 13:38:48 -080050 "PointerData.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070051 "RecordData.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -070052 ],
53
54 stl: "libc++_static",
55
56 // Only need this for arm since libc++ uses its own unwind code that
57 // doesn't mix with the other default unwind code.
58 arch: {
59 arm: {
60 static_libs: ["libunwind_llvm"],
61 },
62 },
63
64 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070065 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070066 "libbase",
67 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070068 ],
69
70 multilib: {
71 lib32: {
72 version_script: "exported32.map",
73 },
74 lib64: {
75 version_script: "exported64.map",
76 },
77 },
78 allow_undefined_symbols: true,
79 include_dirs: ["bionic/libc"],
80
81 sanitize: {
82 never: true,
83 },
84 native_coverage: false,
85
86 // -Wno-error=format-zero-length needed for gcc to compile.
87 cflags: [
88 "-Wall",
89 "-Werror",
90 "-fno-stack-protector",
91 "-Wno-error=format-zero-length",
Christopher Ferris4da25032018-03-07 13:38:48 -080092 "-Wthread-safety",
Colin Crossbaa48992016-07-13 11:15:21 -070093 ],
Colin Crossbaa48992016-07-13 11:15:21 -070094}
95
96// ==============================================================
97// Unit Tests
98// ==============================================================
99cc_test {
Colin Crossbaa48992016-07-13 11:15:21 -0700100 name: "malloc_debug_unit_tests",
Colin Crossbaa48992016-07-13 11:15:21 -0700101
102 srcs: [
103 "tests/backtrace_fake.cpp",
104 "tests/log_fake.cpp",
105 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700106 "tests/malloc_debug_config_tests.cpp",
107 "tests/malloc_debug_unit_tests.cpp",
108 ],
109
110 whole_static_libs: ["libc_malloc_debug"],
111
112 local_include_dirs: ["tests"],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800113 include_dirs: [
114 "bionic/libc",
115 "bionic/libc/async_safe/include",
116 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700117
118 shared_libs: ["libbase"],
119
120 cflags: [
121 "-Wall",
122 "-Werror",
123 "-Wno-error=format-zero-length",
124 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700125}