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