2016-07-13 20:15:21 +02:00
|
|
|
// ==============================================================
|
|
|
|
// libc_malloc_debug_backtrace.a
|
|
|
|
// ==============================================================
|
|
|
|
// Used by libmemunreachable
|
2021-02-19 22:06:22 +01:00
|
|
|
package {
|
|
|
|
// See: http://go/android-license-faq
|
|
|
|
// A large-scale-change added 'default_applicable_licenses' to import
|
|
|
|
// all of the 'license_kinds' from "bionic_libc_license"
|
|
|
|
// to get the below license kinds:
|
|
|
|
// SPDX-license-identifier-Apache-2.0
|
|
|
|
// SPDX-license-identifier-BSD
|
|
|
|
default_applicable_licenses: ["bionic_libc_license"],
|
|
|
|
}
|
|
|
|
|
2016-07-13 20:15:21 +02:00
|
|
|
cc_library_static {
|
|
|
|
name: "libc_malloc_debug_backtrace",
|
2019-05-17 22:45:18 +02:00
|
|
|
vendor_available: true,
|
2016-07-13 20:15:21 +02:00
|
|
|
|
|
|
|
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",
|
|
|
|
],
|
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",
|
|
|
|
],
|
2019-10-02 10:09:33 +02:00
|
|
|
|
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
|
|
|
"com.android.runtime",
|
|
|
|
],
|
2016-07-13 20:15:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// 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",
|
2022-05-09 23:00:47 +02:00
|
|
|
"Unreachable.cpp",
|
2018-04-05 20:12:38 +02:00
|
|
|
"UnwindBacktrace.cpp",
|
2016-07-13 20:15:21 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
stl: "libc++_static",
|
|
|
|
|
|
|
|
static_libs: [
|
2017-04-25 02:48:32 +02:00
|
|
|
"libasync_safe",
|
2016-07-13 20:15:21 +02:00
|
|
|
"libbase",
|
|
|
|
"libc_malloc_debug_backtrace",
|
2022-05-09 23:00:47 +02:00
|
|
|
"libmemunreachable",
|
2016-07-13 20:15:21 +02:00
|
|
|
],
|
|
|
|
|
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
|
|
|
],
|
2019-10-02 10:09:33 +02:00
|
|
|
|
|
|
|
apex_available: [
|
|
|
|
"com.android.runtime",
|
|
|
|
],
|
2019-10-07 08:52:21 +02:00
|
|
|
static: {
|
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
|
|
|
],
|
|
|
|
},
|
2016-07-13 20:15:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// Unit Tests
|
|
|
|
// ==============================================================
|
|
|
|
cc_test {
|
|
|
|
name: "malloc_debug_unit_tests",
|
2021-09-30 23:04:39 +02:00
|
|
|
test_suites: ["device-tests"],
|
2022-05-18 01:51:02 +02:00
|
|
|
isolated: true,
|
2016-07-13 20:15:21 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2019-09-12 04:05:29 +02:00
|
|
|
header_libs: [
|
|
|
|
"bionic_libc_platform_headers",
|
|
|
|
],
|
|
|
|
|
2018-04-05 20:12:38 +02:00
|
|
|
static_libs: [
|
|
|
|
"libc_malloc_debug",
|
2019-03-02 02:59:51 +01:00
|
|
|
"libtinyxml2",
|
2018-04-05 20:12:38 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
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",
|
2019-11-11 23:17:44 +01:00
|
|
|
isolated: true,
|
2018-07-10 23:45:24 +02:00
|
|
|
|
2019-09-12 04:05:29 +02:00
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
2022-04-13 23:39:36 +02:00
|
|
|
"bionic", // For SKIP_WITH_HWASAN.
|
2019-09-12 04:05:29 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
header_libs: [
|
|
|
|
"bionic_libc_platform_headers",
|
|
|
|
],
|
2019-02-16 03:06:15 +01:00
|
|
|
|
2023-01-10 00:12:32 +01:00
|
|
|
// The clang-analyzer-unix.Malloc and other warnings in these
|
|
|
|
// unit tests are either false positive or in
|
|
|
|
// negative tests that can be ignored.
|
|
|
|
tidy: false,
|
|
|
|
|
2018-07-10 23:45:24 +02:00
|
|
|
srcs: [
|
|
|
|
"tests/malloc_debug_system_tests.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
|
|
|
"libunwindstack",
|
|
|
|
],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-O0",
|
|
|
|
],
|
2019-11-11 23:17:44 +01:00
|
|
|
test_suites: ["general-tests"],
|
2018-07-10 23:45:24 +02:00
|
|
|
}
|