2016-07-13 20:15:21 +02:00
|
|
|
// ==============================================================
|
|
|
|
// libc_malloc_debug_backtrace.a
|
|
|
|
// ==============================================================
|
|
|
|
// Used by libmemunreachable
|
|
|
|
cc_library_static {
|
|
|
|
|
|
|
|
name: "libc_malloc_debug_backtrace",
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"backtrace.cpp",
|
|
|
|
"MapData.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
stl: "libc++_static",
|
|
|
|
|
2018-02-06 02:30:57 +01:00
|
|
|
whole_static_libs: [
|
2018-04-05 20:12:38 +02:00
|
|
|
"libbase",
|
2018-02-06 02:30:57 +01:00
|
|
|
"libasync_safe",
|
|
|
|
"libdemangle",
|
|
|
|
],
|
2016-07-13 20:15:21 +02:00
|
|
|
|
|
|
|
include_dirs: ["bionic/libc"],
|
2017-04-25 02:48:32 +02:00
|
|
|
|
2016-07-13 20:15:21 +02:00
|
|
|
export_include_dirs: ["."],
|
|
|
|
|
|
|
|
sanitize: {
|
|
|
|
never: true,
|
|
|
|
},
|
|
|
|
native_coverage: false,
|
|
|
|
|
|
|
|
// -Wno-error=format-zero-length needed for gcc to compile.
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-Wno-error=format-zero-length",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// libc_malloc_debug.so
|
|
|
|
// ==============================================================
|
|
|
|
cc_library {
|
|
|
|
name: "libc_malloc_debug",
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"Config.cpp",
|
|
|
|
"DebugData.cpp",
|
|
|
|
"debug_disable.cpp",
|
|
|
|
"GuardData.cpp",
|
|
|
|
"malloc_debug.cpp",
|
2018-03-07 22:38:48 +01:00
|
|
|
"PointerData.cpp",
|
2016-07-13 20:15:21 +02:00
|
|
|
"RecordData.cpp",
|
2018-04-05 20:12:38 +02:00
|
|
|
"UnwindBacktrace.cpp",
|
2016-07-13 20:15:21 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
stl: "libc++_static",
|
|
|
|
|
|
|
|
// Only need this for arm since libc++ uses its own unwind code that
|
|
|
|
// doesn't mix with the other default unwind code.
|
|
|
|
arch: {
|
|
|
|
arm: {
|
|
|
|
static_libs: ["libunwind_llvm"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-04-16 19:50:52 +02:00
|
|
|
// Clang lld link flags do not work with special link rules
|
|
|
|
// for libunwind_llvm yet. Linked aosp_arm-eng image failed to
|
|
|
|
// boot up in the emulator. http://b/78118944.
|
|
|
|
use_clang_lld: false,
|
|
|
|
|
2016-07-13 20:15:21 +02:00
|
|
|
static_libs: [
|
2017-04-25 02:48:32 +02:00
|
|
|
"libasync_safe",
|
2016-07-13 20:15:21 +02:00
|
|
|
"libbase",
|
2018-04-05 20:12:38 +02:00
|
|
|
"libdemangle",
|
2016-07-13 20:15:21 +02:00
|
|
|
"libc_malloc_debug_backtrace",
|
|
|
|
],
|
|
|
|
|
2018-04-05 20:12:38 +02:00
|
|
|
shared_libs: [
|
|
|
|
"libunwindstack",
|
|
|
|
],
|
|
|
|
|
2016-07-13 20:15:21 +02:00
|
|
|
multilib: {
|
|
|
|
lib32: {
|
|
|
|
version_script: "exported32.map",
|
|
|
|
},
|
|
|
|
lib64: {
|
|
|
|
version_script: "exported64.map",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
allow_undefined_symbols: true,
|
|
|
|
include_dirs: ["bionic/libc"],
|
|
|
|
|
|
|
|
sanitize: {
|
|
|
|
never: true,
|
|
|
|
},
|
|
|
|
native_coverage: false,
|
|
|
|
|
|
|
|
// -Wno-error=format-zero-length needed for gcc to compile.
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-fno-stack-protector",
|
|
|
|
"-Wno-error=format-zero-length",
|
2018-03-07 22:38:48 +01:00
|
|
|
"-Wthread-safety",
|
2016-07-13 20:15:21 +02:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// Unit Tests
|
|
|
|
// ==============================================================
|
|
|
|
cc_test {
|
|
|
|
name: "malloc_debug_unit_tests",
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tests/backtrace_fake.cpp",
|
|
|
|
"tests/log_fake.cpp",
|
|
|
|
"tests/libc_fake.cpp",
|
|
|
|
"tests/malloc_debug_config_tests.cpp",
|
|
|
|
"tests/malloc_debug_unit_tests.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: ["tests"],
|
2018-02-06 02:30:57 +01:00
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
|
|
|
"bionic/libc/async_safe/include",
|
|
|
|
],
|
2016-07-13 20:15:21 +02:00
|
|
|
|
2018-04-05 20:12:38 +02:00
|
|
|
static_libs: [
|
|
|
|
"libc_malloc_debug",
|
|
|
|
"libdemangle",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libunwindstack",
|
|
|
|
],
|
2016-07-13 20:15:21 +02:00
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-Wno-error=format-zero-length",
|
2018-06-13 19:46:34 +02:00
|
|
|
"-O0",
|
2016-07-13 20:15:21 +02:00
|
|
|
],
|
|
|
|
}
|
2018-07-10 23:45:24 +02:00
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// System Tests
|
|
|
|
// ==============================================================
|
|
|
|
cc_test {
|
|
|
|
name: "malloc_debug_system_tests",
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tests/malloc_debug_system_tests.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
|
|
|
"libunwindstack",
|
|
|
|
],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-O0",
|
|
|
|
],
|
|
|
|
}
|