| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2012 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| Bob Badour | aa7d835 | 2021-02-19 13:06:22 -0800 | [diff] [blame] | 17 | package { |
| Aditya Choudhary | d9d37c0 | 2024-02-02 13:57:12 +0000 | [diff] [blame] | 18 | default_team: "trendy_team_native_tools_libraries", |
| Bob Badour | aa7d835 | 2021-02-19 13:06:22 -0800 | [diff] [blame] | 19 | default_applicable_licenses: ["bionic_tests_license"], |
| 20 | } |
| 21 | |
| 22 | license { |
| 23 | name: "bionic_tests_license", |
| 24 | visibility: [":__subpackages__"], |
| 25 | license_kinds: [ |
| 26 | "SPDX-license-identifier-Apache-2.0", |
| 27 | "SPDX-license-identifier-BSD", |
| 28 | ], |
| 29 | license_text: [ |
| 30 | "NOTICE", |
| 31 | ], |
| 32 | } |
| 33 | |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 34 | cc_defaults { |
| 35 | name: "bionic_tests_defaults", |
| 36 | host_supported: true, |
| 37 | target: { |
| 38 | darwin: { |
| 39 | enabled: false, |
| 40 | }, |
| Martin Stjernholm | a276343 | 2020-04-23 16:47:19 +0100 | [diff] [blame] | 41 | android: { |
| 42 | header_libs: ["bionic_libc_platform_headers"], |
| Vilas Bhat | a2c5eb0 | 2025-05-20 21:31:09 +0000 | [diff] [blame] | 43 | shared_libs: ["libdl_android"], |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 44 | }, |
| Martin Stjernholm | a276343 | 2020-04-23 16:47:19 +0100 | [diff] [blame] | 45 | linux_bionic: { |
| 46 | header_libs: ["bionic_libc_platform_headers"], |
| 47 | }, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 48 | }, |
| 49 | cflags: [ |
| 50 | "-fstack-protector-all", |
| 51 | "-g", |
| 52 | "-Wall", |
| 53 | "-Wextra", |
| 54 | "-Wunused", |
| 55 | "-Werror", |
| 56 | "-fno-builtin", |
| 57 | |
| 58 | // We want to test deprecated API too. |
| 59 | "-Wno-deprecated-declarations", |
| 60 | |
| Peter Collingbourne | 4edf74a | 2020-10-02 13:47:03 -0700 | [diff] [blame] | 61 | // Needed to test pthread_internal_t layout. |
| 62 | "-Wno-invalid-offsetof", |
| 63 | |
| Christopher Ferris | 1de7a48 | 2023-09-12 11:06:29 -0700 | [diff] [blame] | 64 | // This warning does not provide any benefit to the tests. |
| 65 | "-Wno-reorder-init-list", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 66 | ], |
| Mitch Phillips | e6997d5 | 2020-11-30 15:04:14 -0800 | [diff] [blame] | 67 | header_libs: [ |
| 68 | "libcutils_headers", |
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 69 | "gwp_asan_headers", |
| Mitch Phillips | e6997d5 | 2020-11-30 15:04:14 -0800 | [diff] [blame] | 70 | ], |
| Elliott Hughes | 9a7155d | 2023-02-10 02:00:03 +0000 | [diff] [blame] | 71 | stl: "libc++", |
| 72 | |
| 73 | // Ensure that the tests exercise shadow call stack support. |
| 74 | // We don't use `scs: true` here because that would give us a second |
| 75 | // variant of this library where we actually just want to say "this |
| 76 | // library should always be built this way". |
| Peter Collingbourne | 7b70e27 | 2018-11-12 20:09:14 -0800 | [diff] [blame] | 77 | arch: { |
| 78 | arm64: { |
| Elliott Hughes | 9a7155d | 2023-02-10 02:00:03 +0000 | [diff] [blame] | 79 | cflags: ["-fsanitize=shadow-call-stack"], |
| 80 | }, |
| 81 | riscv64: { |
| 82 | cflags: ["-fsanitize=shadow-call-stack"], |
| Peter Collingbourne | 7b70e27 | 2018-11-12 20:09:14 -0800 | [diff] [blame] | 83 | }, |
| 84 | }, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 85 | sanitize: { |
| Evgenii Stepanov | 7cc6706 | 2019-02-05 18:43:34 -0800 | [diff] [blame] | 86 | address: false, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 87 | }, |
| Ryan Prichard | 3c5dff4 | 2020-03-31 17:34:03 -0700 | [diff] [blame] | 88 | |
| 89 | // Use the bootstrap version of bionic because some tests call private APIs |
| 90 | // that aren't exposed by the APEX bionic stubs. |
| Jiyong Park | c45fe9f | 2018-12-13 18:26:48 +0900 | [diff] [blame] | 91 | bootstrap: true, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | // ----------------------------------------------------------------------------- |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 95 | // Prebuilt shared libraries for use in tests. |
| 96 | // ----------------------------------------------------------------------------- |
| 97 | |
| Elliott Hughes | 0744513 | 2024-12-06 17:17:24 -0500 | [diff] [blame] | 98 | filegroup { |
| 99 | name: "bionic_prebuilt_test_elf_files_arm64", |
| 100 | srcs: [ |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 101 | "prebuilt-elf-files/*.so", |
| 102 | "prebuilt-elf-files/arm64/libtest_invalid-local-tls.so", |
| Elliott Hughes | 0744513 | 2024-12-06 17:17:24 -0500 | [diff] [blame] | 103 | ], |
| 104 | } |
| 105 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 106 | genrule_defaults { |
| 107 | name: "gen_invalid_lib_defaults", |
| 108 | tools: ["gen_invalid_elf"], |
| 109 | srcs: [":libtest_empty"], |
| 110 | } |
| 111 | |
| 112 | cc_defaults { |
| 113 | name: "invalid_lib_defaults", |
| 114 | strip: { |
| 115 | none: true, |
| 116 | }, |
| 117 | check_elf_files: false, |
| 118 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 119 | } |
| 120 | |
| 121 | cc_genrule { |
| 122 | name: "gen_invalid-rwx_load_segment", |
| 123 | defaults: ["gen_invalid_lib_defaults"], |
| 124 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=rwx_load_segment", |
| 125 | out: ["libtest_invalid-rwx_load_segment.so"], |
| 126 | } |
| 127 | |
| 128 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 129 | name: "libtest_invalid-rw_load_segment", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 130 | defaults: ["invalid_lib_defaults"], |
| 131 | srcs: [":gen_invalid-rwx_load_segment"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 132 | } |
| 133 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 134 | cc_genrule { |
| 135 | name: "gen_invalid-unaligned_shdr_offset", |
| 136 | defaults: ["gen_invalid_lib_defaults"], |
| 137 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=unaligned_shdr_offset", |
| 138 | out: ["libtest_invalid-unaligned_shdr_offset.so"], |
| 139 | } |
| 140 | |
| 141 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 142 | name: "libtest_invalid-unaligned_shdr_offset", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 143 | defaults: ["invalid_lib_defaults"], |
| 144 | srcs: [":gen_invalid-unaligned_shdr_offset"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 145 | } |
| 146 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 147 | cc_genrule { |
| 148 | name: "gen_invalid-zero_shentsize", |
| 149 | defaults: ["gen_invalid_lib_defaults"], |
| 150 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=zero_shentsize", |
| 151 | out: ["libtest_invalid-zero_shentsize.so"], |
| 152 | } |
| 153 | |
| 154 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 155 | name: "libtest_invalid-zero_shentsize", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 156 | defaults: ["invalid_lib_defaults"], |
| 157 | srcs: [":gen_invalid-zero_shentsize"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 158 | } |
| 159 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 160 | cc_genrule { |
| 161 | name: "gen_invalid-zero_shstrndx", |
| 162 | defaults: ["gen_invalid_lib_defaults"], |
| 163 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=zero_shstrndx", |
| 164 | out: ["libtest_invalid-zero_shstrndx.so"], |
| 165 | } |
| 166 | |
| 167 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 168 | name: "libtest_invalid-zero_shstrndx", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 169 | defaults: ["invalid_lib_defaults"], |
| 170 | srcs: [":gen_invalid-zero_shstrndx"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 171 | } |
| 172 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 173 | cc_genrule { |
| 174 | name: "gen_invalid-empty_shdr_table", |
| 175 | defaults: ["gen_invalid_lib_defaults"], |
| 176 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=empty_shdr_table", |
| 177 | out: ["libtest_invalid-empty_shdr_table.so"], |
| 178 | } |
| 179 | |
| 180 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 181 | name: "libtest_invalid-empty_shdr_table", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 182 | defaults: ["invalid_lib_defaults"], |
| 183 | srcs: [":gen_invalid-empty_shdr_table"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 184 | } |
| 185 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 186 | cc_genrule { |
| 187 | name: "gen_invalid-zero_shdr_table_offset", |
| 188 | defaults: ["gen_invalid_lib_defaults"], |
| 189 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=zero_shdr_table_offset", |
| 190 | out: ["libtest_invalid-zero_shdr_table_offset.so"], |
| 191 | } |
| 192 | |
| 193 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 194 | name: "libtest_invalid-zero_shdr_table_offset", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 195 | defaults: ["invalid_lib_defaults"], |
| 196 | srcs: [":gen_invalid-zero_shdr_table_offset"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 197 | } |
| 198 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 199 | cc_genrule { |
| 200 | name: "gen_invalid-zero_shdr_table_content", |
| 201 | defaults: ["gen_invalid_lib_defaults"], |
| 202 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=zero_shdr_table_content", |
| 203 | out: ["libtest_invalid-zero_shdr_table_content.so"], |
| 204 | } |
| 205 | |
| 206 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 207 | name: "libtest_invalid-zero_shdr_table_content", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 208 | defaults: ["invalid_lib_defaults"], |
| 209 | srcs: [":gen_invalid-zero_shdr_table_content"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 210 | } |
| 211 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 212 | cc_genrule { |
| 213 | name: "gen_invalid-textrels", |
| 214 | defaults: ["gen_invalid_lib_defaults"], |
| 215 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=textrels", |
| 216 | out: ["libtest_invalid-textrels.so"], |
| 217 | } |
| 218 | |
| 219 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 220 | name: "libtest_invalid-textrels", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 221 | defaults: ["invalid_lib_defaults"], |
| 222 | srcs: [":gen_invalid-textrels"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 223 | } |
| 224 | |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 225 | cc_genrule { |
| 226 | name: "gen_invalid-textrels2", |
| 227 | defaults: ["gen_invalid_lib_defaults"], |
| 228 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_empty) --output=$(out) --invalid-type=textrels2", |
| 229 | out: ["libtest_invalid-textrels2.so"], |
| 230 | } |
| 231 | |
| 232 | cc_prebuilt_library_shared { |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 233 | name: "libtest_invalid-textrels2", |
| Kalesh Singh | d98c907 | 2025-07-22 10:35:41 -0700 | [diff] [blame] | 234 | defaults: ["invalid_lib_defaults"], |
| 235 | srcs: [":gen_invalid-textrels2"], |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 236 | } |
| 237 | |
| Kalesh Singh | ce5cdc7 | 2025-08-11 15:52:45 -0700 | [diff] [blame] | 238 | cc_genrule { |
| 239 | name: "gen_invalid-rw_rx_rw_load_segments", |
| 240 | tools: ["gen_invalid_elf"], |
| 241 | // Force the segment alignment to 4KiB |
| 242 | srcs: [":libtest_elf_max_page_size_4kib"], |
| 243 | out: ["libtest_invalid-load_segments_rw_rx_rw.so"], |
| 244 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_elf_max_page_size_4kib) --output=$(out) --invalid-type=load_segments_rw_rx_rw", |
| 245 | } |
| 246 | |
| 247 | cc_prebuilt_library_shared { |
| 248 | name: "libtest_invalid-rw_rx_rw_load_segments", |
| 249 | defaults: ["invalid_lib_defaults"], |
| 250 | srcs: [":gen_invalid-rw_rx_rw_load_segments"], |
| 251 | } |
| 252 | |
| 253 | cc_genrule { |
| 254 | name: "gen_invalid-rx_rw_rx_load_segments", |
| 255 | tools: ["gen_invalid_elf"], |
| 256 | // Force the segment alignment to 4KiB |
| 257 | srcs: [":libtest_elf_max_page_size_4kib"], |
| 258 | out: ["libtest_invalid-load_segments_rx_rw_rx.so"], |
| 259 | cmd: "$(location gen_invalid_elf) --ref-elf=$(location :libtest_elf_max_page_size_4kib) --output=$(out) --invalid-type=load_segments_rx_rw_rx", |
| 260 | } |
| 261 | |
| 262 | cc_prebuilt_library_shared { |
| 263 | name: "libtest_invalid-rx_rw_rx_load_segments", |
| 264 | defaults: ["invalid_lib_defaults"], |
| 265 | srcs: [":gen_invalid-rx_rw_rx_load_segments"], |
| 266 | } |
| 267 | |
| Ryan Prichard | 8ea6af5 | 2022-03-24 21:14:27 -0700 | [diff] [blame] | 268 | cc_prebuilt_test_library_shared { |
| 269 | name: "libtest_invalid-local-tls", |
| 270 | strip: { |
| 271 | none: true, |
| 272 | }, |
| 273 | check_elf_files: false, |
| 274 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 275 | arch: { |
| 276 | arm: { |
| 277 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-local-tls.so"], |
| 278 | }, |
| 279 | arm64: { |
| 280 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-local-tls.so"], |
| 281 | }, |
| Elliott Hughes | 08bd825 | 2025-05-08 08:20:42 -0700 | [diff] [blame] | 282 | // No riscv64 here because the gold linker never had riscv64 support, |
| 283 | // and this is a test for a gold-specific bug. |
| Ryan Prichard | 8ea6af5 | 2022-03-24 21:14:27 -0700 | [diff] [blame] | 284 | x86: { |
| 285 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-local-tls.so"], |
| 286 | }, |
| 287 | x86_64: { |
| 288 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-local-tls.so"], |
| 289 | }, |
| 290 | }, |
| 291 | } |
| 292 | |
| Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 293 | // ----------------------------------------------------------------------------- |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 294 | // All standard tests. |
| 295 | // ----------------------------------------------------------------------------- |
| 296 | |
| George Burgess IV | de45dcb | 2018-03-16 14:15:01 -0700 | [diff] [blame] | 297 | // Test diagnostics emitted by clang. The library that results is useless; we |
| 298 | // just want to run '-Xclang -verify', which will fail if the diagnostics don't |
| 299 | // match up with what the source file says they should be. |
| 300 | cc_test_library { |
| 301 | name: "clang_diagnostic_tests", |
| 302 | cflags: [ |
| Elliott Hughes | 2a34a67 | 2024-07-10 11:42:33 +0000 | [diff] [blame] | 303 | "-Xclang -verify", |
| George Burgess IV | de45dcb | 2018-03-16 14:15:01 -0700 | [diff] [blame] | 304 | ], |
| 305 | srcs: ["sys_ioctl_diag_test.cpp"], |
| 306 | } |
| 307 | |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 308 | cc_test_library { |
| 309 | name: "libBionicStandardTests", |
| Dennis Shen | 5951b41 | 2023-12-21 19:57:13 +0000 | [diff] [blame] | 310 | defaults: [ |
| 311 | "bionic_tests_defaults", |
| 312 | "large_system_property_node_defaults", |
| 313 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 314 | srcs: [ |
| Ryan Prichard | 45024fe | 2018-12-30 21:10:26 -0800 | [diff] [blame] | 315 | "__aeabi_read_tp_test.cpp", |
| Ryan Prichard | afa983c | 2020-02-04 15:46:15 -0800 | [diff] [blame] | 316 | "__cxa_atexit_test.cpp", |
| Elliott Hughes | 413817f | 2020-10-26 15:05:35 -0700 | [diff] [blame] | 317 | "__cxa_demangle_test.cpp", |
| Aleksandra Tsvetkova | 608b451 | 2015-02-27 15:01:59 +0300 | [diff] [blame] | 318 | "alloca_test.cpp", |
| Elliott Hughes | ce934e3 | 2018-09-06 13:26:08 -0700 | [diff] [blame] | 319 | "android_get_device_api_level.cpp", |
| Christopher Ferris | bbf9cd8 | 2022-04-11 16:01:37 -0700 | [diff] [blame] | 320 | "android_set_abort_message_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 321 | "arpa_inet_test.cpp", |
| Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 322 | "async_safe_test.cpp", |
| Elliott Hughes | f6495c7 | 2016-07-25 09:20:57 -0700 | [diff] [blame] | 323 | "assert_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 324 | "buffer_tests.cpp", |
| 325 | "bug_26110743_test.cpp", |
| Aleksandra Tsvetkova | 608b451 | 2015-02-27 15:01:59 +0300 | [diff] [blame] | 326 | "byteswap_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 327 | "complex_test.cpp", |
| Jordan R Abrahams-Whitehead | 48a3bef | 2024-12-02 19:57:26 +0000 | [diff] [blame] | 328 | // Disabled while investigating |
| 329 | // b/378304366, b/375525252 |
| 330 | // "cpu_target_features_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 331 | "ctype_test.cpp", |
| 332 | "dirent_test.cpp", |
| Elliott Hughes | d390df1 | 2017-04-30 22:56:10 -0700 | [diff] [blame] | 333 | "elf_test.cpp", |
| Elliott Hughes | ba267f4 | 2017-02-24 16:19:53 -0800 | [diff] [blame] | 334 | "endian_test.cpp", |
| Elliott Hughes | 12ecdc1 | 2025-06-25 12:55:59 -0700 | [diff] [blame] | 335 | "err_test.cpp", |
| Elliott Hughes | e452cb1 | 2017-06-13 14:43:53 -0700 | [diff] [blame] | 336 | "errno_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 337 | "error_test.cpp", |
| 338 | "eventfd_test.cpp", |
| 339 | "fcntl_test.cpp", |
| Josh Gao | f6e5b58 | 2018-06-01 15:30:54 -0700 | [diff] [blame] | 340 | "fdsan_test.cpp", |
| Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 341 | "fdtrack_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 342 | "fenv_test.cpp", |
| Elliott Hughes | 09e77f3 | 2020-01-29 19:20:45 -0800 | [diff] [blame] | 343 | "_FILE_OFFSET_BITS_test.cpp", |
| Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 344 | "float_test.cpp", |
| Elliott Hughes | 6675ad3 | 2020-11-20 16:51:21 -0800 | [diff] [blame] | 345 | "fnmatch_test.cpp", |
| Elliott Hughes | da81ec4 | 2024-06-27 22:09:03 +0000 | [diff] [blame] | 346 | "fts_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 347 | "ftw_test.cpp", |
| 348 | "getauxval_test.cpp", |
| 349 | "getcwd_test.cpp", |
| Elliott Hughes | f1c568d1 | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 350 | "glob_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 351 | "grp_pwd_test.cpp", |
| Tom Cherry | 6034ef8 | 2018-02-02 16:10:07 -0800 | [diff] [blame] | 352 | "grp_pwd_file_test.cpp", |
| Peter Collingbourne | d306001 | 2020-04-01 19:54:48 -0700 | [diff] [blame] | 353 | "heap_tagging_level_test.cpp", |
| Elliott Hughes | a648733 | 2017-08-15 23:16:48 -0700 | [diff] [blame] | 354 | "iconv_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 355 | "ifaddrs_test.cpp", |
| Peter Collingbourne | 7a0f04c | 2019-01-23 17:56:24 -0800 | [diff] [blame] | 356 | "ifunc_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 357 | "inttypes_test.cpp", |
| Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 358 | "iso646_test.c", |
| Elliott Hughes | fc8e688 | 2016-11-18 16:27:29 -0800 | [diff] [blame] | 359 | "langinfo_test.cpp", |
| Josh Gao | 7d15dc3 | 2017-03-13 17:10:46 -0700 | [diff] [blame] | 360 | "leak_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 361 | "libgen_basename_test.cpp", |
| 362 | "libgen_test.cpp", |
| Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 363 | "limits_test.cpp", |
| Christopher Ferris | ee1e0a3 | 2017-04-20 13:38:49 -0700 | [diff] [blame] | 364 | "linux_swab_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 365 | "locale_test.cpp", |
| Christopher Ferris | bfd3dc4 | 2018-10-15 10:02:38 -0700 | [diff] [blame] | 366 | "malloc_iterate_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 367 | "malloc_test.cpp", |
| Sharjeel Khan | 702f050 | 2025-04-03 19:59:29 +0000 | [diff] [blame] | 368 | "malloc_test_with_usable_size.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 369 | "math_test.cpp", |
| Orion Hodson | 6ba6694 | 2018-08-30 11:10:23 +0100 | [diff] [blame] | 370 | "membarrier_test.cpp", |
| Mitch Phillips | 477c1eb | 2024-08-21 19:36:51 +0200 | [diff] [blame] | 371 | "memtag_globals_test.cpp", |
| Florian Mayer | c82d7fc | 2022-08-31 20:57:03 +0000 | [diff] [blame] | 372 | "memtag_stack_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 373 | "mntent_test.cpp", |
| Peter Collingbourne | 6f1fd68 | 2020-01-29 16:27:31 -0800 | [diff] [blame] | 374 | "mte_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 375 | "netdb_test.cpp", |
| 376 | "net_if_test.cpp", |
| 377 | "netinet_ether_test.cpp", |
| Elliott Hughes | 7296274 | 2024-06-17 15:38:29 +0000 | [diff] [blame] | 378 | "netinet_igmp_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 379 | "netinet_in_test.cpp", |
| Elliott Hughes | e5a5eec | 2018-06-27 12:29:06 -0700 | [diff] [blame] | 380 | "netinet_ip_icmp_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 381 | "netinet_udp_test.cpp", |
| 382 | "nl_types_test.cpp", |
| Josh Gao | 3de1915 | 2021-02-22 18:09:48 -0800 | [diff] [blame] | 383 | "pidfd_test.cpp", |
| Elliott Hughes | eab6572 | 2018-08-30 12:15:56 -0700 | [diff] [blame] | 384 | "poll_test.cpp", |
| Matthew Maurer | de30635 | 2020-10-23 09:55:33 -0700 | [diff] [blame] | 385 | "prio_ctor_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 386 | "pthread_test.cpp", |
| 387 | "pty_test.cpp", |
| 388 | "regex_test.cpp", |
| 389 | "resolv_test.cpp", |
| 390 | "sched_test.cpp", |
| Peter Collingbourne | 734beec | 2018-11-14 12:41:41 -0800 | [diff] [blame] | 391 | "scs_test.cpp", |
| Elliott Hughes | 5059939 | 2017-05-25 17:13:32 -0700 | [diff] [blame] | 392 | "scsi_sg_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 393 | "search_test.cpp", |
| 394 | "semaphore_test.cpp", |
| 395 | "setjmp_test.cpp", |
| 396 | "signal_test.cpp", |
| Elliott Hughes | 14e3ff9 | 2017-10-06 16:58:36 -0700 | [diff] [blame] | 397 | "spawn_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 398 | "stack_protector_test.cpp", |
| 399 | "stack_protector_test_helper.cpp", |
| 400 | "stack_unwinding_test.cpp", |
| Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 401 | "stdalign_test.cpp", |
| 402 | "stdarg_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 403 | "stdatomic_test.cpp", |
| Elliott Hughes | 5e70fe5 | 2025-07-22 09:19:37 -0700 | [diff] [blame] | 404 | "stdbit_test.cpp", |
| Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 405 | "stdbool_test.c", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 406 | "stdint_test.cpp", |
| 407 | "stdio_nofortify_test.cpp", |
| 408 | "stdio_test.cpp", |
| 409 | "stdio_ext_test.cpp", |
| 410 | "stdlib_test.cpp", |
| Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 411 | "stdnoreturn_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 412 | "string_nofortify_test.cpp", |
| 413 | "string_test.cpp", |
| 414 | "string_posix_strerror_r_test.cpp", |
| Colin Cross | 4408b8a | 2021-07-29 22:45:34 -0700 | [diff] [blame] | 415 | "string_posix_strerror_r_wrapper.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 416 | "strings_nofortify_test.cpp", |
| 417 | "strings_test.cpp", |
| Peter Collingbourne | 4edf74a | 2020-10-02 13:47:03 -0700 | [diff] [blame] | 418 | "struct_layout_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 419 | "sstream_test.cpp", |
| Elliott Hughes | c5d9036 | 2020-02-24 09:52:14 -0800 | [diff] [blame] | 420 | "sys_auxv_test.cpp", |
| Elliott Hughes | 74d9765 | 2023-07-12 16:30:55 -0700 | [diff] [blame] | 421 | "sys_cachectl_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 422 | "sys_epoll_test.cpp", |
| Elliott Hughes | f3d6b44 | 2023-07-27 16:53:30 -0700 | [diff] [blame] | 423 | "sys_hwprobe_test.cpp", |
| Elliott Hughes | f274a20 | 2024-06-17 15:07:25 +0000 | [diff] [blame] | 424 | "sys_io_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 425 | "sys_mman_test.cpp", |
| Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 426 | "sys_msg_test.cpp", |
| Nick Kralevich | c50b6a2 | 2019-03-21 14:04:33 -0700 | [diff] [blame] | 427 | "sys_param_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 428 | "sys_personality_test.cpp", |
| 429 | "sys_prctl_test.cpp", |
| 430 | "sys_procfs_test.cpp", |
| 431 | "sys_ptrace_test.cpp", |
| 432 | "sys_quota_test.cpp", |
| Elliott Hughes | 8465e96 | 2017-09-27 16:33:35 -0700 | [diff] [blame] | 433 | "sys_random_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 434 | "sys_resource_test.cpp", |
| 435 | "sys_select_test.cpp", |
| Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 436 | "sys_sem_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 437 | "sys_sendfile_test.cpp", |
| Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 438 | "sys_shm_test.cpp", |
| Elliott Hughes | 5905d6f | 2018-01-30 15:09:51 -0800 | [diff] [blame] | 439 | "sys_signalfd_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 440 | "sys_socket_test.cpp", |
| 441 | "sys_stat_test.cpp", |
| 442 | "sys_statvfs_test.cpp", |
| 443 | "sys_syscall_test.cpp", |
| 444 | "sys_sysinfo_test.cpp", |
| 445 | "sys_sysmacros_test.cpp", |
| 446 | "sys_time_test.cpp", |
| 447 | "sys_timex_test.cpp", |
| Elliott Hughes | 02fdd05 | 2017-07-06 10:33:15 -0700 | [diff] [blame] | 448 | "sys_ttydefaults_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 449 | "sys_types_test.cpp", |
| 450 | "sys_uio_test.cpp", |
| Elliott Hughes | e7d185f | 2018-06-27 13:30:02 -0700 | [diff] [blame] | 451 | "sys_un_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 452 | "sys_vfs_test.cpp", |
| Elliott Hughes | 7cebf83 | 2020-08-12 14:25:41 -0700 | [diff] [blame] | 453 | "sys_wait_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 454 | "sys_xattr_test.cpp", |
| Elliott Hughes | 213d943 | 2023-03-01 22:56:13 +0000 | [diff] [blame] | 455 | "syslog_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 456 | "system_properties_test.cpp", |
| Dimitry Ivanov | 16b2a4d | 2017-01-24 20:43:29 +0000 | [diff] [blame] | 457 | "system_properties_test2.cpp", |
| Elliott Hughes | 5da9646 | 2017-12-14 09:43:59 -0800 | [diff] [blame] | 458 | "termios_test.cpp", |
| Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 459 | "tgmath_test.c", |
| Elliott Hughes | 4206711 | 2019-04-18 14:27:24 -0700 | [diff] [blame] | 460 | "threads_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 461 | "time_test.cpp", |
| 462 | "uchar_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 463 | "unistd_nofortify_test.cpp", |
| 464 | "unistd_test.cpp", |
| Mitch Phillips | 9634c36 | 2022-06-23 11:07:00 -0700 | [diff] [blame] | 465 | "utils.cpp", |
| Elliott Hughes | 4d5ea53 | 2025-05-09 11:16:42 -0700 | [diff] [blame] | 466 | "utime_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 467 | "utmp_test.cpp", |
| Elliott Hughes | dbf5b2e | 2023-04-03 16:30:39 -0700 | [diff] [blame] | 468 | "utmpx_test.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 469 | "wchar_test.cpp", |
| 470 | "wctype_test.cpp", |
| 471 | ], |
| 472 | |
| 473 | include_dirs: [ |
| 474 | "bionic/libc", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 475 | ], |
| 476 | |
| Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 477 | target: { |
| Dan Willemsen | 268ae36 | 2017-09-21 16:56:06 -0700 | [diff] [blame] | 478 | bionic: { |
| Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 479 | whole_static_libs: [ |
| 480 | "libasync_safe", |
| Christopher Ferris | bfd3dc4 | 2018-10-15 10:02:38 -0700 | [diff] [blame] | 481 | "libprocinfo", |
| Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 482 | "libsystemproperties", |
| 483 | ], |
| Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 484 | }, |
| Colin Cross | 7da2034 | 2021-07-28 11:18:11 -0700 | [diff] [blame] | 485 | musl: { |
| 486 | exclude_srcs: [ |
| 487 | // musl doesn't have error.h |
| 488 | "error_test.cpp", |
| 489 | |
| Colin Cross | 7da2034 | 2021-07-28 11:18:11 -0700 | [diff] [blame] | 490 | // musl doesn't define noreturn for C++ |
| 491 | "stdnoreturn_test.cpp", |
| 492 | |
| 493 | // unsupported relocation type 37 |
| 494 | "ifunc_test.cpp", |
| Colin Cross | 118202b | 2023-04-14 09:33:11 -0700 | [diff] [blame] | 495 | |
| 496 | // musl #defines utmp to utmpx, causing a collision with |
| 497 | // utmpx_test.cpp |
| 498 | "utmp_test.cpp", |
| Colin Cross | 7da2034 | 2021-07-28 11:18:11 -0700 | [diff] [blame] | 499 | ], |
| 500 | }, |
| Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 501 | }, |
| 502 | |
| Dan Willemsen | 4156770 | 2016-08-31 16:35:01 -0700 | [diff] [blame] | 503 | static_libs: [ |
| 504 | "libtinyxml2", |
| 505 | "liblog", |
| 506 | "libbase", |
| 507 | ], |
| Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 508 | shared: { |
| 509 | enabled: false, |
| 510 | }, |
| Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 511 | |
| 512 | generated_headers: ["generated_android_ids"], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 513 | } |
| 514 | |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 515 | cc_test_library { |
| 516 | name: "libBionicElfTlsTests", |
| 517 | defaults: ["bionic_tests_defaults"], |
| 518 | srcs: [ |
| 519 | "elftls_test.cpp", |
| 520 | ], |
| 521 | include_dirs: [ |
| 522 | "bionic/libc", |
| 523 | ], |
| Ryan Prichard | 4396392 | 2024-03-14 16:51:27 -0700 | [diff] [blame] | 524 | static_libs: [ |
| 525 | "libbase", |
| 526 | ], |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 527 | shared: { |
| 528 | enabled: false, |
| 529 | }, |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 530 | } |
| 531 | |
| 532 | cc_test_library { |
| 533 | name: "libBionicElfTlsLoaderTests", |
| 534 | defaults: ["bionic_tests_defaults"], |
| 535 | srcs: [ |
| 536 | "elftls_dl_test.cpp", |
| 537 | ], |
| 538 | include_dirs: [ |
| 539 | "bionic/libc", |
| 540 | ], |
| 541 | static_libs: [ |
| 542 | "liblog", |
| 543 | "libbase", |
| 544 | ], |
| 545 | shared: { |
| 546 | enabled: false, |
| 547 | }, |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 548 | } |
| 549 | |
| Peter Collingbourne | 5f45c18 | 2020-01-14 17:59:41 -0800 | [diff] [blame] | 550 | cc_test_library { |
| 551 | name: "libBionicFramePointerTests", |
| 552 | defaults: ["bionic_tests_defaults"], |
| 553 | srcs: [ |
| 554 | "android_unsafe_frame_pointer_chase_test.cpp", |
| 555 | ], |
| 556 | include_dirs: [ |
| 557 | "bionic/libc", |
| 558 | ], |
| 559 | cflags: [ |
| 560 | "-fno-omit-frame-pointer", |
| 561 | ], |
| 562 | } |
| 563 | |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 564 | // ----------------------------------------------------------------------------- |
| 565 | // Fortify tests. |
| 566 | // ----------------------------------------------------------------------------- |
| 567 | |
| 568 | cc_defaults { |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 569 | name: "bionic_clang_fortify_tests_w_flags", |
| 570 | cflags: [ |
| 571 | "-Wno-builtin-memcpy-chk-size", |
| Elliott Hughes | 60aaf2f | 2025-08-14 10:26:22 -0700 | [diff] [blame] | 572 | "-Wno-deprecated-declarations", |
| George Burgess IV | 26d25a2 | 2019-06-06 17:45:05 -0700 | [diff] [blame] | 573 | "-Wno-format-security", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 574 | "-Wno-format-zero-length", |
| Yi Kong | bf67ea5 | 2019-08-03 18:26:05 -0700 | [diff] [blame] | 575 | "-Wno-fortify-source", |
| Priyanka Advani (xWF) | 39b4ba7 | 2025-02-28 12:05:00 -0800 | [diff] [blame] | 576 | "-Wno-memset-transposed-args", |
| George Burgess IV | 77f99aa | 2019-06-06 14:14:52 -0700 | [diff] [blame] | 577 | "-Wno-strlcpy-strlcat-size", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 578 | "-Wno-strncat-size", |
| 579 | ], |
| Elliott Hughes | 141b917 | 2021-04-09 17:13:09 -0700 | [diff] [blame] | 580 | static_libs: [ |
| 581 | "libbase", |
| 582 | ], |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 583 | } |
| 584 | |
| 585 | cc_defaults { |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 586 | name: "bionic_fortify_tests_defaults", |
| Elliott Hughes | 06fda71 | 2025-04-11 08:59:08 -0700 | [diff] [blame] | 587 | defaults: [ |
| 588 | "bionic_tests_defaults", |
| 589 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 590 | cflags: [ |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 591 | "-U_FORTIFY_SOURCE", |
| Peter Collingbourne | dd12616 | 2025-03-25 17:32:35 -0700 | [diff] [blame] | 592 | // Without this, HWASan will not recognize (i.e. will not detect errors involving) |
| 593 | // calls to mem* functions. |
| 594 | "-fbuiltin", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 595 | ], |
| 596 | srcs: ["fortify_test_main.cpp"], |
| Elliott Hughes | 06fda71 | 2025-04-11 08:59:08 -0700 | [diff] [blame] | 597 | shared: { |
| 598 | enabled: false, |
| 599 | }, |
| Elliott Hughes | 141b917 | 2021-04-09 17:13:09 -0700 | [diff] [blame] | 600 | static_libs: [ |
| 601 | "libbase", |
| 602 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 603 | target: { |
| Colin Cross | a48237b | 2022-02-03 10:28:12 -0800 | [diff] [blame] | 604 | musl: { |
| 605 | // Musl doesn't have fortify |
| 606 | enabled: false, |
| 607 | }, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 608 | }, |
| 609 | } |
| 610 | |
| Elliott Hughes | 9b1d3eb | 2025-01-06 06:41:19 -0800 | [diff] [blame] | 611 | // Ensure we don't use FORTIFY'ed functions with the clang static analyzer: |
| George Burgess IV | e5d66eb | 2017-10-30 21:41:22 -0700 | [diff] [blame] | 612 | // it can confuse these tools pretty easily. If this builds successfully, then |
| 613 | // __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly |
| 614 | // enabled. The library that results from building this is meant to be unused. |
| 615 | cc_test_library { |
| Elliott Hughes | 9b1d3eb | 2025-01-06 06:41:19 -0800 | [diff] [blame] | 616 | name: "fortify_disabled_for_clang_analyzer", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 617 | defaults: [ |
| 618 | "bionic_clang_fortify_tests_w_flags", |
| 619 | ], |
| George Burgess IV | e5d66eb | 2017-10-30 21:41:22 -0700 | [diff] [blame] | 620 | cflags: [ |
| 621 | "-Werror", |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 622 | "-U_FORTIFY_SOURCE", |
| 623 | "-D_FORTIFY_SOURCE=3", |
| George Burgess IV | e5d66eb | 2017-10-30 21:41:22 -0700 | [diff] [blame] | 624 | "-D__clang_analyzer__", |
| 625 | ], |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 626 | srcs: ["clang_fortify_tests.cpp"], |
| George Burgess IV | e5d66eb | 2017-10-30 21:41:22 -0700 | [diff] [blame] | 627 | } |
| 628 | |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 629 | cc_test_library { |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 630 | name: "libfortify1-tests-clang", |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 631 | defaults: [ |
| 632 | "bionic_fortify_tests_defaults", |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 633 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 634 | cflags: [ |
| 635 | "-D_FORTIFY_SOURCE=1", |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 636 | "-DTEST_NAME=Fortify1_clang", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 637 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 638 | } |
| 639 | |
| 640 | cc_test_library { |
| 641 | name: "libfortify2-tests-clang", |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 642 | defaults: [ |
| 643 | "bionic_fortify_tests_defaults", |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 644 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 645 | cflags: [ |
| 646 | "-D_FORTIFY_SOURCE=2", |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 647 | "-DTEST_NAME=Fortify2_clang", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 648 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 649 | } |
| 650 | |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 651 | cc_test_library { |
| 652 | name: "libfortify3-tests-clang", |
| 653 | defaults: [ |
| 654 | "bionic_fortify_tests_defaults", |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 655 | ], |
| 656 | cflags: [ |
| 657 | "-D_FORTIFY_SOURCE=3", |
| 658 | "-DTEST_NAME=Fortify3_clang", |
| 659 | ], |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 660 | } |
| 661 | |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 662 | cc_defaults { |
| 663 | name: "bionic_new_fortify_tests_defaults", |
| 664 | defaults: [ |
| 665 | "bionic_clang_fortify_tests_w_flags", |
| Elliott Hughes | 06fda71 | 2025-04-11 08:59:08 -0700 | [diff] [blame] | 666 | "bionic_tests_defaults", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 667 | ], |
| 668 | cflags: [ |
| 669 | "-U_FORTIFY_SOURCE", |
| Peter Collingbourne | dd12616 | 2025-03-25 17:32:35 -0700 | [diff] [blame] | 670 | // Without this, HWASan will not recognize (i.e. will not detect errors involving) |
| 671 | // calls to mem* functions. |
| 672 | "-fbuiltin", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 673 | ], |
| Elliott Hughes | 06fda71 | 2025-04-11 08:59:08 -0700 | [diff] [blame] | 674 | shared: { |
| 675 | enabled: false, |
| 676 | }, |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 677 | srcs: ["clang_fortify_tests.cpp"], |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 678 | } |
| 679 | |
| 680 | cc_test_library { |
| 681 | name: "libfortify1-new-tests-clang", |
| 682 | defaults: [ |
| 683 | "bionic_new_fortify_tests_defaults", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 684 | ], |
| 685 | cflags: [ |
| 686 | "-D_FORTIFY_SOURCE=1", |
| 687 | "-DTEST_NAME=Fortify1_clang_new", |
| 688 | ], |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 689 | } |
| 690 | |
| 691 | cc_test_library { |
| 692 | name: "libfortify2-new-tests-clang", |
| 693 | defaults: [ |
| 694 | "bionic_new_fortify_tests_defaults", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 695 | ], |
| 696 | cflags: [ |
| 697 | "-D_FORTIFY_SOURCE=2", |
| 698 | "-DTEST_NAME=Fortify2_clang_new", |
| 699 | ], |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 700 | } |
| 701 | |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 702 | cc_test_library { |
| 703 | name: "libfortify3-new-tests-clang", |
| 704 | defaults: [ |
| 705 | "bionic_new_fortify_tests_defaults", |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 706 | ], |
| 707 | cflags: [ |
| 708 | "-D_FORTIFY_SOURCE=3", |
| 709 | "-DTEST_NAME=Fortify3_clang_new", |
| 710 | ], |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 711 | } |
| 712 | |
| George Burgess IV | 86da38c | 2024-08-05 13:02:51 -0600 | [diff] [blame] | 713 | cc_defaults { |
| 714 | name: "bionic_fortify_c_tests_defaults", |
| 715 | defaults: [ |
| 716 | "bionic_clang_fortify_tests_w_flags", |
| 717 | "bionic_tests_defaults", |
| 718 | ], |
| 719 | cflags: [ |
| 720 | "-U_FORTIFY_SOURCE", |
| 721 | // -fbuiltin is required here to counteract -fno-builtin from |
| 722 | // `bionic_tests_defaults`. With `-fno-builtin`, Clang won't |
| 723 | // const-evaluate calls to `strlen`, which is tested for here. |
| 724 | "-fbuiltin", |
| 725 | ], |
| 726 | srcs: [ |
| 727 | "clang_fortify_c_only_tests.c", |
| 728 | ], |
| George Burgess IV | 86da38c | 2024-08-05 13:02:51 -0600 | [diff] [blame] | 729 | shared: { |
| 730 | enabled: false, |
| 731 | }, |
| 732 | } |
| 733 | |
| 734 | cc_test_library { |
| 735 | name: "libfortify1-c-tests-clang", |
| 736 | defaults: ["bionic_fortify_c_tests_defaults"], |
| 737 | cflags: ["-D_FORTIFY_SOURCE=1"], |
| 738 | } |
| 739 | |
| 740 | cc_test_library { |
| 741 | name: "libfortify2-c-tests-clang", |
| 742 | defaults: ["bionic_fortify_c_tests_defaults"], |
| 743 | cflags: ["-D_FORTIFY_SOURCE=2"], |
| 744 | } |
| 745 | |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 746 | cc_test_library { |
| 747 | name: "libfortify3-c-tests-clang", |
| 748 | defaults: ["bionic_fortify_c_tests_defaults"], |
| 749 | cflags: ["-D_FORTIFY_SOURCE=3"], |
| 750 | } |
| 751 | |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 752 | // ----------------------------------------------------------------------------- |
| 753 | // Library of all tests (excluding the dynamic linker tests). |
| 754 | // ----------------------------------------------------------------------------- |
| 755 | cc_test_library { |
| 756 | name: "libBionicTests", |
| 757 | defaults: ["bionic_tests_defaults"], |
| Colin Cross | a48237b | 2022-02-03 10:28:12 -0800 | [diff] [blame] | 758 | host_supported: false, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 759 | whole_static_libs: [ |
| 760 | "libBionicStandardTests", |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 761 | "libBionicElfTlsTests", |
| Peter Collingbourne | 5f45c18 | 2020-01-14 17:59:41 -0800 | [diff] [blame] | 762 | "libBionicFramePointerTests", |
| George Burgess IV | 86da38c | 2024-08-05 13:02:51 -0600 | [diff] [blame] | 763 | "libfortify1-c-tests-clang", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 764 | "libfortify1-tests-clang", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 765 | "libfortify1-new-tests-clang", |
| George Burgess IV | 86da38c | 2024-08-05 13:02:51 -0600 | [diff] [blame] | 766 | "libfortify2-c-tests-clang", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 767 | "libfortify2-tests-clang", |
| George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 768 | "libfortify2-new-tests-clang", |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 769 | "libfortify3-c-tests-clang", |
| 770 | "libfortify3-tests-clang", |
| 771 | "libfortify3-new-tests-clang", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 772 | ], |
| Dan Willemsen | 4156770 | 2016-08-31 16:35:01 -0700 | [diff] [blame] | 773 | shared: { |
| 774 | enabled: false, |
| Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 775 | }, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 776 | } |
| 777 | |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 778 | cc_test_library { |
| 779 | name: "libBionicLoaderTests", |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 780 | defaults: [ |
| 781 | "bionic_tests_defaults", |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 782 | ], |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 783 | srcs: [ |
| 784 | "atexit_test.cpp", |
| 785 | "dl_test.cpp", |
| Dimitry Ivanov | 708589f | 2016-09-19 10:50:28 -0700 | [diff] [blame] | 786 | "dlfcn_symlink_support.cpp", |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 787 | "dlfcn_test.cpp", |
| Christopher Ferris | 11526e2 | 2021-10-14 22:44:47 +0000 | [diff] [blame] | 788 | "execinfo_test.cpp", |
| Elliott Hughes | 7c10abb | 2017-04-21 17:15:41 -0700 | [diff] [blame] | 789 | "link_test.cpp", |
| Kalesh Singh | 6459ad3 | 2024-10-02 14:12:23 -0700 | [diff] [blame] | 790 | "page_size_16kib_compat_test.cpp", |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 791 | "pthread_dlfcn_test.cpp", |
| 792 | ], |
| 793 | static_libs: [ |
| 794 | "libbase", |
| Kalesh Singh | 4084b55 | 2024-03-13 13:35:49 -0700 | [diff] [blame] | 795 | "libprocinfo", |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 796 | ], |
| 797 | include_dirs: [ |
| 798 | "bionic/libc", |
| Kalesh Singh | 6459ad3 | 2024-10-02 14:12:23 -0700 | [diff] [blame] | 799 | "bionic/tests/libs", |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 800 | ], |
| 801 | shared: { |
| 802 | enabled: false, |
| 803 | }, |
| 804 | target: { |
| 805 | android: { |
| 806 | srcs: [ |
| Evgenii Stepanov | 0a3637d | 2016-07-06 13:20:59 -0700 | [diff] [blame] | 807 | "cfi_test.cpp", |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 808 | "dlext_test.cpp", |
| 809 | "libdl_test.cpp", |
| 810 | ], |
| 811 | static_libs: [ |
| Sandeep Patil | e3f39a0 | 2019-01-21 14:22:05 -0800 | [diff] [blame] | 812 | "libmeminfo", |
| Torne (Richard Coles) | efbe9a5 | 2018-10-17 15:59:38 -0400 | [diff] [blame] | 813 | "libprocinfo", |
| Andreas Gampe | b9797fe | 2017-07-05 22:36:20 -0700 | [diff] [blame] | 814 | "libziparchive", |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 815 | ], |
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 816 | }, |
| Jiyong Park | 02586a2 | 2017-05-20 01:01:24 +0900 | [diff] [blame] | 817 | }, |
| Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 818 | } |
| 819 | |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 820 | // ----------------------------------------------------------------------------- |
| 821 | // Library of bionic customized gtest main function, with normal gtest output format, |
| 822 | // which is needed by bionic cts test. |
| 823 | // ----------------------------------------------------------------------------- |
| 824 | cc_test_library { |
| 825 | name: "libBionicCtsGtestMain", |
| 826 | defaults: ["bionic_tests_defaults"], |
| Dimitry Ivanov | 927877c | 2016-09-21 11:17:13 -0700 | [diff] [blame] | 827 | srcs: [ |
| Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 828 | "gtest_globals.cpp", |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 829 | "gtest_main.cpp", |
| Dimitry Ivanov | 927877c | 2016-09-21 11:17:13 -0700 | [diff] [blame] | 830 | ], |
| Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 831 | shared: { |
| 832 | enabled: false, |
| 833 | }, |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 834 | whole_static_libs: [ |
| Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 835 | "libbase", |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 836 | "libgtest_isolated", |
| 837 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 838 | } |
| 839 | |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 840 | cc_defaults { |
| Mitch Phillips | f5c9a65 | 2023-08-21 13:53:15 +0200 | [diff] [blame] | 841 | name: "bionic_unit_tests_data", |
| Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 842 | data_bins: [ |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 843 | "cfi_test_helper", |
| 844 | "cfi_test_helper2", |
| Ryan Prichard | 4396392 | 2024-03-14 16:51:27 -0700 | [diff] [blame] | 845 | "elftls_align_test_helper", |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 846 | "elftls_dlopen_ie_error_helper", |
| Ryan Prichard | 98731dc | 2024-02-29 22:56:36 -0800 | [diff] [blame] | 847 | "elftls_dtv_resize_helper", |
| Ryan Prichard | 4396392 | 2024-03-14 16:51:27 -0700 | [diff] [blame] | 848 | "elftls_skew_align_test_helper", |
| Ryan Prichard | 8f639a4 | 2018-10-01 23:10:05 -0700 | [diff] [blame] | 849 | "exec_linker_helper", |
| 850 | "exec_linker_helper_lib", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 851 | "heap_tagging_async_helper", |
| 852 | "heap_tagging_disabled_helper", |
| 853 | "heap_tagging_static_async_helper", |
| 854 | "heap_tagging_static_disabled_helper", |
| 855 | "heap_tagging_static_sync_helper", |
| 856 | "heap_tagging_sync_helper", |
| Florian Mayer | c82d7fc | 2022-08-31 20:57:03 +0000 | [diff] [blame] | 857 | "stack_tagging_helper", |
| 858 | "stack_tagging_static_helper", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 859 | "ld_config_test_helper", |
| 860 | "ld_config_test_helper_lib1", |
| 861 | "ld_config_test_helper_lib2", |
| 862 | "ld_config_test_helper_lib3", |
| 863 | "ld_preload_test_helper", |
| 864 | "ld_preload_test_helper_lib1", |
| 865 | "ld_preload_test_helper_lib2", |
| Mitch Phillips | 477c1eb | 2024-08-21 19:36:51 +0200 | [diff] [blame] | 866 | "memtag_globals_binary", |
| 867 | "memtag_globals_binary_static", |
| 868 | "memtag_globals_dso", |
| 869 | "mte_globals_relr_regression_test_b_314038442", |
| 870 | "mte_globals_relr_regression_test_b_314038442_mte", |
| Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 871 | "ns_hidden_child_helper", |
| 872 | "preinit_getauxval_test_helper", |
| 873 | "preinit_syscall_test_helper", |
| 874 | "thread_exit_cb_helper", |
| 875 | "tls_properties_helper", |
| 876 | ], |
| Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 877 | data_libs: [ |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 878 | "libatest_simple_zip", |
| 879 | "libcfi-test", |
| 880 | "libcfi-test-bad", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 881 | "libdl_preempt_test_1", |
| 882 | "libdl_preempt_test_2", |
| 883 | "libdl_test_df_1_global", |
| 884 | "libdlext_test", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 885 | "libdlext_test_different_soname", |
| 886 | "libdlext_test_fd", |
| 887 | "libdlext_test_norelro", |
| Torne (Richard Coles) | efbe9a5 | 2018-10-17 15:59:38 -0400 | [diff] [blame] | 888 | "libdlext_test_recursive", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 889 | "libdlext_test_zip", |
| Dimitry Ivanov | f1db837 | 2017-04-19 11:58:52 -0700 | [diff] [blame] | 890 | "libgnu-hash-table-library", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 891 | "libns_hidden_child_app", |
| 892 | "libns_hidden_child_global", |
| 893 | "libns_hidden_child_internal", |
| 894 | "libns_hidden_child_public", |
| 895 | "libnstest_dlopened", |
| 896 | "libnstest_ns_a_public1", |
| 897 | "libnstest_ns_a_public1_internal", |
| 898 | "libnstest_ns_b_public2", |
| 899 | "libnstest_ns_b_public3", |
| 900 | "libnstest_private", |
| 901 | "libnstest_private_external", |
| 902 | "libnstest_public", |
| 903 | "libnstest_public_internal", |
| 904 | "libnstest_root", |
| 905 | "libnstest_root_not_isolated", |
| Elliott Hughes | 6dd1f58 | 2020-01-28 12:18:35 -0800 | [diff] [blame] | 906 | "librelocations-ANDROID_REL", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 907 | "librelocations-ANDROID_RELR", |
| Elliott Hughes | 6dd1f58 | 2020-01-28 12:18:35 -0800 | [diff] [blame] | 908 | "librelocations-RELR", |
| 909 | "librelocations-fat", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 910 | "libsegment_gap_inner", |
| 911 | "libsegment_gap_outer", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 912 | "libsysv-hash-table-library", |
| 913 | "libtest_atexit", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 914 | "libtest_check_order_dlsym", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 915 | "libtest_check_order_dlsym_1_left", |
| 916 | "libtest_check_order_dlsym_2_right", |
| 917 | "libtest_check_order_dlsym_3_c", |
| 918 | "libtest_check_order_dlsym_a", |
| 919 | "libtest_check_order_dlsym_b", |
| 920 | "libtest_check_order_dlsym_d", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 921 | "libtest_check_order_reloc_root", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 922 | "libtest_check_order_reloc_root_1", |
| 923 | "libtest_check_order_reloc_root_2", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 924 | "libtest_check_order_reloc_siblings", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 925 | "libtest_check_order_reloc_siblings_1", |
| 926 | "libtest_check_order_reloc_siblings_2", |
| 927 | "libtest_check_order_reloc_siblings_3", |
| 928 | "libtest_check_order_reloc_siblings_a", |
| 929 | "libtest_check_order_reloc_siblings_b", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 930 | "libtest_check_order_reloc_siblings_c", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 931 | "libtest_check_order_reloc_siblings_c_1", |
| 932 | "libtest_check_order_reloc_siblings_c_2", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 933 | "libtest_check_order_reloc_siblings_d", |
| 934 | "libtest_check_order_reloc_siblings_e", |
| 935 | "libtest_check_order_reloc_siblings_f", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 936 | "libtest_check_rtld_next_from_library", |
| Pirama Arumuga Nainar | c53e8b8 | 2018-03-27 10:32:19 -0700 | [diff] [blame] | 937 | "libtest_dlopen_df_1_global", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 938 | "libtest_dlopen_from_ctor", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 939 | "libtest_dlopen_from_ctor_main", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 940 | "libtest_dlopen_weak_undefined_func", |
| 941 | "libtest_dlsym_df_1_global", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 942 | "libtest_dlsym_from_this", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 943 | "libtest_dlsym_from_this_child", |
| 944 | "libtest_dlsym_from_this_grandchild", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 945 | "libtest_dlsym_weak_func", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 946 | "libtest_dt_runpath_a", |
| 947 | "libtest_dt_runpath_b", |
| 948 | "libtest_dt_runpath_c", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 949 | "libtest_dt_runpath_d", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 950 | "libtest_dt_runpath_x", |
| 951 | "libtest_dt_runpath_y", |
| Kalesh Singh | 6459ad3 | 2024-10-02 14:12:23 -0700 | [diff] [blame] | 952 | "libtest_elf_max_page_size_4kib", |
| Ryan Prichard | e84ebbb | 2019-01-23 23:19:19 -0800 | [diff] [blame] | 953 | "libtest_elftls_dynamic", |
| 954 | "libtest_elftls_dynamic_filler_1", |
| 955 | "libtest_elftls_dynamic_filler_2", |
| 956 | "libtest_elftls_dynamic_filler_3", |
| Ryan Prichard | 98731dc | 2024-02-29 22:56:36 -0800 | [diff] [blame] | 957 | "libtest_elftls_dynamic_filler_4", |
| 958 | "libtest_elftls_dynamic_filler_5", |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 959 | "libtest_elftls_shared_var", |
| 960 | "libtest_elftls_shared_var_ie", |
| 961 | "libtest_elftls_tprel", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 962 | "libtest_empty", |
| Dimitry Ivanov | f1db837 | 2017-04-19 11:58:52 -0700 | [diff] [blame] | 963 | "libtest_ifunc", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 964 | "libtest_ifunc_variable", |
| 965 | "libtest_ifunc_variable_impl", |
| 966 | "libtest_indirect_thread_local_dtor", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 967 | "libtest_init_fini_order_child", |
| 968 | "libtest_init_fini_order_grand_child", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 969 | "libtest_init_fini_order_root", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 970 | "libtest_init_fini_order_root2", |
| 971 | "libtest_invalid-empty_shdr_table", |
| Ryan Prichard | 8ea6af5 | 2022-03-24 21:14:27 -0700 | [diff] [blame] | 972 | "libtest_invalid-local-tls", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 973 | "libtest_invalid-rw_load_segment", |
| Kalesh Singh | ce5cdc7 | 2025-08-11 15:52:45 -0700 | [diff] [blame] | 974 | "libtest_invalid-rw_rx_rw_load_segments", |
| 975 | "libtest_invalid-rx_rw_rx_load_segments", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 976 | "libtest_invalid-textrels", |
| 977 | "libtest_invalid-textrels2", |
| 978 | "libtest_invalid-unaligned_shdr_offset", |
| 979 | "libtest_invalid-zero_shdr_table_content", |
| 980 | "libtest_invalid-zero_shdr_table_offset", |
| 981 | "libtest_invalid-zero_shentsize", |
| 982 | "libtest_invalid-zero_shstrndx", |
| Pirama Arumuga Nainar | c53e8b8 | 2018-03-27 10:32:19 -0700 | [diff] [blame] | 983 | "libtest_missing_symbol", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 984 | "libtest_missing_symbol_child_private", |
| 985 | "libtest_missing_symbol_child_public", |
| 986 | "libtest_missing_symbol_root", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 987 | "libtest_nodelete_1", |
| 988 | "libtest_nodelete_2", |
| 989 | "libtest_nodelete_dt_flags_1", |
| 990 | "libtest_pthread_atfork", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 991 | "libtest_relo_check_dt_needed_order", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 992 | "libtest_relo_check_dt_needed_order_1", |
| 993 | "libtest_relo_check_dt_needed_order_2", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 994 | "libtest_simple", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 995 | "libtest_thread_local_dtor", |
| 996 | "libtest_thread_local_dtor2", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 997 | "libtest_two_parents_child", |
| 998 | "libtest_two_parents_parent1", |
| 999 | "libtest_two_parents_parent2", |
| 1000 | "libtest_versioned_lib", |
| 1001 | "libtest_versioned_libv1", |
| 1002 | "libtest_versioned_libv2", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1003 | "libtest_versioned_otherlib", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1004 | "libtest_versioned_otherlib_empty", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1005 | "libtest_versioned_uselibv1", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1006 | "libtest_versioned_uselibv2", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1007 | "libtest_versioned_uselibv2_other", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1008 | "libtest_versioned_uselibv3_other", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1009 | "libtest_with_dependency", |
| 1010 | "libtest_with_dependency_loop", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1011 | "libtest_with_dependency_loop_a", |
| 1012 | "libtest_with_dependency_loop_b", |
| 1013 | "libtest_with_dependency_loop_c", |
| Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1014 | "libtestshared", |
| Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1015 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1016 | } |
| 1017 | |
| Mitch Phillips | f5c9a65 | 2023-08-21 13:53:15 +0200 | [diff] [blame] | 1018 | // ----------------------------------------------------------------------------- |
| 1019 | // Tests for the device using bionic's .so. Run with: |
| 1020 | // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests |
| 1021 | // adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests |
| 1022 | // ----------------------------------------------------------------------------- |
| 1023 | cc_defaults { |
| 1024 | name: "bionic_unit_tests_defaults", |
| 1025 | host_supported: false, |
| 1026 | gtest: false, |
| 1027 | |
| 1028 | defaults: [ |
| 1029 | "bionic_tests_defaults", |
| 1030 | "bionic_unit_tests_data", |
| 1031 | ], |
| 1032 | |
| 1033 | whole_static_libs: [ |
| 1034 | "libBionicTests", |
| 1035 | "libBionicLoaderTests", |
| 1036 | "libBionicElfTlsLoaderTests", |
| 1037 | ], |
| 1038 | |
| 1039 | static_libs: [ |
| 1040 | "libtinyxml2", |
| 1041 | "liblog", |
| 1042 | "libbase", |
| 1043 | "libgtest_isolated", |
| 1044 | ], |
| 1045 | |
| 1046 | srcs: [ |
| 1047 | // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+) |
| 1048 | "__cxa_thread_atexit_test.cpp", |
| 1049 | "gtest_globals.cpp", |
| 1050 | "gtest_main.cpp", |
| 1051 | "gwp_asan_test.cpp", |
| 1052 | "thread_local_test.cpp", |
| 1053 | ], |
| 1054 | |
| 1055 | conlyflags: [ |
| 1056 | "-fexceptions", |
| 1057 | "-fnon-call-exceptions", |
| 1058 | ], |
| 1059 | |
| 1060 | ldflags: ["-Wl,--export-dynamic"], |
| 1061 | |
| 1062 | include_dirs: ["bionic/libc"], |
| 1063 | |
| 1064 | stl: "libc++_static", |
| 1065 | |
| 1066 | target: { |
| 1067 | android: { |
| 1068 | shared_libs: [ |
| 1069 | "ld-android", |
| 1070 | "libdl", |
| 1071 | "libdl_android", |
| 1072 | "libdl_preempt_test_1", |
| 1073 | "libdl_preempt_test_2", |
| 1074 | "libdl_test_df_1_global", |
| 1075 | "libtest_elftls_shared_var", |
| 1076 | "libtest_elftls_tprel", |
| 1077 | ], |
| 1078 | static_libs: [ |
| 1079 | // The order of these libraries matters, do not shuffle them. |
| 1080 | "libmeminfo", |
| 1081 | "libziparchive", |
| 1082 | "libz", |
| 1083 | "libutils", |
| 1084 | ], |
| 1085 | ldflags: [ |
| 1086 | "-Wl,--rpath,${ORIGIN}/bionic-loader-test-libs", |
| 1087 | "-Wl,--enable-new-dtags", |
| 1088 | ], |
| 1089 | }, |
| 1090 | }, |
| 1091 | } |
| 1092 | |
| Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 1093 | cc_test { |
| 1094 | name: "bionic-unit-tests", |
| 1095 | defaults: [ |
| 1096 | "bionic_unit_tests_defaults", |
| 1097 | ], |
| Nick Kralevich | e8bd807 | 2025-02-13 14:53:59 -0800 | [diff] [blame] | 1098 | test_suites: ["general-tests"], |
| Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 1099 | data: [ |
| 1100 | ":libdlext_test_runpath_zip_zipaligned", |
| 1101 | ":libdlext_test_zip_zipaligned", |
| 1102 | ], |
| Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 1103 | } |
| 1104 | |
| Florian Mayer | 3577a93 | 2024-09-17 13:37:21 -0700 | [diff] [blame] | 1105 | cc_defaults { |
| 1106 | name: "hwasan_test_defaults", |
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1107 | enabled: false, |
| 1108 | // This does not use bionic_tests_defaults because it is not supported on |
| 1109 | // host. |
| 1110 | arch: { |
| 1111 | arm64: { |
| 1112 | enabled: true, |
| 1113 | }, |
| 1114 | }, |
| 1115 | sanitize: { |
| 1116 | hwaddress: true, |
| 1117 | }, |
| 1118 | srcs: [ |
| 1119 | "hwasan_test.cpp", |
| 1120 | ], |
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 1121 | data_libs: [ |
| 1122 | "libtest_simple_hwasan", |
| 1123 | "libtest_simple_hwasan_nohwasan", |
| 1124 | ], |
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1125 | header_libs: ["bionic_libc_platform_headers"], |
| Nick Kralevich | e8bd807 | 2025-02-13 14:53:59 -0800 | [diff] [blame] | 1126 | test_suites: ["general-tests"], |
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1127 | } |
| 1128 | |
| 1129 | cc_test { |
| Florian Mayer | 3577a93 | 2024-09-17 13:37:21 -0700 | [diff] [blame] | 1130 | name: "hwasan_test", |
| 1131 | defaults: ["hwasan_test_defaults"], |
| 1132 | shared_libs: [ |
| 1133 | "libbase", |
| 1134 | ], |
| 1135 | } |
| 1136 | |
| 1137 | cc_test { |
| 1138 | name: "hwasan_test_static", |
| 1139 | defaults: ["hwasan_test_defaults"], |
| 1140 | static_libs: [ |
| 1141 | "libbase", |
| 1142 | ], |
| 1143 | static_executable: true, |
| 1144 | cflags: ["-DHWASAN_TEST_STATIC"], |
| 1145 | } |
| 1146 | |
| 1147 | cc_test { |
| Florian Mayer | e65e193 | 2024-02-15 22:20:54 +0000 | [diff] [blame] | 1148 | name: "memtag_stack_dlopen_test", |
| 1149 | enabled: false, |
| 1150 | // This does not use bionic_tests_defaults because it is not supported on |
| 1151 | // host. |
| 1152 | arch: { |
| 1153 | arm64: { |
| 1154 | enabled: true, |
| 1155 | }, |
| 1156 | }, |
| 1157 | sanitize: { |
| 1158 | memtag_heap: true, |
| 1159 | memtag_stack: false, |
| 1160 | }, |
| 1161 | srcs: [ |
| 1162 | "memtag_stack_dlopen_test.cpp", |
| 1163 | ], |
| 1164 | shared_libs: [ |
| 1165 | "libbase", |
| 1166 | ], |
| Kelly Hung | 9fb1a6c | 2024-05-24 13:54:42 +0000 | [diff] [blame] | 1167 | data_libs: [ |
| 1168 | "libtest_simple_memtag_stack", |
| 1169 | "libtest_depends_on_simple_memtag_stack", |
| 1170 | ], |
| Florian Mayer | e65e193 | 2024-02-15 22:20:54 +0000 | [diff] [blame] | 1171 | data_bins: [ |
| 1172 | "testbinary_depends_on_simple_memtag_stack", |
| 1173 | "testbinary_depends_on_depends_on_simple_memtag_stack", |
| Kelly Hung | 9fb1a6c | 2024-05-24 13:54:42 +0000 | [diff] [blame] | 1174 | "testbinary_is_stack_mte_after_dlopen", |
| Florian Mayer | e65e193 | 2024-02-15 22:20:54 +0000 | [diff] [blame] | 1175 | ], |
| 1176 | header_libs: ["bionic_libc_platform_headers"], |
| Nick Kralevich | e8bd807 | 2025-02-13 14:53:59 -0800 | [diff] [blame] | 1177 | test_suites: ["general-tests"], |
| Florian Mayer | e65e193 | 2024-02-15 22:20:54 +0000 | [diff] [blame] | 1178 | } |
| 1179 | |
| 1180 | cc_test { |
| Florian Mayer | a9e144d | 2024-11-11 13:39:05 -0800 | [diff] [blame] | 1181 | name: "memtag_stack_abi_test", |
| 1182 | enabled: false, |
| 1183 | // This does not use bionic_tests_defaults because it is not supported on |
| 1184 | // host. |
| 1185 | arch: { |
| 1186 | arm64: { |
| 1187 | enabled: true, |
| 1188 | }, |
| 1189 | }, |
| 1190 | // We don't use `sanitize:` so we generate the appropriate ELF note, but |
| 1191 | // still support non-MTE devices. |
| 1192 | // TODO(fmayer): also add a test that enables stack MTE for MTE devices, |
| 1193 | // which would test for more bugs. |
| 1194 | ldflags: ["-fsanitize=memtag-stack"], |
| 1195 | // Turn off all other sanitizers from SANITIZE_TARGET. |
| 1196 | sanitize: { |
| Florian Mayer | 6279931 | 2024-11-12 21:04:11 +0000 | [diff] [blame] | 1197 | never: true, |
| Florian Mayer | a9e144d | 2024-11-11 13:39:05 -0800 | [diff] [blame] | 1198 | }, |
| 1199 | shared_libs: [ |
| 1200 | "libbase", |
| 1201 | ], |
| 1202 | srcs: [ |
| 1203 | "memtag_stack_abi_test.cpp", |
| 1204 | ], |
| 1205 | header_libs: ["bionic_libc_platform_headers"], |
| Nick Kralevich | e8bd807 | 2025-02-13 14:53:59 -0800 | [diff] [blame] | 1206 | test_suites: ["general-tests"], |
| Florian Mayer | a9e144d | 2024-11-11 13:39:05 -0800 | [diff] [blame] | 1207 | } |
| 1208 | |
| 1209 | cc_test { |
| Christopher Ferris | ee0ce44 | 2019-10-21 12:35:05 -0700 | [diff] [blame] | 1210 | name: "bionic-stress-tests", |
| 1211 | defaults: [ |
| 1212 | "bionic_tests_defaults", |
| 1213 | ], |
| 1214 | |
| 1215 | // For now, these tests run forever, so do not use the isolation framework. |
| 1216 | isolated: false, |
| Julien Desprez | 11874f8 | 2021-02-05 00:52:14 +0000 | [diff] [blame] | 1217 | // Running forever, do not consider unit test. |
| 1218 | test_options: { |
| 1219 | unit_test: false, |
| 1220 | }, |
| Christopher Ferris | ee0ce44 | 2019-10-21 12:35:05 -0700 | [diff] [blame] | 1221 | |
| 1222 | srcs: [ |
| 1223 | "malloc_stress_test.cpp", |
| 1224 | ], |
| 1225 | |
| 1226 | shared_libs: [ |
| 1227 | "libbase", |
| Christopher Ferris | fe2a9eb | 2024-10-16 15:21:36 -0700 | [diff] [blame] | 1228 | "liblog", |
| Christopher Ferris | ee0ce44 | 2019-10-21 12:35:05 -0700 | [diff] [blame] | 1229 | ], |
| 1230 | |
| 1231 | target: { |
| 1232 | android: { |
| 1233 | static_libs: [ |
| 1234 | "libmeminfo", |
| 1235 | "libprocinfo", |
| 1236 | ], |
| 1237 | }, |
| 1238 | }, |
| 1239 | } |
| 1240 | |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1241 | // ----------------------------------------------------------------------------- |
| 1242 | // Tests for the device linked against bionic's static library. Run with: |
| Bernie Innocenti | b664724 | 2018-06-18 14:14:43 +0900 | [diff] [blame] | 1243 | // adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static |
| 1244 | // adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1245 | // ----------------------------------------------------------------------------- |
| 1246 | cc_test { |
| 1247 | name: "bionic-unit-tests-static", |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1248 | gtest: false, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1249 | defaults: ["bionic_tests_defaults"], |
| Nick Kralevich | e8bd807 | 2025-02-13 14:53:59 -0800 | [diff] [blame] | 1250 | test_suites: ["general-tests"], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1251 | host_supported: false, |
| 1252 | |
| Dimitry Ivanov | 462ea66 | 2017-01-06 14:49:57 -0800 | [diff] [blame] | 1253 | srcs: [ |
| 1254 | "gtest_preinit_debuggerd.cpp", |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1255 | "gtest_globals.cpp", |
| 1256 | "gtest_main.cpp", |
| Ryan Prichard | 083d850 | 2019-01-24 13:47:13 -0800 | [diff] [blame] | 1257 | |
| Ryan Prichard | 4396392 | 2024-03-14 16:51:27 -0700 | [diff] [blame] | 1258 | // Test internal parts of Bionic that aren't exposed via libc.so. |
| Ryan Prichard | 083d850 | 2019-01-24 13:47:13 -0800 | [diff] [blame] | 1259 | "bionic_allocator_test.cpp", |
| Ryan Prichard | 4396392 | 2024-03-14 16:51:27 -0700 | [diff] [blame] | 1260 | "static_tls_layout_test.cpp", |
| Ryan Prichard | 083d850 | 2019-01-24 13:47:13 -0800 | [diff] [blame] | 1261 | ], |
| 1262 | include_dirs: [ |
| 1263 | "bionic/libc", |
| Dimitry Ivanov | 462ea66 | 2017-01-06 14:49:57 -0800 | [diff] [blame] | 1264 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1265 | whole_static_libs: [ |
| 1266 | "libBionicTests", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1267 | ], |
| 1268 | |
| 1269 | static_libs: [ |
| 1270 | "libm", |
| 1271 | "libc", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1272 | "libdl", |
| 1273 | "libtinyxml2", |
| 1274 | "liblog", |
| 1275 | "libbase", |
| Josh Gao | 2a3b4fa | 2016-10-26 17:55:49 -0700 | [diff] [blame] | 1276 | "libdebuggerd_handler", |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1277 | "libgtest_isolated", |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 1278 | "libtest_elftls_shared_var", |
| 1279 | "libtest_elftls_tprel", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1280 | ], |
| 1281 | |
| 1282 | static_executable: true, |
| 1283 | stl: "libc++_static", |
| Yi Kong | b952a77 | 2021-10-21 17:31:35 +0800 | [diff] [blame] | 1284 | // Clang cannot build ifunc with LTO. |
| 1285 | // http://b/203737712 |
| 1286 | lto: { |
| 1287 | never: true, |
| 1288 | }, |
| Mitch Phillips | 9425b16 | 2022-02-04 17:13:27 -0800 | [diff] [blame] | 1289 | data_bins: [ |
| Ryan Prichard | 4396392 | 2024-03-14 16:51:27 -0700 | [diff] [blame] | 1290 | "elftls_align_test_helper", |
| 1291 | "elftls_skew_align_test_helper", |
| Mitch Phillips | 9425b16 | 2022-02-04 17:13:27 -0800 | [diff] [blame] | 1292 | "heap_tagging_async_helper", |
| 1293 | "heap_tagging_disabled_helper", |
| 1294 | "heap_tagging_static_async_helper", |
| 1295 | "heap_tagging_static_disabled_helper", |
| 1296 | "heap_tagging_static_sync_helper", |
| 1297 | "heap_tagging_sync_helper", |
| Mitch Phillips | 477c1eb | 2024-08-21 19:36:51 +0200 | [diff] [blame] | 1298 | "memtag_globals_binary", |
| 1299 | "memtag_globals_binary_static", |
| 1300 | "memtag_globals_dso", |
| 1301 | "mte_globals_relr_regression_test_b_314038442", |
| 1302 | "mte_globals_relr_regression_test_b_314038442_mte", |
| Florian Mayer | c82d7fc | 2022-08-31 20:57:03 +0000 | [diff] [blame] | 1303 | "stack_tagging_helper", |
| 1304 | "stack_tagging_static_helper", |
| Mitch Phillips | 9425b16 | 2022-02-04 17:13:27 -0800 | [diff] [blame] | 1305 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1306 | } |
| 1307 | |
| 1308 | // ----------------------------------------------------------------------------- |
| 1309 | // Tests to run on the host and linked against glibc. Run with: |
| 1310 | // cd bionic/tests; mm bionic-unit-tests-glibc-run |
| 1311 | // ----------------------------------------------------------------------------- |
| 1312 | |
| 1313 | cc_test_host { |
| 1314 | name: "bionic-unit-tests-glibc", |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1315 | gtest: false, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1316 | defaults: ["bionic_tests_defaults"], |
| 1317 | |
| 1318 | srcs: [ |
| 1319 | "atexit_test.cpp", |
| Dimitry Ivanov | 708589f | 2016-09-19 10:50:28 -0700 | [diff] [blame] | 1320 | "dlfcn_symlink_support.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1321 | "dlfcn_test.cpp", |
| 1322 | "dl_test.cpp", |
| Christopher Ferris | 11526e2 | 2021-10-14 22:44:47 +0000 | [diff] [blame] | 1323 | "execinfo_test.cpp", |
| Elliott Hughes | 00a07c7 | 2025-04-17 15:27:29 -0400 | [diff] [blame] | 1324 | "link_test.cpp", |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1325 | "gtest_globals.cpp", |
| 1326 | "gtest_main.cpp", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1327 | "pthread_dlfcn_test.cpp", |
| 1328 | ], |
| 1329 | |
| 1330 | shared_libs: [ |
| 1331 | "libdl_preempt_test_1", |
| 1332 | "libdl_preempt_test_2", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1333 | "libdl_test_df_1_global", |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 1334 | "libtest_elftls_shared_var", |
| 1335 | "libtest_elftls_tprel", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1336 | ], |
| 1337 | |
| 1338 | whole_static_libs: [ |
| 1339 | "libBionicStandardTests", |
| Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 1340 | "libBionicElfTlsTests", |
| 1341 | "libBionicElfTlsLoaderTests", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1342 | "libfortify1-tests-clang", |
| 1343 | "libfortify2-tests-clang", |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 1344 | "libfortify3-tests-clang", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1345 | ], |
| 1346 | |
| 1347 | static_libs: [ |
| 1348 | "libbase", |
| 1349 | "liblog", |
| 1350 | "libcutils", |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1351 | "libgtest_isolated", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1352 | ], |
| 1353 | |
| 1354 | host_ldlibs: [ |
| 1355 | "-lresolv", |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1356 | "-lutil", |
| 1357 | ], |
| 1358 | |
| Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1359 | include_dirs: [ |
| 1360 | "bionic/libc", |
| 1361 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1362 | |
| Dimitry Ivanov | d0b5c3a | 2016-11-25 12:23:11 -0800 | [diff] [blame] | 1363 | ldflags: [ |
| 1364 | "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs", |
| 1365 | "-Wl,--export-dynamic", |
| 1366 | ], |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1367 | |
| 1368 | sanitize: { |
| 1369 | never: false, |
| 1370 | }, |
| Dan Willemsen | 268ae36 | 2017-09-21 16:56:06 -0700 | [diff] [blame] | 1371 | |
| 1372 | target: { |
| 1373 | linux_bionic: { |
| 1374 | enabled: false, |
| 1375 | }, |
| Colin Cross | 7da2034 | 2021-07-28 11:18:11 -0700 | [diff] [blame] | 1376 | musl: { |
| 1377 | exclude_static_libs: [ |
| 1378 | // Musl doesn't have fortify |
| 1379 | "libfortify1-tests-clang", |
| 1380 | "libfortify2-tests-clang", |
| Sharjeel Khan | 1725147 | 2025-04-10 21:39:59 +0000 | [diff] [blame] | 1381 | "libfortify3-tests-clang", |
| Colin Cross | 7da2034 | 2021-07-28 11:18:11 -0700 | [diff] [blame] | 1382 | ], |
| 1383 | }, |
| Dan Willemsen | 268ae36 | 2017-09-21 16:56:06 -0700 | [diff] [blame] | 1384 | }, |
| Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1385 | } |
| 1386 | |
| Kelly Hung | 9fb1a6c | 2024-05-24 13:54:42 +0000 | [diff] [blame] | 1387 | cc_defaults { |
| 1388 | name: "bionic_compile_time_tests_defaults", |
| George Burgess IV | f93e7fd | 2025-03-05 11:38:52 -0700 | [diff] [blame] | 1389 | enabled: true, |
| Kelly Hung | 9fb1a6c | 2024-05-24 13:54:42 +0000 | [diff] [blame] | 1390 | clang_verify: true, |
| 1391 | cflags: [ |
| 1392 | "-Wall", |
| 1393 | "-Wno-error", |
| 1394 | "-fno-color-diagnostics", |
| 1395 | "-ferror-limit=10000", |
| 1396 | "-DCOMPILATION_TESTS=1", |
| 1397 | "-Wformat-nonliteral", |
| 1398 | "-U_FORTIFY_SOURCE", |
| 1399 | ], |
| Elliott Hughes | 734a0c9 | 2025-08-12 10:33:24 -0700 | [diff] [blame] | 1400 | header_libs: ["libbase_headers"], |
| Kelly Hung | 9fb1a6c | 2024-05-24 13:54:42 +0000 | [diff] [blame] | 1401 | srcs: ["clang_fortify_tests.cpp"], |
| 1402 | } |
| 1403 | |
| 1404 | cc_library_static { |
| 1405 | name: "bionic-compile-time-tests1-clang++", |
| 1406 | defaults: [ |
| 1407 | "bionic_compile_time_tests_defaults", |
| 1408 | ], |
| 1409 | cppflags: [ |
| 1410 | "-D_FORTIFY_SOURCE=1", |
| 1411 | ], |
| 1412 | } |
| 1413 | |
| 1414 | cc_library_static { |
| 1415 | name: "bionic-compile-time-tests2-clang++", |
| 1416 | defaults: [ |
| 1417 | "bionic_compile_time_tests_defaults", |
| 1418 | ], |
| 1419 | cppflags: [ |
| 1420 | "-D_FORTIFY_SOURCE=2", |
| 1421 | ], |
| 1422 | } |
| Elliott Hughes | 0850765 | 2025-03-14 12:53:58 -0700 | [diff] [blame] | 1423 | |
| 1424 | cc_library_static { |
| 1425 | name: "bionic-compile-time-tests3-clang++", |
| 1426 | defaults: [ |
| 1427 | "bionic_compile_time_tests_defaults", |
| 1428 | ], |
| 1429 | cppflags: [ |
| 1430 | "-D_FORTIFY_SOURCE=3", |
| 1431 | ], |
| 1432 | } |