blob: 3f0640b301aa5e0da407e90c6aeecf8bd8f1ff14 [file] [log] [blame]
Christopher Ferrisd6a1dc22018-02-07 18:42:14 -08001// ==============================================================
2// libc_malloc_hooks.so
3// ==============================================================
Bob Badouraa7d8352021-02-19 13:06:22 -08004package {
Aditya Choudharyd9d37c02024-02-02 13:57:12 +00005 default_team: "trendy_team_native_tools_libraries",
Bob Badouraa7d8352021-02-19 13:06:22 -08006 // See: http://go/android-license-faq
7 // A large-scale-change added 'default_applicable_licenses' to import
8 // all of the 'license_kinds' from "bionic_libc_license"
9 // to get the below license kinds:
10 // SPDX-license-identifier-BSD
11 default_applicable_licenses: ["bionic_libc_license"],
12}
13
Christopher Ferrisd6a1dc22018-02-07 18:42:14 -080014cc_library {
15 name: "libc_malloc_hooks",
16
17 srcs: [
18 "malloc_hooks.cpp",
19 ],
20
21 static_libs: [
22 "libasync_safe",
23 ],
24
25 multilib: {
26 lib32: {
27 version_script: "exported32.map",
28 },
29 lib64: {
30 version_script: "exported64.map",
31 },
32 },
33 include_dirs: ["bionic/libc"],
34
35 sanitize: {
36 never: true,
37 },
38 native_coverage: false,
39
40 cflags: [
41 "-Wall",
42 "-Werror",
43 "-fno-stack-protector",
44 ],
Jiyong Parkf302cfb2019-10-07 15:52:21 +090045
46 apex_available: [
47 "com.android.runtime",
48 ],
49 static: {
50 apex_available: [
51 "//apex_available:platform",
52 ],
53 },
Christopher Ferrisd6a1dc22018-02-07 18:42:14 -080054}
55
56// ==============================================================
57// Unit Tests
58// ==============================================================
59cc_test {
Christopher Ferrise4619f72019-11-11 14:17:44 -080060 name: "malloc_hooks_system_tests",
61 isolated: true,
Christopher Ferrisd6a1dc22018-02-07 18:42:14 -080062
Chih-Hung Hsieh7ab1c812023-01-09 15:12:32 -080063 // The clang-analyzer-unix.Malloc and other warnings in these
64 // unit tests are either false positive or in
65 // negative tests that can be ignored.
66 tidy: false,
67
Christopher Ferrisd6a1dc22018-02-07 18:42:14 -080068 srcs: [
69 "tests/malloc_hooks_tests.cpp",
70 ],
71
72 whole_static_libs: ["libc_malloc_hooks"],
73
74 shared_libs: ["libbase"],
75
76 local_include_dirs: ["tests"],
Christopher Ferris2b0638e2019-09-11 19:05:29 -070077 include_dirs: [
78 "bionic/libc",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +000079 "bionic",
Christopher Ferris2b0638e2019-09-11 19:05:29 -070080 ],
81 header_libs: [
82 "bionic_libc_platform_headers",
83 ],
Christopher Ferrisd6a1dc22018-02-07 18:42:14 -080084
85 cflags: [
86 "-Wall",
87 "-Werror",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +000088 "-O1", // FIXME: http://b/169206016 - issues with aligned_alloc and -O2
Christopher Ferrisd6a1dc22018-02-07 18:42:14 -080089 ],
Christopher Ferrise4619f72019-11-11 14:17:44 -080090 test_suites: ["general-tests"],
Christopher Ferrisd6a1dc22018-02-07 18:42:14 -080091}