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