Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 1 | // ============================================================== |
| 2 | // libc_malloc_hooks.so |
| 3 | // ============================================================== |
Bob Badour | aa7d835 | 2021-02-19 13:06:22 -0800 | [diff] [blame] | 4 | package { |
| 5 | // See: http://go/android-license-faq |
| 6 | // A large-scale-change added 'default_applicable_licenses' to import |
| 7 | // all of the 'license_kinds' from "bionic_libc_license" |
| 8 | // to get the below license kinds: |
| 9 | // SPDX-license-identifier-BSD |
| 10 | default_applicable_licenses: ["bionic_libc_license"], |
| 11 | } |
| 12 | |
Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 13 | cc_library { |
| 14 | name: "libc_malloc_hooks", |
| 15 | |
| 16 | srcs: [ |
| 17 | "malloc_hooks.cpp", |
| 18 | ], |
| 19 | |
| 20 | static_libs: [ |
| 21 | "libasync_safe", |
| 22 | ], |
| 23 | |
| 24 | multilib: { |
| 25 | lib32: { |
| 26 | version_script: "exported32.map", |
| 27 | }, |
| 28 | lib64: { |
| 29 | version_script: "exported64.map", |
| 30 | }, |
| 31 | }, |
| 32 | include_dirs: ["bionic/libc"], |
| 33 | |
| 34 | sanitize: { |
| 35 | never: true, |
| 36 | }, |
| 37 | native_coverage: false, |
| 38 | |
| 39 | cflags: [ |
| 40 | "-Wall", |
| 41 | "-Werror", |
| 42 | "-fno-stack-protector", |
| 43 | ], |
Jiyong Park | f302cfb | 2019-10-07 15:52:21 +0900 | [diff] [blame] | 44 | |
| 45 | apex_available: [ |
| 46 | "com.android.runtime", |
| 47 | ], |
| 48 | static: { |
| 49 | apex_available: [ |
| 50 | "//apex_available:platform", |
| 51 | ], |
| 52 | }, |
Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | // ============================================================== |
| 56 | // Unit Tests |
| 57 | // ============================================================== |
| 58 | cc_test { |
Christopher Ferris | e4619f7 | 2019-11-11 14:17:44 -0800 | [diff] [blame] | 59 | name: "malloc_hooks_system_tests", |
| 60 | isolated: true, |
Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 61 | |
Chih-Hung Hsieh | 7ab1c81 | 2023-01-09 15:12:32 -0800 | [diff] [blame] | 62 | // The clang-analyzer-unix.Malloc and other warnings in these |
| 63 | // unit tests are either false positive or in |
| 64 | // negative tests that can be ignored. |
| 65 | tidy: false, |
| 66 | |
Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 67 | srcs: [ |
| 68 | "tests/malloc_hooks_tests.cpp", |
| 69 | ], |
| 70 | |
| 71 | whole_static_libs: ["libc_malloc_hooks"], |
| 72 | |
| 73 | shared_libs: ["libbase"], |
| 74 | |
| 75 | local_include_dirs: ["tests"], |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 76 | include_dirs: [ |
| 77 | "bionic/libc", |
Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame^] | 78 | "bionic", |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 79 | ], |
| 80 | header_libs: [ |
| 81 | "bionic_libc_platform_headers", |
| 82 | ], |
Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 83 | |
| 84 | cflags: [ |
| 85 | "-Wall", |
| 86 | "-Werror", |
Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame^] | 87 | "-O1", // FIXME: http://b/169206016 - issues with aligned_alloc and -O2 |
Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 88 | ], |
Christopher Ferris | e4619f7 | 2019-11-11 14:17:44 -0800 | [diff] [blame] | 89 | test_suites: ["general-tests"], |
Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 90 | } |