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