| 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 { | 
| Aditya Choudhary | d9d37c0 | 2024-02-02 13:57:12 +0000 | [diff] [blame] | 5 | default_team: "trendy_team_native_tools_libraries", | 
| Bob Badour | aa7d835 | 2021-02-19 13:06:22 -0800 | [diff] [blame] | 6 | // 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 Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 14 | cc_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 Park | f302cfb | 2019-10-07 15:52:21 +0900 | [diff] [blame] | 45 |  | 
|  | 46 | apex_available: [ | 
|  | 47 | "com.android.runtime", | 
|  | 48 | ], | 
|  | 49 | static: { | 
|  | 50 | apex_available: [ | 
|  | 51 | "//apex_available:platform", | 
|  | 52 | ], | 
|  | 53 | }, | 
| Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 54 | } | 
|  | 55 |  | 
|  | 56 | // ============================================================== | 
|  | 57 | // Unit Tests | 
|  | 58 | // ============================================================== | 
|  | 59 | cc_test { | 
| Christopher Ferris | e4619f7 | 2019-11-11 14:17:44 -0800 | [diff] [blame] | 60 | name: "malloc_hooks_system_tests", | 
|  | 61 | isolated: true, | 
| Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 62 |  | 
| Chih-Hung Hsieh | 7ab1c81 | 2023-01-09 15:12:32 -0800 | [diff] [blame] | 63 | // 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 Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 68 | 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 Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 77 | include_dirs: [ | 
|  | 78 | "bionic/libc", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 79 | "bionic", | 
| Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 80 | ], | 
|  | 81 | header_libs: [ | 
|  | 82 | "bionic_libc_platform_headers", | 
|  | 83 | ], | 
| Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 84 |  | 
|  | 85 | cflags: [ | 
|  | 86 | "-Wall", | 
|  | 87 | "-Werror", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 88 | "-O1", // FIXME: http://b/169206016 - issues with aligned_alloc and -O2 | 
| Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 89 | ], | 
| Christopher Ferris | e4619f7 | 2019-11-11 14:17:44 -0800 | [diff] [blame] | 90 | test_suites: ["general-tests"], | 
| Christopher Ferris | d6a1dc2 | 2018-02-07 18:42:14 -0800 | [diff] [blame] | 91 | } |