Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 1 | // ============================================================== |
| 2 | // libc_malloc_debug_backtrace.a |
| 3 | // ============================================================== |
| 4 | // Used by libmemunreachable |
| 5 | cc_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 Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 16 | whole_static_libs: [ |
| 17 | "libasync_safe", |
| 18 | "libdemangle", |
| 19 | ], |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 20 | |
| 21 | include_dirs: ["bionic/libc"], |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 22 | |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 23 | 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 Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | // ============================================================== |
| 39 | // libc_malloc_debug.so |
| 40 | // ============================================================== |
| 41 | cc_library { |
| 42 | name: "libc_malloc_debug", |
| 43 | |
| 44 | srcs: [ |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 45 | "Config.cpp", |
| 46 | "DebugData.cpp", |
| 47 | "debug_disable.cpp", |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 48 | "GuardData.cpp", |
| 49 | "malloc_debug.cpp", |
Christopher Ferris | 4da2503 | 2018-03-07 13:38:48 -0800 | [diff] [blame^] | 50 | "PointerData.cpp", |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 51 | "RecordData.cpp", |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 52 | ], |
| 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 Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 65 | "libasync_safe", |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 66 | "libbase", |
| 67 | "libc_malloc_debug_backtrace", |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 68 | ], |
| 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 Ferris | 4da2503 | 2018-03-07 13:38:48 -0800 | [diff] [blame^] | 92 | "-Wthread-safety", |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 93 | ], |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | // ============================================================== |
| 97 | // Unit Tests |
| 98 | // ============================================================== |
| 99 | cc_test { |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 100 | name: "malloc_debug_unit_tests", |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 101 | |
| 102 | srcs: [ |
| 103 | "tests/backtrace_fake.cpp", |
| 104 | "tests/log_fake.cpp", |
| 105 | "tests/libc_fake.cpp", |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 106 | "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 Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 113 | include_dirs: [ |
| 114 | "bionic/libc", |
| 115 | "bionic/libc/async_safe/include", |
| 116 | ], |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 117 | |
| 118 | shared_libs: ["libbase"], |
| 119 | |
| 120 | cflags: [ |
| 121 | "-Wall", |
| 122 | "-Werror", |
| 123 | "-Wno-error=format-zero-length", |
| 124 | ], |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 125 | } |