blob: 06fc426d6c608eaf0b02143fcfa66009261f5629 [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
Christopher Ferrisa625ee22017-06-01 14:16:32 -070016 whole_static_libs: ["libasync_safe", "libdemangle"],
Colin Crossbaa48992016-07-13 11:15:21 -070017
18 include_dirs: ["bionic/libc"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070019
Colin Crossbaa48992016-07-13 11:15:21 -070020 export_include_dirs: ["."],
21
22 sanitize: {
23 never: true,
24 },
25 native_coverage: false,
26
27 // -Wno-error=format-zero-length needed for gcc to compile.
28 cflags: [
29 "-Wall",
30 "-Werror",
31 "-Wno-error=format-zero-length",
32 ],
Colin Crossbaa48992016-07-13 11:15:21 -070033}
34
35// ==============================================================
36// libc_malloc_debug.so
37// ==============================================================
38cc_library {
39 name: "libc_malloc_debug",
40
41 srcs: [
42 "BacktraceData.cpp",
43 "Config.cpp",
44 "DebugData.cpp",
45 "debug_disable.cpp",
46 "FreeTrackData.cpp",
47 "GuardData.cpp",
48 "malloc_debug.cpp",
49 "RecordData.cpp",
50 "TrackData.cpp",
51 ],
52
53 stl: "libc++_static",
54
55 // Only need this for arm since libc++ uses its own unwind code that
56 // doesn't mix with the other default unwind code.
57 arch: {
58 arm: {
59 static_libs: ["libunwind_llvm"],
60 },
61 },
62
63 static_libs: [
Christopher Ferris7a3681e2017-04-24 17:48:32 -070064 "libasync_safe",
Colin Crossbaa48992016-07-13 11:15:21 -070065 "libbase",
66 "libc_malloc_debug_backtrace",
Colin Crossbaa48992016-07-13 11:15:21 -070067 ],
68
69 multilib: {
70 lib32: {
71 version_script: "exported32.map",
72 },
73 lib64: {
74 version_script: "exported64.map",
75 },
76 },
77 allow_undefined_symbols: true,
78 include_dirs: ["bionic/libc"],
79
80 sanitize: {
81 never: true,
82 },
83 native_coverage: false,
84
85 // -Wno-error=format-zero-length needed for gcc to compile.
86 cflags: [
87 "-Wall",
88 "-Werror",
89 "-fno-stack-protector",
90 "-Wno-error=format-zero-length",
91 ],
Colin Crossbaa48992016-07-13 11:15:21 -070092}
93
94// ==============================================================
95// Unit Tests
96// ==============================================================
97cc_test {
98
99 name: "malloc_debug_unit_tests",
100 multilib: {
101 lib32: {
102 suffix: "32",
103 },
104 lib64: {
105 suffix: "64",
106 },
107 },
108
109 srcs: [
110 "tests/backtrace_fake.cpp",
111 "tests/log_fake.cpp",
112 "tests/libc_fake.cpp",
Colin Crossbaa48992016-07-13 11:15:21 -0700113 "tests/malloc_debug_config_tests.cpp",
114 "tests/malloc_debug_unit_tests.cpp",
115 ],
116
117 whole_static_libs: ["libc_malloc_debug"],
118
119 local_include_dirs: ["tests"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700120 include_dirs: ["bionic/libc", "bionic/libc/async_safe/include"],
Colin Crossbaa48992016-07-13 11:15:21 -0700121
122 shared_libs: ["libbase"],
123
124 cflags: [
125 "-Wall",
126 "-Werror",
127 "-Wno-error=format-zero-length",
128 ],
Colin Crossbaa48992016-07-13 11:15:21 -0700129}