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