Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1 | bionic_coverage = false |
| 2 | |
| 3 | // Define the common source files for all the libc instances |
| 4 | // ========================================================= |
| 5 | libc_common_src_files = [ |
| 6 | "bionic/bindresvport.c", |
| 7 | "bionic/ether_aton.c", |
| 8 | "bionic/ether_ntoa.c", |
| 9 | "bionic/fts.c", |
| 10 | "bionic/getpriority.c", |
| 11 | "bionic/if_indextoname.c", |
| 12 | "bionic/if_nametoindex.c", |
| 13 | "bionic/initgroups.c", |
| 14 | "bionic/ioctl.c", |
| 15 | "bionic/isatty.c", |
| 16 | "bionic/memmem.c", |
| 17 | "bionic/pututline.c", |
| 18 | "bionic/sched_cpualloc.c", |
| 19 | "bionic/sched_cpucount.c", |
| 20 | "bionic/sigblock.c", |
| 21 | "bionic/siginterrupt.c", |
| 22 | "bionic/sigsetmask.c", |
| 23 | "bionic/system_properties_compat.c", |
| 24 | "stdio/findfp.c", |
| 25 | "stdio/fread.c", |
| 26 | "stdio/snprintf.c", |
| 27 | "stdio/sprintf.c", |
| 28 | "stdio/stdio.c", |
| 29 | "stdio/stdio_ext.cpp", |
| 30 | "stdlib/atexit.c", |
| 31 | "stdlib/exit.c", |
| 32 | |
| 33 | // Fortify implementations of libc functions. |
| 34 | "bionic/__FD_chk.cpp", |
| 35 | "bionic/__fgets_chk.cpp", |
| 36 | "bionic/__fread_chk.cpp", |
| 37 | "bionic/__fwrite_chk.cpp", |
| 38 | "bionic/__getcwd_chk.cpp", |
| 39 | "bionic/__memchr_chk.cpp", |
| 40 | "bionic/__memmove_chk.cpp", |
| 41 | "bionic/__memrchr_chk.cpp", |
| 42 | "bionic/__poll_chk.cpp", |
| 43 | "bionic/__pread64_chk.cpp", |
| 44 | "bionic/__pread_chk.cpp", |
| 45 | "bionic/__pwrite64_chk.cpp", |
| 46 | "bionic/__pwrite_chk.cpp", |
| 47 | "bionic/__read_chk.cpp", |
| 48 | "bionic/__readlink_chk.cpp", |
| 49 | "bionic/__readlinkat_chk.cpp", |
| 50 | "bionic/__recvfrom_chk.cpp", |
| 51 | "bionic/__stpcpy_chk.cpp", |
| 52 | "bionic/__stpncpy_chk.cpp", |
| 53 | "bionic/__strchr_chk.cpp", |
| 54 | "bionic/__strlcat_chk.cpp", |
| 55 | "bionic/__strlcpy_chk.cpp", |
| 56 | "bionic/__strlen_chk.cpp", |
| 57 | "bionic/__strncat_chk.cpp", |
| 58 | "bionic/__strncpy_chk.cpp", |
| 59 | "bionic/__strrchr_chk.cpp", |
| 60 | "bionic/__umask_chk.cpp", |
| 61 | "bionic/__vsnprintf_chk.cpp", |
| 62 | "bionic/__vsprintf_chk.cpp", |
| 63 | "bionic/__write_chk.cpp", |
| 64 | ] |
| 65 | |
| 66 | // Various kinds of cruft. |
| 67 | // ======================================================== |
| 68 | libc_common_src_files += [ |
| 69 | "bionic/ndk_cruft.cpp", |
| 70 | ] |
| 71 | |
| 72 | libc_common_src_files_32 = [ |
| 73 | "bionic/legacy_32_bit_support.cpp", |
| 74 | "bionic/time64.c", |
| 75 | ] |
| 76 | |
| 77 | // Define some common cflags |
| 78 | // ======================================================== |
| 79 | libc_common_cflags = [ |
| 80 | "-D_LIBC=1", |
| 81 | "-Wall", |
| 82 | "-Wextra", |
| 83 | "-Wunused", |
| 84 | |
| 85 | // Try to catch typical 32-bit assumptions that break with 64-bit pointers. |
| 86 | "-Werror=pointer-to-int-cast", |
| 87 | "-Werror=int-to-pointer-cast", |
| 88 | "-Werror=type-limits", |
| 89 | "-Werror", |
| 90 | ] |
| 91 | |
| 92 | libc_common_product_variables = { |
| 93 | device_uses_jemalloc: { |
| 94 | cflags: ["-DUSE_JEMALLOC"], |
| 95 | include_dirs: ["external/jemalloc/include"], |
| 96 | }, |
| 97 | device_uses_dlmalloc: { |
| 98 | cflags: ["-DUSE_DLMALLOC"], |
| 99 | }, |
| 100 | // To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in |
| 101 | // the appropriate BoardConfig.mk file. |
| 102 | dlmalloc_alignment: { |
| 103 | cflags: ["-DMALLOC_ALIGNMENT=%d"], |
| 104 | }, |
| 105 | } |
| 106 | |
| 107 | // Clang/llvm has incompatible long double (fp128) for x86_64. |
| 108 | // https://llvm.org/bugs/show_bug.cgi?id=23897 |
| 109 | use_clang_x86_64 = false |
| 110 | |
| 111 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 112 | // ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true) |
| 113 | //libc_common_cflags += ["-DDEBUG"] |
| 114 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 115 | // endif |
| 116 | |
| 117 | // |
| 118 | // Define some common conlyflags |
| 119 | libc_common_conlyflags = ["-std=gnu99"] |
| 120 | |
| 121 | // Define some common cppflags |
| 122 | libc_common_cppflags = [] |
| 123 | |
| 124 | // ======================================================== |
| 125 | // libc_stack_protector.a - stack protector code |
| 126 | // ======================================================== |
| 127 | // |
| 128 | // The stack protector code needs to be compiled |
| 129 | // with -fno-stack-protector, since it modifies the |
| 130 | // stack canary. |
| 131 | |
| 132 | cc_library_static { |
| 133 | |
| 134 | srcs: ["bionic/__stack_chk_fail.cpp"], |
| 135 | cflags: libc_common_cflags + ["-fno-stack-protector"], |
| 136 | conlyflags: libc_common_conlyflags, |
| 137 | cppflags: libc_common_cppflags, |
| 138 | product_variables: libc_common_product_variables, |
| 139 | name: "libc_stack_protector", |
| 140 | |
| 141 | stl: "none", |
| 142 | system_shared_libs: [], |
| 143 | sanitize: ["never"], |
| 144 | native_coverage: bionic_coverage, |
| 145 | |
| 146 | arch: { |
| 147 | x86_64: { |
| 148 | clang: use_clang_x86_64, |
| 149 | }, |
| 150 | }, |
| 151 | |
| 152 | } |
| 153 | |
| 154 | // ======================================================== |
| 155 | // libc_tzcode.a - upstream 'tzcode' code |
| 156 | // ======================================================== |
| 157 | |
| 158 | cc_library_static { |
| 159 | |
| 160 | srcs: [ |
| 161 | "tzcode/asctime.c", |
| 162 | "tzcode/difftime.c", |
| 163 | "tzcode/localtime.c", |
| 164 | "tzcode/strftime.c", |
| 165 | "tzcode/strptime.c", |
| 166 | "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one. |
| 167 | ], |
| 168 | |
| 169 | cflags: libc_common_cflags + [ |
| 170 | "-fvisibility=hidden", |
| 171 | // Don't use ridiculous amounts of stack. |
| 172 | "-DALL_STATE", |
| 173 | // Include tzsetwall, timelocal, timegm, time2posix, and posix2time. |
| 174 | "-DSTD_INSPIRED", |
| 175 | // The name of the tm_gmtoff field in our struct tm. |
| 176 | "-DTM_GMTOFF=tm_gmtoff", |
| 177 | // Where we store our tzdata. |
| 178 | "-DTZDIR=\\\"/system/usr/share/zoneinfo\\\"", |
| 179 | // Include timezone and daylight globals. |
| 180 | "-DUSG_COMPAT=1", |
| 181 | "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU", |
| 182 | "-Dlint", |
| 183 | ], |
| 184 | |
| 185 | conlyflags: libc_common_conlyflags, |
| 186 | cppflags: libc_common_cppflags, |
| 187 | product_variables: libc_common_product_variables, |
| 188 | local_include_dirs: ["tzcode/"], |
| 189 | name: "libc_tzcode", |
| 190 | |
| 191 | stl: "none", |
| 192 | system_shared_libs: [], |
| 193 | sanitize: ["never"], |
| 194 | native_coverage: bionic_coverage, |
| 195 | |
| 196 | arch: { |
| 197 | x86_64: { |
| 198 | clang: use_clang_x86_64, |
| 199 | }, |
| 200 | }, |
| 201 | } |
| 202 | |
| 203 | // ======================================================== |
| 204 | // libc_dns.a - modified NetBSD DNS code |
| 205 | // ======================================================== |
| 206 | |
| 207 | cc_library_static { |
| 208 | |
| 209 | srcs: [ |
| 210 | "dns/net/gethnamaddr.c", |
| 211 | "dns/net/getservbyname.c", |
| 212 | "dns/net/getservbyport.c", |
| 213 | "dns/net/getaddrinfo.c", |
| 214 | "dns/net/getnameinfo.c", |
| 215 | "dns/net/sethostent.c", |
| 216 | "dns/net/getservent.c", |
| 217 | "dns/net/nsdispatch.c", |
| 218 | "dns/net/base64.c", |
| 219 | "dns/resolv/res_state.c", |
| 220 | "dns/resolv/res_init.c", |
| 221 | "dns/resolv/res_mkquery.c", |
| 222 | "dns/resolv/res_data.c", |
| 223 | "dns/resolv/res_debug.c", |
| 224 | "dns/resolv/herror.c", |
| 225 | "dns/resolv/res_cache.c", |
| 226 | "dns/resolv/res_query.c", |
| 227 | "dns/resolv/res_comp.c", |
| 228 | "dns/resolv/res_send.c", |
| 229 | "dns/nameser/ns_name.c", |
| 230 | "dns/nameser/ns_print.c", |
| 231 | "dns/nameser/ns_parse.c", |
| 232 | "dns/nameser/ns_ttl.c", |
| 233 | "dns/nameser/ns_netint.c", |
| 234 | "dns/nameser/ns_samedomain.c", |
| 235 | |
| 236 | "upstream-netbsd/lib/libc/isc/ev_streams.c", |
| 237 | "upstream-netbsd/lib/libc/isc/ev_timers.c", |
| 238 | "upstream-netbsd/lib/libc/resolv/mtctxres.c", |
| 239 | // We use the OpenBSD res_random. |
| 240 | "upstream-openbsd/lib/libc/net/res_random.c", |
| 241 | ], |
| 242 | |
| 243 | cflags: ["-Dres_randomid=__res_randomid"] + |
| 244 | libc_common_cflags + [ |
| 245 | "-DANDROID_CHANGES", |
| 246 | "-DINET6", |
| 247 | "-fvisibility=hidden", |
| 248 | "-Wno-unused-parameter", |
| 249 | "-include netbsd-compat.h", |
| 250 | ], |
| 251 | |
| 252 | conlyflags: libc_common_conlyflags, |
| 253 | cppflags: libc_common_cppflags, |
| 254 | product_variables: libc_common_product_variables, |
| 255 | local_include_dirs: [ |
| 256 | "dns/include", |
| 257 | "private", |
| 258 | "upstream-netbsd/lib/libc/include", |
| 259 | "upstream-netbsd/android/include", |
| 260 | ], |
| 261 | |
| 262 | name: "libc_dns", |
| 263 | |
| 264 | stl: "none", |
| 265 | system_shared_libs: [], |
| 266 | sanitize: ["never"], |
| 267 | native_coverage: bionic_coverage, |
| 268 | |
| 269 | arch: { |
| 270 | x86_64: { |
| 271 | clang: use_clang_x86_64, |
| 272 | }, |
| 273 | }, |
| 274 | } |
| 275 | |
| 276 | // ======================================================== |
| 277 | // libc_freebsd.a - upstream FreeBSD C library code |
| 278 | // ======================================================== |
| 279 | // |
| 280 | // These files are built with the freebsd-compat.h header file |
| 281 | // automatically included. |
| 282 | |
| 283 | cc_library_static { |
| 284 | srcs: [ |
| 285 | "upstream-freebsd/lib/libc/gen/ldexp.c", |
| 286 | "upstream-freebsd/lib/libc/gen/sleep.c", |
| 287 | "upstream-freebsd/lib/libc/gen/usleep.c", |
| 288 | "upstream-freebsd/lib/libc/stdlib/getopt_long.c", |
| 289 | "upstream-freebsd/lib/libc/stdlib/qsort.c", |
| 290 | "upstream-freebsd/lib/libc/stdlib/quick_exit.c", |
| 291 | "upstream-freebsd/lib/libc/stdlib/realpath.c", |
| 292 | "upstream-freebsd/lib/libc/string/wcpcpy.c", |
| 293 | "upstream-freebsd/lib/libc/string/wcpncpy.c", |
| 294 | "upstream-freebsd/lib/libc/string/wcscasecmp.c", |
| 295 | "upstream-freebsd/lib/libc/string/wcscspn.c", |
| 296 | "upstream-freebsd/lib/libc/string/wcsdup.c", |
| 297 | "upstream-freebsd/lib/libc/string/wcslcat.c", |
| 298 | "upstream-freebsd/lib/libc/string/wcsncasecmp.c", |
| 299 | "upstream-freebsd/lib/libc/string/wcsncat.c", |
| 300 | "upstream-freebsd/lib/libc/string/wcsncmp.c", |
| 301 | "upstream-freebsd/lib/libc/string/wcsncpy.c", |
| 302 | "upstream-freebsd/lib/libc/string/wcsnlen.c", |
| 303 | "upstream-freebsd/lib/libc/string/wcspbrk.c", |
| 304 | "upstream-freebsd/lib/libc/string/wcsspn.c", |
| 305 | "upstream-freebsd/lib/libc/string/wcstok.c", |
| 306 | "upstream-freebsd/lib/libc/string/wmemchr.c", |
| 307 | "upstream-freebsd/lib/libc/string/wmemset.c", |
| 308 | |
| 309 | // May be overriden by per-arch optimized versions |
| 310 | "upstream-freebsd/lib/libc/string/wcscat.c", |
| 311 | "upstream-freebsd/lib/libc/string/wcschr.c", |
| 312 | "upstream-freebsd/lib/libc/string/wcscmp.c", |
| 313 | "upstream-freebsd/lib/libc/string/wcscpy.c", |
| 314 | "upstream-freebsd/lib/libc/string/wcslen.c", |
| 315 | "upstream-freebsd/lib/libc/string/wcsrchr.c", |
| 316 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
| 317 | "upstream-freebsd/lib/libc/string/wmemmove.c", |
| 318 | ], |
| 319 | arch: { |
| 320 | arm64: { |
| 321 | exclude_srcs: [ |
| 322 | "upstream-freebsd/lib/libc/string/wmemmove.c", |
| 323 | ], |
| 324 | }, |
| 325 | x86: { |
| 326 | exclude_srcs: [ |
| 327 | "upstream-freebsd/lib/libc/string/wcschr.c", |
| 328 | "upstream-freebsd/lib/libc/string/wcscmp.c", |
| 329 | "upstream-freebsd/lib/libc/string/wcslen.c", |
| 330 | "upstream-freebsd/lib/libc/string/wcsrchr.c", |
| 331 | ], |
| 332 | }, |
| 333 | x86_sse3: { |
| 334 | exclude_srcs: [ |
| 335 | "upstream-freebsd/lib/libc/string/wcscpy.c", |
| 336 | "upstream-freebsd/lib/libc/string/wcscat.c", |
| 337 | ], |
| 338 | }, |
| 339 | x86_sse4: { |
| 340 | exclude_srcs: [ |
| 341 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
| 342 | ], |
| 343 | }, |
| 344 | x86_64: { |
| 345 | clang: use_clang_x86_64, |
| 346 | }, |
| 347 | }, |
| 348 | |
| 349 | cflags: libc_common_cflags + [ |
| 350 | "-Wno-sign-compare", |
| 351 | "-Wno-uninitialized", |
| 352 | "-include freebsd-compat.h", |
| 353 | ], |
| 354 | |
| 355 | conlyflags: libc_common_conlyflags, |
| 356 | cppflags: libc_common_cppflags, |
| 357 | product_variables: libc_common_product_variables, |
| 358 | local_include_dirs: [ |
| 359 | "upstream-freebsd/android/include", |
| 360 | ], |
| 361 | |
| 362 | name: "libc_freebsd", |
| 363 | |
| 364 | stl: "none", |
| 365 | system_shared_libs: [], |
| 366 | sanitize: ["never"], |
| 367 | native_coverage: bionic_coverage, |
| 368 | |
| 369 | } |
| 370 | |
| 371 | // ======================================================== |
| 372 | // libc_netbsd.a - upstream NetBSD C library code |
| 373 | // ======================================================== |
| 374 | // |
| 375 | // These files are built with the netbsd-compat.h header file |
| 376 | // automatically included. |
| 377 | |
| 378 | cc_library_static { |
| 379 | |
| 380 | srcs: [ |
| 381 | "upstream-netbsd/common/lib/libc/stdlib/random.c", |
| 382 | "upstream-netbsd/lib/libc/gen/ftw.c", |
| 383 | "upstream-netbsd/lib/libc/gen/nftw.c", |
| 384 | "upstream-netbsd/lib/libc/gen/nice.c", |
| 385 | "upstream-netbsd/lib/libc/gen/popen.c", |
| 386 | "upstream-netbsd/lib/libc/gen/psignal.c", |
| 387 | "upstream-netbsd/lib/libc/gen/utime.c", |
| 388 | "upstream-netbsd/lib/libc/gen/utmp.c", |
| 389 | "upstream-netbsd/lib/libc/inet/nsap_addr.c", |
| 390 | "upstream-netbsd/lib/libc/regex/regcomp.c", |
| 391 | "upstream-netbsd/lib/libc/regex/regerror.c", |
| 392 | "upstream-netbsd/lib/libc/regex/regexec.c", |
| 393 | "upstream-netbsd/lib/libc/regex/regfree.c", |
| 394 | "upstream-netbsd/lib/libc/stdlib/bsearch.c", |
| 395 | "upstream-netbsd/lib/libc/stdlib/div.c", |
| 396 | "upstream-netbsd/lib/libc/stdlib/drand48.c", |
| 397 | "upstream-netbsd/lib/libc/stdlib/erand48.c", |
| 398 | "upstream-netbsd/lib/libc/stdlib/jrand48.c", |
| 399 | "upstream-netbsd/lib/libc/stdlib/lcong48.c", |
| 400 | "upstream-netbsd/lib/libc/stdlib/ldiv.c", |
| 401 | "upstream-netbsd/lib/libc/stdlib/lldiv.c", |
| 402 | "upstream-netbsd/lib/libc/stdlib/lrand48.c", |
| 403 | "upstream-netbsd/lib/libc/stdlib/mrand48.c", |
| 404 | "upstream-netbsd/lib/libc/stdlib/nrand48.c", |
| 405 | "upstream-netbsd/lib/libc/stdlib/_rand48.c", |
| 406 | "upstream-netbsd/lib/libc/stdlib/rand_r.c", |
| 407 | "upstream-netbsd/lib/libc/stdlib/reallocarr.c", |
| 408 | "upstream-netbsd/lib/libc/stdlib/seed48.c", |
| 409 | "upstream-netbsd/lib/libc/stdlib/srand48.c", |
| 410 | "upstream-netbsd/lib/libc/string/memccpy.c", |
| 411 | "upstream-netbsd/lib/libc/string/strcasestr.c", |
| 412 | "upstream-netbsd/lib/libc/string/strcoll.c", |
| 413 | "upstream-netbsd/lib/libc/string/strxfrm.c", |
| 414 | ], |
| 415 | multilib: { |
| 416 | lib32: { |
| 417 | // LP32 cruft |
| 418 | srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"], |
| 419 | }, |
| 420 | }, |
| 421 | cflags: libc_common_cflags + [ |
| 422 | "-Wno-sign-compare", |
| 423 | "-Wno-uninitialized", |
| 424 | "-DPOSIX_MISTAKE", |
| 425 | "-include netbsd-compat.h", |
| 426 | ], |
| 427 | |
| 428 | conlyflags: libc_common_conlyflags, |
| 429 | cppflags: libc_common_cppflags, |
| 430 | product_variables: libc_common_product_variables, |
| 431 | local_include_dirs: [ |
| 432 | "upstream-netbsd/android/include", |
| 433 | "upstream-netbsd/lib/libc/include", |
| 434 | ], |
| 435 | |
| 436 | name: "libc_netbsd", |
| 437 | |
| 438 | stl: "none", |
| 439 | system_shared_libs: [], |
| 440 | sanitize: ["never"], |
| 441 | native_coverage: bionic_coverage, |
| 442 | |
| 443 | arch: { |
| 444 | x86_64: { |
| 445 | clang: use_clang_x86_64, |
| 446 | }, |
| 447 | }, |
| 448 | } |
| 449 | |
| 450 | // ======================================================== |
| 451 | // libc_openbsd_ndk.a - upstream OpenBSD C library code |
| 452 | // that can be safely included in the libc_ndk.a (doesn't |
| 453 | // contain any troublesome global data or constructors). |
| 454 | // ======================================================== |
| 455 | // |
| 456 | // These files are built with the openbsd-compat.h header file |
| 457 | // automatically included. |
| 458 | |
| 459 | cc_library_static { |
| 460 | name: "libc_openbsd_ndk", |
| 461 | srcs: [ |
| 462 | "upstream-openbsd/lib/libc/compat-43/killpg.c", |
| 463 | "upstream-openbsd/lib/libc/gen/alarm.c", |
| 464 | "upstream-openbsd/lib/libc/gen/ctype_.c", |
| 465 | "upstream-openbsd/lib/libc/gen/daemon.c", |
| 466 | "upstream-openbsd/lib/libc/gen/err.c", |
| 467 | "upstream-openbsd/lib/libc/gen/errx.c", |
| 468 | "upstream-openbsd/lib/libc/gen/exec.c", |
| 469 | "upstream-openbsd/lib/libc/gen/fnmatch.c", |
| 470 | "upstream-openbsd/lib/libc/gen/ftok.c", |
| 471 | "upstream-openbsd/lib/libc/gen/getprogname.c", |
| 472 | "upstream-openbsd/lib/libc/gen/isctype.c", |
| 473 | "upstream-openbsd/lib/libc/gen/setprogname.c", |
| 474 | "upstream-openbsd/lib/libc/gen/time.c", |
| 475 | "upstream-openbsd/lib/libc/gen/tolower_.c", |
| 476 | "upstream-openbsd/lib/libc/gen/toupper_.c", |
| 477 | "upstream-openbsd/lib/libc/gen/verr.c", |
| 478 | "upstream-openbsd/lib/libc/gen/verrx.c", |
| 479 | "upstream-openbsd/lib/libc/gen/vwarn.c", |
| 480 | "upstream-openbsd/lib/libc/gen/vwarnx.c", |
| 481 | "upstream-openbsd/lib/libc/gen/warn.c", |
| 482 | "upstream-openbsd/lib/libc/gen/warnx.c", |
| 483 | "upstream-openbsd/lib/libc/locale/btowc.c", |
| 484 | "upstream-openbsd/lib/libc/locale/mbrlen.c", |
| 485 | "upstream-openbsd/lib/libc/locale/mbstowcs.c", |
| 486 | "upstream-openbsd/lib/libc/locale/mbtowc.c", |
| 487 | "upstream-openbsd/lib/libc/locale/wcscoll.c", |
| 488 | "upstream-openbsd/lib/libc/locale/wcstod.c", |
| 489 | "upstream-openbsd/lib/libc/locale/wcstof.c", |
| 490 | "upstream-openbsd/lib/libc/locale/wcstoimax.c", |
| 491 | "upstream-openbsd/lib/libc/locale/wcstol.c", |
| 492 | "upstream-openbsd/lib/libc/locale/wcstold.c", |
| 493 | "upstream-openbsd/lib/libc/locale/wcstoll.c", |
| 494 | "upstream-openbsd/lib/libc/locale/wcstombs.c", |
| 495 | "upstream-openbsd/lib/libc/locale/wcstoul.c", |
| 496 | "upstream-openbsd/lib/libc/locale/wcstoull.c", |
| 497 | "upstream-openbsd/lib/libc/locale/wcstoumax.c", |
| 498 | "upstream-openbsd/lib/libc/locale/wcsxfrm.c", |
| 499 | "upstream-openbsd/lib/libc/locale/wctob.c", |
| 500 | "upstream-openbsd/lib/libc/locale/wctomb.c", |
| 501 | "upstream-openbsd/lib/libc/net/htonl.c", |
| 502 | "upstream-openbsd/lib/libc/net/htons.c", |
| 503 | "upstream-openbsd/lib/libc/net/inet_addr.c", |
| 504 | "upstream-openbsd/lib/libc/net/inet_lnaof.c", |
| 505 | "upstream-openbsd/lib/libc/net/inet_makeaddr.c", |
| 506 | "upstream-openbsd/lib/libc/net/inet_netof.c", |
| 507 | "upstream-openbsd/lib/libc/net/inet_network.c", |
| 508 | "upstream-openbsd/lib/libc/net/inet_ntoa.c", |
| 509 | "upstream-openbsd/lib/libc/net/inet_ntop.c", |
| 510 | "upstream-openbsd/lib/libc/net/inet_pton.c", |
| 511 | "upstream-openbsd/lib/libc/net/ntohl.c", |
| 512 | "upstream-openbsd/lib/libc/net/ntohs.c", |
| 513 | "upstream-openbsd/lib/libc/stdio/asprintf.c", |
| 514 | "upstream-openbsd/lib/libc/stdio/clrerr.c", |
| 515 | "upstream-openbsd/lib/libc/stdio/dprintf.c", |
| 516 | "upstream-openbsd/lib/libc/stdio/fclose.c", |
| 517 | "upstream-openbsd/lib/libc/stdio/fdopen.c", |
| 518 | "upstream-openbsd/lib/libc/stdio/feof.c", |
| 519 | "upstream-openbsd/lib/libc/stdio/ferror.c", |
| 520 | "upstream-openbsd/lib/libc/stdio/fflush.c", |
| 521 | "upstream-openbsd/lib/libc/stdio/fgetc.c", |
| 522 | "upstream-openbsd/lib/libc/stdio/fgetln.c", |
| 523 | "upstream-openbsd/lib/libc/stdio/fgetpos.c", |
| 524 | "upstream-openbsd/lib/libc/stdio/fgets.c", |
| 525 | "upstream-openbsd/lib/libc/stdio/fgetwc.c", |
| 526 | "upstream-openbsd/lib/libc/stdio/fgetws.c", |
| 527 | "upstream-openbsd/lib/libc/stdio/fileno.c", |
| 528 | "upstream-openbsd/lib/libc/stdio/flags.c", |
| 529 | "upstream-openbsd/lib/libc/stdio/fmemopen.c", |
| 530 | "upstream-openbsd/lib/libc/stdio/fopen.c", |
| 531 | "upstream-openbsd/lib/libc/stdio/fprintf.c", |
| 532 | "upstream-openbsd/lib/libc/stdio/fpurge.c", |
| 533 | "upstream-openbsd/lib/libc/stdio/fputc.c", |
| 534 | "upstream-openbsd/lib/libc/stdio/fputs.c", |
| 535 | "upstream-openbsd/lib/libc/stdio/fputwc.c", |
| 536 | "upstream-openbsd/lib/libc/stdio/fputws.c", |
| 537 | "upstream-openbsd/lib/libc/stdio/freopen.c", |
| 538 | "upstream-openbsd/lib/libc/stdio/fscanf.c", |
| 539 | "upstream-openbsd/lib/libc/stdio/fseek.c", |
| 540 | "upstream-openbsd/lib/libc/stdio/fsetpos.c", |
| 541 | "upstream-openbsd/lib/libc/stdio/ftell.c", |
| 542 | "upstream-openbsd/lib/libc/stdio/funopen.c", |
| 543 | "upstream-openbsd/lib/libc/stdio/fvwrite.c", |
| 544 | "upstream-openbsd/lib/libc/stdio/fwalk.c", |
| 545 | "upstream-openbsd/lib/libc/stdio/fwide.c", |
| 546 | "upstream-openbsd/lib/libc/stdio/fwprintf.c", |
| 547 | "upstream-openbsd/lib/libc/stdio/fwrite.c", |
| 548 | "upstream-openbsd/lib/libc/stdio/fwscanf.c", |
| 549 | "upstream-openbsd/lib/libc/stdio/getc.c", |
| 550 | "upstream-openbsd/lib/libc/stdio/getchar.c", |
| 551 | "upstream-openbsd/lib/libc/stdio/getdelim.c", |
| 552 | "upstream-openbsd/lib/libc/stdio/getline.c", |
| 553 | "upstream-openbsd/lib/libc/stdio/gets.c", |
| 554 | "upstream-openbsd/lib/libc/stdio/getwc.c", |
| 555 | "upstream-openbsd/lib/libc/stdio/getwchar.c", |
| 556 | "upstream-openbsd/lib/libc/stdio/makebuf.c", |
| 557 | "upstream-openbsd/lib/libc/stdio/mktemp.c", |
| 558 | "upstream-openbsd/lib/libc/stdio/open_memstream.c", |
| 559 | "upstream-openbsd/lib/libc/stdio/open_wmemstream.c", |
| 560 | "upstream-openbsd/lib/libc/stdio/perror.c", |
| 561 | "upstream-openbsd/lib/libc/stdio/printf.c", |
| 562 | "upstream-openbsd/lib/libc/stdio/putc.c", |
| 563 | "upstream-openbsd/lib/libc/stdio/putchar.c", |
| 564 | "upstream-openbsd/lib/libc/stdio/puts.c", |
| 565 | "upstream-openbsd/lib/libc/stdio/putwc.c", |
| 566 | "upstream-openbsd/lib/libc/stdio/putwchar.c", |
| 567 | "upstream-openbsd/lib/libc/stdio/refill.c", |
| 568 | "upstream-openbsd/lib/libc/stdio/remove.c", |
| 569 | "upstream-openbsd/lib/libc/stdio/rewind.c", |
| 570 | "upstream-openbsd/lib/libc/stdio/rget.c", |
| 571 | "upstream-openbsd/lib/libc/stdio/scanf.c", |
| 572 | "upstream-openbsd/lib/libc/stdio/setbuf.c", |
| 573 | "upstream-openbsd/lib/libc/stdio/setbuffer.c", |
| 574 | "upstream-openbsd/lib/libc/stdio/setvbuf.c", |
| 575 | "upstream-openbsd/lib/libc/stdio/sscanf.c", |
| 576 | "upstream-openbsd/lib/libc/stdio/swprintf.c", |
| 577 | "upstream-openbsd/lib/libc/stdio/swscanf.c", |
| 578 | "upstream-openbsd/lib/libc/stdio/tempnam.c", |
| 579 | "upstream-openbsd/lib/libc/stdio/tmpnam.c", |
| 580 | "upstream-openbsd/lib/libc/stdio/ungetc.c", |
| 581 | "upstream-openbsd/lib/libc/stdio/ungetwc.c", |
| 582 | "upstream-openbsd/lib/libc/stdio/vasprintf.c", |
| 583 | "upstream-openbsd/lib/libc/stdio/vdprintf.c", |
| 584 | "upstream-openbsd/lib/libc/stdio/vfprintf.c", |
| 585 | "upstream-openbsd/lib/libc/stdio/vfscanf.c", |
| 586 | "upstream-openbsd/lib/libc/stdio/vfwprintf.c", |
| 587 | "upstream-openbsd/lib/libc/stdio/vfwscanf.c", |
| 588 | "upstream-openbsd/lib/libc/stdio/vprintf.c", |
| 589 | "upstream-openbsd/lib/libc/stdio/vscanf.c", |
| 590 | "upstream-openbsd/lib/libc/stdio/vsnprintf.c", |
| 591 | "upstream-openbsd/lib/libc/stdio/vsprintf.c", |
| 592 | "upstream-openbsd/lib/libc/stdio/vsscanf.c", |
| 593 | "upstream-openbsd/lib/libc/stdio/vswprintf.c", |
| 594 | "upstream-openbsd/lib/libc/stdio/vswscanf.c", |
| 595 | "upstream-openbsd/lib/libc/stdio/vwprintf.c", |
| 596 | "upstream-openbsd/lib/libc/stdio/vwscanf.c", |
| 597 | "upstream-openbsd/lib/libc/stdio/wbuf.c", |
| 598 | "upstream-openbsd/lib/libc/stdio/wprintf.c", |
| 599 | "upstream-openbsd/lib/libc/stdio/wscanf.c", |
| 600 | "upstream-openbsd/lib/libc/stdio/wsetup.c", |
| 601 | "upstream-openbsd/lib/libc/stdlib/abs.c", |
| 602 | "upstream-openbsd/lib/libc/stdlib/atoi.c", |
| 603 | "upstream-openbsd/lib/libc/stdlib/atol.c", |
| 604 | "upstream-openbsd/lib/libc/stdlib/atoll.c", |
| 605 | "upstream-openbsd/lib/libc/stdlib/getenv.c", |
| 606 | "upstream-openbsd/lib/libc/stdlib/insque.c", |
| 607 | "upstream-openbsd/lib/libc/stdlib/imaxabs.c", |
| 608 | "upstream-openbsd/lib/libc/stdlib/imaxdiv.c", |
| 609 | "upstream-openbsd/lib/libc/stdlib/labs.c", |
| 610 | "upstream-openbsd/lib/libc/stdlib/llabs.c", |
| 611 | "upstream-openbsd/lib/libc/stdlib/lsearch.c", |
| 612 | "upstream-openbsd/lib/libc/stdlib/reallocarray.c", |
| 613 | "upstream-openbsd/lib/libc/stdlib/remque.c", |
| 614 | "upstream-openbsd/lib/libc/stdlib/setenv.c", |
| 615 | "upstream-openbsd/lib/libc/stdlib/strtoimax.c", |
| 616 | "upstream-openbsd/lib/libc/stdlib/strtol.c", |
| 617 | "upstream-openbsd/lib/libc/stdlib/strtoll.c", |
| 618 | "upstream-openbsd/lib/libc/stdlib/strtoul.c", |
| 619 | "upstream-openbsd/lib/libc/stdlib/strtoull.c", |
| 620 | "upstream-openbsd/lib/libc/stdlib/strtoumax.c", |
| 621 | "upstream-openbsd/lib/libc/stdlib/system.c", |
| 622 | "upstream-openbsd/lib/libc/stdlib/tfind.c", |
| 623 | "upstream-openbsd/lib/libc/stdlib/tsearch.c", |
| 624 | "upstream-openbsd/lib/libc/string/strcasecmp.c", |
| 625 | "upstream-openbsd/lib/libc/string/strcspn.c", |
| 626 | "upstream-openbsd/lib/libc/string/strdup.c", |
| 627 | "upstream-openbsd/lib/libc/string/strndup.c", |
| 628 | "upstream-openbsd/lib/libc/string/strpbrk.c", |
| 629 | "upstream-openbsd/lib/libc/string/strsep.c", |
| 630 | "upstream-openbsd/lib/libc/string/strspn.c", |
| 631 | "upstream-openbsd/lib/libc/string/strstr.c", |
| 632 | "upstream-openbsd/lib/libc/string/strtok.c", |
| 633 | "upstream-openbsd/lib/libc/string/wmemcpy.c", |
| 634 | "upstream-openbsd/lib/libc/string/wcslcpy.c", |
| 635 | "upstream-openbsd/lib/libc/string/wcsstr.c", |
| 636 | "upstream-openbsd/lib/libc/string/wcswidth.c", |
| 637 | ], |
| 638 | |
| 639 | cflags: libc_common_cflags + [ |
| 640 | "-Wno-sign-compare", |
| 641 | "-Wno-uninitialized", |
| 642 | "-Wno-unused-parameter", |
| 643 | "-include openbsd-compat.h", |
| 644 | ], |
| 645 | |
| 646 | conlyflags: libc_common_conlyflags, |
| 647 | cppflags: libc_common_cppflags, |
| 648 | product_variables: libc_common_product_variables, |
| 649 | local_include_dirs: [ |
| 650 | "private", |
| 651 | "stdio", |
| 652 | "upstream-openbsd/android/include", |
| 653 | "upstream-openbsd/lib/libc/include", |
| 654 | "upstream-openbsd/lib/libc/gdtoa/", |
| 655 | ], |
| 656 | |
| 657 | stl: "none", |
| 658 | system_shared_libs: [], |
| 659 | sanitize: ["never"], |
| 660 | native_coverage: bionic_coverage, |
| 661 | |
| 662 | arch: { |
| 663 | x86_64: { |
| 664 | clang: use_clang_x86_64, |
| 665 | }, |
| 666 | }, |
| 667 | } |
| 668 | |
| 669 | // ======================================================== |
| 670 | // libc_openbsd.a - upstream OpenBSD C library code |
| 671 | // ======================================================== |
| 672 | // |
| 673 | // These files are built with the openbsd-compat.h header file |
| 674 | // automatically included. |
| 675 | cc_library_static { |
| 676 | srcs: [ |
Dan Willemsen | 35e91a1 | 2015-09-17 15:28:45 -0700 | [diff] [blame] | 677 | // These two depend on getentropy_linux.c, which isn't in libc_ndk.a. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 678 | "upstream-openbsd/lib/libc/crypt/arc4random.c", |
| 679 | "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c", |
| 680 | |
| 681 | // May be overriden by per-arch optimized versions |
| 682 | "upstream-openbsd/lib/libc/string/memchr.c", |
| 683 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 684 | "upstream-openbsd/lib/libc/string/memrchr.c", |
| 685 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 686 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 687 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 688 | "upstream-openbsd/lib/libc/string/strcmp.c", |
| 689 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 690 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 691 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 692 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 693 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 694 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 695 | ], |
| 696 | multilib: { |
| 697 | lib32: { |
| 698 | // LP32 cruft |
| 699 | srcs: ["upstream-openbsd/lib/libc/stdio/putw.c"], |
| 700 | }, |
| 701 | }, |
| 702 | |
| 703 | arch: { |
| 704 | arm: { |
| 705 | exclude_srcs: [ |
| 706 | "upstream-openbsd/lib/libc/string/strcmp.c", |
| 707 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 708 | ], |
| 709 | }, |
| 710 | cortex_a7: { |
| 711 | exclude_srcs: [ |
| 712 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 713 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 714 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 715 | ], |
| 716 | }, |
| 717 | cortex_a53: { |
| 718 | exclude_srcs: [ |
| 719 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 720 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 721 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 722 | ], |
| 723 | }, |
| 724 | cortex_a8: { |
| 725 | exclude_srcs: [ |
| 726 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 727 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 728 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 729 | ], |
| 730 | }, |
| 731 | cortex_a9: { |
| 732 | exclude_srcs: [ |
| 733 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 734 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 735 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 736 | ], |
| 737 | }, |
| 738 | cortex_a15: { |
| 739 | exclude_srcs: [ |
| 740 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 741 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 742 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 743 | ], |
| 744 | }, |
| 745 | denver: { |
| 746 | exclude_srcs: [ |
| 747 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 748 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 749 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 750 | ], |
| 751 | }, |
| 752 | krait: { |
| 753 | exclude_srcs: [ |
| 754 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 755 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 756 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 757 | ], |
| 758 | }, |
| 759 | |
| 760 | arm64: { |
| 761 | exclude_srcs: [ |
| 762 | "upstream-openbsd/lib/libc/string/memchr.c", |
| 763 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 764 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 765 | "upstream-openbsd/lib/libc/string/strcmp.c", |
| 766 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 767 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 768 | ], |
| 769 | }, |
| 770 | |
| 771 | mips: { |
| 772 | exclude_srcs: [ |
| 773 | "upstream-openbsd/lib/libc/string/strcmp.c", |
| 774 | ], |
| 775 | }, |
| 776 | |
| 777 | mips64: { |
| 778 | exclude_srcs: [ |
| 779 | "upstream-openbsd/lib/libc/string/strcmp.c", |
| 780 | ], |
| 781 | }, |
| 782 | |
| 783 | x86: { |
| 784 | exclude_srcs: [ |
| 785 | "upstream-openbsd/lib/libc/string/memchr.c", |
| 786 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 787 | "upstream-openbsd/lib/libc/string/memrchr.c", |
| 788 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 789 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 790 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 791 | "upstream-openbsd/lib/libc/string/strcmp.c", |
| 792 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 793 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 794 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 795 | ], |
| 796 | }, |
| 797 | x86_sse3: { |
| 798 | exclude_srcs: [ |
| 799 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 800 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 801 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 802 | ], |
| 803 | }, |
| 804 | |
| 805 | x86_64: { |
| 806 | exclude_srcs: [ |
| 807 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 808 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 809 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 810 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 811 | "upstream-openbsd/lib/libc/string/strcmp.c", |
| 812 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 813 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 814 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 815 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 816 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 817 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 818 | ], |
| 819 | clang: use_clang_x86_64, |
| 820 | }, |
| 821 | }, |
| 822 | |
| 823 | cflags: libc_common_cflags + [ |
| 824 | "-Wno-sign-compare", |
| 825 | "-Wno-uninitialized", |
| 826 | "-Wno-unused-parameter", |
| 827 | "-include openbsd-compat.h", |
| 828 | ], |
| 829 | |
| 830 | conlyflags: libc_common_conlyflags, |
| 831 | cppflags: libc_common_cppflags, |
| 832 | product_variables: libc_common_product_variables, |
| 833 | local_include_dirs: [ |
| 834 | "private", |
| 835 | "stdio", |
| 836 | "upstream-openbsd/android/include", |
| 837 | "upstream-openbsd/lib/libc/include", |
| 838 | "upstream-openbsd/lib/libc/gdtoa/", |
| 839 | ], |
| 840 | |
| 841 | name: "libc_openbsd", |
| 842 | |
| 843 | stl: "none", |
| 844 | system_shared_libs: [], |
| 845 | sanitize: ["never"], |
| 846 | native_coverage: bionic_coverage, |
| 847 | |
| 848 | } |
| 849 | |
| 850 | // ======================================================== |
| 851 | // libc_gdtoa.a - upstream OpenBSD C library gdtoa code |
| 852 | // ======================================================== |
| 853 | // |
| 854 | // These files are built with the openbsd-compat.h header file |
| 855 | // automatically included. |
| 856 | |
| 857 | cc_library_static { |
| 858 | srcs: [ |
| 859 | "upstream-openbsd/android/gdtoa_support.cpp", |
| 860 | "upstream-openbsd/lib/libc/gdtoa/dmisc.c", |
| 861 | "upstream-openbsd/lib/libc/gdtoa/dtoa.c", |
| 862 | "upstream-openbsd/lib/libc/gdtoa/gdtoa.c", |
| 863 | "upstream-openbsd/lib/libc/gdtoa/gethex.c", |
| 864 | "upstream-openbsd/lib/libc/gdtoa/gmisc.c", |
| 865 | "upstream-openbsd/lib/libc/gdtoa/hd_init.c", |
| 866 | "upstream-openbsd/lib/libc/gdtoa/hdtoa.c", |
| 867 | "upstream-openbsd/lib/libc/gdtoa/hexnan.c", |
| 868 | "upstream-openbsd/lib/libc/gdtoa/ldtoa.c", |
| 869 | "upstream-openbsd/lib/libc/gdtoa/misc.c", |
| 870 | "upstream-openbsd/lib/libc/gdtoa/smisc.c", |
| 871 | "upstream-openbsd/lib/libc/gdtoa/strtod.c", |
| 872 | "upstream-openbsd/lib/libc/gdtoa/strtodg.c", |
| 873 | "upstream-openbsd/lib/libc/gdtoa/strtof.c", |
| 874 | "upstream-openbsd/lib/libc/gdtoa/strtord.c", |
| 875 | "upstream-openbsd/lib/libc/gdtoa/sum.c", |
| 876 | "upstream-openbsd/lib/libc/gdtoa/ulp.c", |
| 877 | ], |
| 878 | multilib: { |
| 879 | lib64: { |
| 880 | srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"] |
| 881 | }, |
| 882 | }, |
| 883 | |
| 884 | cflags: libc_common_cflags + [ |
| 885 | "-Wno-sign-compare", |
| 886 | "-Wno-uninitialized", |
| 887 | "-fvisibility=hidden", |
| 888 | "-include openbsd-compat.h", |
| 889 | ], |
| 890 | |
| 891 | conlyflags: libc_common_conlyflags, |
| 892 | cppflags: libc_common_cppflags, |
| 893 | product_variables: libc_common_product_variables, |
| 894 | local_include_dirs: [ |
| 895 | "private", |
| 896 | "upstream-openbsd/android/include", |
| 897 | "upstream-openbsd/lib/libc/include", |
| 898 | ], |
| 899 | |
| 900 | name: "libc_gdtoa", |
| 901 | |
| 902 | stl: "none", |
| 903 | system_shared_libs: [], |
| 904 | sanitize: ["never"], |
| 905 | native_coverage: bionic_coverage, |
| 906 | |
| 907 | arch: { |
| 908 | x86_64: { |
| 909 | clang: use_clang_x86_64, |
| 910 | }, |
| 911 | }, |
| 912 | } |
| 913 | |
| 914 | // ======================================================== |
| 915 | // libc_bionic.a - home-grown C library code |
| 916 | // ======================================================== |
| 917 | |
| 918 | cc_library_static { |
| 919 | srcs: [ |
| 920 | // The fork implementation depends on pthread data, so we can't include |
| 921 | // it in libc_ndk.a. |
| 922 | "bionic/fork.cpp", |
| 923 | |
| 924 | // The data that backs getauxval is initialized in the libc init |
| 925 | // functions which are invoked by the linker. If this file is included |
| 926 | // in libc_ndk.a, only one of the copies of the global data will be |
| 927 | // initialized, resulting in nullptr dereferences. |
| 928 | "bionic/getauxval.cpp", |
| 929 | |
Dan Willemsen | 35e91a1 | 2015-09-17 15:28:45 -0700 | [diff] [blame] | 930 | // These four require getauxval, which isn't available on older |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 931 | // platforms. |
| 932 | "bionic/getentropy_linux.c", |
| 933 | "bionic/sysconf.cpp", |
| 934 | "bionic/vdso.cpp", |
Dan Willemsen | 35e91a1 | 2015-09-17 15:28:45 -0700 | [diff] [blame] | 935 | "bionic/setjmp_cookie.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 936 | ], |
| 937 | cflags: libc_common_cflags + ["-Wframe-larger-than=2048"], |
| 938 | |
| 939 | arch: { |
| 940 | x86_64: { |
| 941 | clang: use_clang_x86_64, |
| 942 | }, |
| 943 | }, |
| 944 | |
| 945 | conlyflags: libc_common_conlyflags, |
| 946 | cppflags: libc_common_cppflags + ["-Wold-style-cast"], |
| 947 | product_variables: libc_common_product_variables, |
| 948 | include_dirs: ["bionic/libstdc++/include"], |
| 949 | name: "libc_bionic", |
| 950 | |
| 951 | stl: "none", |
| 952 | system_shared_libs: [], |
| 953 | sanitize: ["never"], |
| 954 | native_coverage: bionic_coverage, |
| 955 | |
| 956 | } |
| 957 | |
| 958 | // ======================================================== |
| 959 | // libc_bionic_ndk.a- The portions of libc_bionic that can |
| 960 | // be safely used in libc_ndk.a (no troublesome global data |
| 961 | // or constructors). |
| 962 | // ======================================================== |
| 963 | cc_library_static { |
| 964 | srcs: [ |
| 965 | "bionic/abort.cpp", |
| 966 | "bionic/accept.cpp", |
| 967 | "bionic/accept4.cpp", |
| 968 | "bionic/access.cpp", |
| 969 | "bionic/assert.cpp", |
| 970 | "bionic/atof.cpp", |
| 971 | "bionic/bionic_systrace.cpp", |
| 972 | "bionic/bionic_time_conversions.cpp", |
| 973 | "bionic/brk.cpp", |
| 974 | "bionic/c16rtomb.cpp", |
| 975 | "bionic/c32rtomb.cpp", |
| 976 | "bionic/chmod.cpp", |
| 977 | "bionic/chown.cpp", |
| 978 | "bionic/clearenv.cpp", |
| 979 | "bionic/clock.cpp", |
| 980 | "bionic/clock_getcpuclockid.cpp", |
| 981 | "bionic/clock_nanosleep.cpp", |
| 982 | "bionic/clone.cpp", |
| 983 | "bionic/close.cpp", |
| 984 | "bionic/__cmsg_nxthdr.cpp", |
| 985 | "bionic/connect.cpp", |
| 986 | "bionic/ctype.cpp", |
| 987 | "bionic/dirent.cpp", |
| 988 | "bionic/dup2.cpp", |
| 989 | "bionic/epoll_create.cpp", |
| 990 | "bionic/epoll_pwait.cpp", |
| 991 | "bionic/epoll_wait.cpp", |
| 992 | "bionic/__errno.cpp", |
| 993 | "bionic/error.cpp", |
| 994 | "bionic/eventfd_read.cpp", |
| 995 | "bionic/eventfd_write.cpp", |
| 996 | "bionic/faccessat.cpp", |
| 997 | "bionic/fchmod.cpp", |
| 998 | "bionic/fchmodat.cpp", |
| 999 | "bionic/ffs.cpp", |
| 1000 | "bionic/fgetxattr.cpp", |
| 1001 | "bionic/flistxattr.cpp", |
| 1002 | "bionic/flockfile.cpp", |
| 1003 | "bionic/fpclassify.cpp", |
| 1004 | "bionic/fsetxattr.cpp", |
| 1005 | "bionic/ftruncate.cpp", |
| 1006 | "bionic/futimens.cpp", |
| 1007 | "bionic/getcwd.cpp", |
| 1008 | "bionic/gethostname.cpp", |
| 1009 | "bionic/getpgrp.cpp", |
| 1010 | "bionic/getpid.cpp", |
| 1011 | "bionic/gettid.cpp", |
| 1012 | "bionic/__gnu_basename.cpp", |
| 1013 | "bionic/inotify_init.cpp", |
| 1014 | "bionic/lchown.cpp", |
| 1015 | "bionic/lfs64_support.cpp", |
| 1016 | "bionic/__libc_current_sigrtmax.cpp", |
| 1017 | "bionic/__libc_current_sigrtmin.cpp", |
| 1018 | "bionic/libc_init_common.cpp", |
| 1019 | "bionic/libc_logging.cpp", |
| 1020 | "bionic/libgen.cpp", |
| 1021 | "bionic/link.cpp", |
| 1022 | "bionic/locale.cpp", |
| 1023 | "bionic/lstat.cpp", |
| 1024 | "bionic/malloc_info.cpp", |
| 1025 | "bionic/mbrtoc16.cpp", |
| 1026 | "bionic/mbrtoc32.cpp", |
| 1027 | "bionic/mbstate.cpp", |
| 1028 | "bionic/mempcpy.cpp", |
| 1029 | "bionic/mkdir.cpp", |
| 1030 | "bionic/mkfifo.cpp", |
| 1031 | "bionic/mknod.cpp", |
| 1032 | "bionic/mntent.cpp", |
| 1033 | "bionic/NetdClientDispatch.cpp", |
| 1034 | "bionic/open.cpp", |
| 1035 | "bionic/pathconf.cpp", |
| 1036 | "bionic/pause.cpp", |
| 1037 | "bionic/pipe.cpp", |
| 1038 | "bionic/poll.cpp", |
| 1039 | "bionic/posix_fadvise.cpp", |
| 1040 | "bionic/posix_fallocate.cpp", |
| 1041 | "bionic/posix_madvise.cpp", |
| 1042 | "bionic/posix_timers.cpp", |
| 1043 | "bionic/ptrace.cpp", |
| 1044 | "bionic/pty.cpp", |
| 1045 | "bionic/raise.cpp", |
| 1046 | "bionic/rand.cpp", |
| 1047 | "bionic/readlink.cpp", |
| 1048 | "bionic/reboot.cpp", |
| 1049 | "bionic/recv.cpp", |
| 1050 | "bionic/rename.cpp", |
| 1051 | "bionic/rmdir.cpp", |
| 1052 | "bionic/scandir.cpp", |
| 1053 | "bionic/sched_getaffinity.cpp", |
| 1054 | "bionic/sched_getcpu.cpp", |
| 1055 | "bionic/semaphore.cpp", |
| 1056 | "bionic/send.cpp", |
| 1057 | "bionic/setegid.cpp", |
| 1058 | "bionic/__set_errno.cpp", |
| 1059 | "bionic/seteuid.cpp", |
| 1060 | "bionic/setpgrp.cpp", |
| 1061 | "bionic/sigaction.cpp", |
| 1062 | "bionic/sigaddset.cpp", |
| 1063 | "bionic/sigdelset.cpp", |
| 1064 | "bionic/sigemptyset.cpp", |
| 1065 | "bionic/sigfillset.cpp", |
| 1066 | "bionic/sigismember.cpp", |
| 1067 | "bionic/signal.cpp", |
| 1068 | "bionic/signalfd.cpp", |
| 1069 | "bionic/sigpending.cpp", |
| 1070 | "bionic/sigprocmask.cpp", |
| 1071 | "bionic/sigqueue.cpp", |
| 1072 | "bionic/sigsuspend.cpp", |
| 1073 | "bionic/sigtimedwait.cpp", |
| 1074 | "bionic/sigwait.cpp", |
| 1075 | "bionic/sigwaitinfo.cpp", |
| 1076 | "bionic/socket.cpp", |
| 1077 | "bionic/stat.cpp", |
| 1078 | "bionic/statvfs.cpp", |
| 1079 | "bionic/strchrnul.cpp", |
| 1080 | "bionic/strerror.cpp", |
| 1081 | "bionic/strerror_r.cpp", |
| 1082 | "bionic/strsignal.cpp", |
| 1083 | "bionic/strtold.cpp", |
| 1084 | "bionic/stubs.cpp", |
| 1085 | "bionic/symlink.cpp", |
| 1086 | "bionic/sysinfo.cpp", |
| 1087 | "bionic/syslog.cpp", |
| 1088 | "bionic/sys_siglist.c", |
| 1089 | "bionic/sys_signame.c", |
| 1090 | "bionic/system_properties.cpp", |
| 1091 | "bionic/tdestroy.cpp", |
| 1092 | "bionic/termios.cpp", |
| 1093 | "bionic/thread_private.cpp", |
| 1094 | "bionic/tmpfile.cpp", |
| 1095 | "bionic/umount.cpp", |
| 1096 | "bionic/unlink.cpp", |
| 1097 | "bionic/utimes.cpp", |
| 1098 | "bionic/wait.cpp", |
| 1099 | "bionic/wchar.cpp", |
| 1100 | "bionic/wctype.cpp", |
| 1101 | "bionic/wmempcpy.cpp", |
| 1102 | |
| 1103 | // May be overriden by per-arch optimized versions |
| 1104 | "bionic/__memcpy_chk.cpp", |
| 1105 | "bionic/__memset_chk.cpp", |
| 1106 | "bionic/__strcat_chk.cpp", |
| 1107 | "bionic/__strcpy_chk.cpp", |
| 1108 | "bionic/strchr.cpp", |
| 1109 | "bionic/strnlen.c", |
| 1110 | "bionic/strrchr.cpp", |
| 1111 | ], |
| 1112 | cflags: libc_common_cflags + ["-Wframe-larger-than=2048"], |
| 1113 | |
| 1114 | arch: { |
| 1115 | |
| 1116 | arm: { |
| 1117 | srcs: [ |
| 1118 | "arch-arm/bionic/abort_arm.S", |
| 1119 | "arch-arm/bionic/atomics_arm.c", |
| 1120 | "arch-arm/bionic/__bionic_clone.S", |
| 1121 | "arch-arm/bionic/_exit_with_stack_teardown.S", |
| 1122 | "arch-arm/bionic/libgcc_compat.c", |
| 1123 | "arch-arm/bionic/popcount_tab.c", |
| 1124 | "arch-arm/bionic/__restore.S", |
| 1125 | "arch-arm/bionic/setjmp.S", |
| 1126 | "arch-arm/bionic/syscall.S", |
| 1127 | "arch-arm/bionic/vfork.S", |
| 1128 | |
| 1129 | "arch-arm/generic/bionic/memcmp.S", |
| 1130 | "arch-arm/generic/bionic/memcpy.S", |
| 1131 | "arch-arm/generic/bionic/memset.S", |
| 1132 | "arch-arm/generic/bionic/strcmp.S", |
| 1133 | "arch-arm/generic/bionic/strcpy.S", |
| 1134 | "arch-arm/generic/bionic/strlen.c", |
| 1135 | ], |
| 1136 | exclude_srcs: [ |
| 1137 | "bionic/__memcpy_chk.cpp", |
| 1138 | "bionic/__memset_chk.cpp", |
| 1139 | ], |
| 1140 | }, |
| 1141 | cortex_a7: { |
| 1142 | srcs: [ |
| 1143 | "arch-arm/cortex-a7/bionic/memset.S", |
| 1144 | |
| 1145 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 1146 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1147 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1148 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 1149 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 1150 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1151 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 1152 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1153 | |
| 1154 | "arch-arm/denver/bionic/memmove.S", |
| 1155 | ], |
| 1156 | exclude_srcs: [ |
| 1157 | "arch-arm/generic/bionic/memcpy.S", |
| 1158 | "arch-arm/generic/bionic/memset.S", |
| 1159 | "arch-arm/generic/bionic/strcmp.S", |
| 1160 | "arch-arm/generic/bionic/strcpy.S", |
| 1161 | "arch-arm/generic/bionic/strlen.c", |
| 1162 | "bionic/__strcat_chk.cpp", |
| 1163 | "bionic/__strcpy_chk.cpp", |
| 1164 | ], |
| 1165 | }, |
| 1166 | cortex_a53: { |
| 1167 | srcs: [ |
| 1168 | "arch-arm/cortex-a53/bionic/memcpy.S", |
| 1169 | "arch-arm/cortex-a53/bionic/__strcat_chk.S", |
| 1170 | "arch-arm/cortex-a53/bionic/__strcpy_chk.S", |
| 1171 | |
| 1172 | "arch-arm/cortex-a7/bionic/memset.S", |
| 1173 | |
| 1174 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1175 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1176 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 1177 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1178 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1179 | |
| 1180 | "arch-arm/denver/bionic/memmove.S", |
| 1181 | ], |
| 1182 | exclude_srcs: [ |
| 1183 | "arch-arm/generic/bionic/memcpy.S", |
| 1184 | "arch-arm/generic/bionic/memset.S", |
| 1185 | "arch-arm/generic/bionic/strcmp.S", |
| 1186 | "arch-arm/generic/bionic/strcpy.S", |
| 1187 | "arch-arm/generic/bionic/strlen.c", |
| 1188 | "bionic/__strcat_chk.cpp", |
| 1189 | "bionic/__strcpy_chk.cpp", |
| 1190 | ], |
| 1191 | }, |
| 1192 | cortex_a8: { |
| 1193 | srcs: [ |
| 1194 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 1195 | "arch-arm/cortex-a15/bionic/memset.S", |
| 1196 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1197 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1198 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 1199 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 1200 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1201 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 1202 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1203 | |
| 1204 | "arch-arm/denver/bionic/memmove.S", |
| 1205 | ], |
| 1206 | exclude_srcs: [ |
| 1207 | "arch-arm/generic/bionic/memcpy.S", |
| 1208 | "arch-arm/generic/bionic/memset.S", |
| 1209 | "arch-arm/generic/bionic/strcmp.S", |
| 1210 | "arch-arm/generic/bionic/strcpy.S", |
| 1211 | "arch-arm/generic/bionic/strlen.c", |
| 1212 | "bionic/__strcat_chk.cpp", |
| 1213 | "bionic/__strcpy_chk.cpp", |
| 1214 | ], |
| 1215 | }, |
| 1216 | cortex_a9: { |
| 1217 | srcs: [ |
| 1218 | "arch-arm/cortex-a9/bionic/memcpy.S", |
| 1219 | "arch-arm/cortex-a9/bionic/memset.S", |
| 1220 | "arch-arm/cortex-a9/bionic/stpcpy.S", |
| 1221 | "arch-arm/cortex-a9/bionic/strcat.S", |
| 1222 | "arch-arm/cortex-a9/bionic/__strcat_chk.S", |
| 1223 | "arch-arm/cortex-a9/bionic/strcmp.S", |
| 1224 | "arch-arm/cortex-a9/bionic/strcpy.S", |
| 1225 | "arch-arm/cortex-a9/bionic/__strcpy_chk.S", |
| 1226 | "arch-arm/cortex-a9/bionic/strlen.S", |
| 1227 | |
| 1228 | "arch-arm/denver/bionic/memmove.S", |
| 1229 | ], |
| 1230 | exclude_srcs: [ |
| 1231 | "arch-arm/generic/bionic/memcpy.S", |
| 1232 | "arch-arm/generic/bionic/memset.S", |
| 1233 | "arch-arm/generic/bionic/strcmp.S", |
| 1234 | "arch-arm/generic/bionic/strcpy.S", |
| 1235 | "arch-arm/generic/bionic/strlen.c", |
| 1236 | "bionic/__strcat_chk.cpp", |
| 1237 | "bionic/__strcpy_chk.cpp", |
| 1238 | ], |
| 1239 | }, |
| 1240 | cortex_a15: { |
| 1241 | srcs: [ |
| 1242 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 1243 | "arch-arm/cortex-a15/bionic/memset.S", |
| 1244 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1245 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1246 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 1247 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 1248 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1249 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 1250 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1251 | |
| 1252 | "arch-arm/denver/bionic/memmove.S", |
| 1253 | ], |
| 1254 | exclude_srcs: [ |
| 1255 | "arch-arm/generic/bionic/memcpy.S", |
| 1256 | "arch-arm/generic/bionic/memset.S", |
| 1257 | "arch-arm/generic/bionic/strcmp.S", |
| 1258 | "arch-arm/generic/bionic/strcpy.S", |
| 1259 | "arch-arm/generic/bionic/strlen.c", |
| 1260 | "bionic/__strcat_chk.cpp", |
| 1261 | "bionic/__strcpy_chk.cpp", |
| 1262 | ], |
| 1263 | }, |
| 1264 | denver: { |
| 1265 | srcs: [ |
| 1266 | "arch-arm/denver/bionic/memcpy.S", |
| 1267 | "arch-arm/denver/bionic/memmove.S", |
| 1268 | "arch-arm/denver/bionic/memset.S", |
| 1269 | "arch-arm/denver/bionic/__strcat_chk.S", |
| 1270 | "arch-arm/denver/bionic/__strcpy_chk.S", |
| 1271 | |
| 1272 | // Use cortex-a15 versions of strcat/strcpy/strlen. |
| 1273 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1274 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1275 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 1276 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1277 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1278 | ], |
| 1279 | exclude_srcs: [ |
| 1280 | "arch-arm/generic/bionic/memcpy.S", |
| 1281 | "arch-arm/generic/bionic/memset.S", |
| 1282 | "arch-arm/generic/bionic/strcmp.S", |
| 1283 | "arch-arm/generic/bionic/strcpy.S", |
| 1284 | "arch-arm/generic/bionic/strlen.c", |
| 1285 | "bionic/__strcat_chk.cpp", |
| 1286 | "bionic/__strcpy_chk.cpp", |
| 1287 | ], |
| 1288 | }, |
| 1289 | krait: { |
| 1290 | srcs: [ |
| 1291 | "arch-arm/krait/bionic/memcpy.S", |
| 1292 | "arch-arm/krait/bionic/memset.S", |
| 1293 | "arch-arm/krait/bionic/strcmp.S", |
| 1294 | "arch-arm/krait/bionic/__strcat_chk.S", |
| 1295 | "arch-arm/krait/bionic/__strcpy_chk.S", |
| 1296 | |
| 1297 | // Use cortex-a15 versions of strcat/strcpy/strlen. |
| 1298 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1299 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1300 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1301 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1302 | |
| 1303 | "arch-arm/denver/bionic/memmove.S", |
| 1304 | ], |
| 1305 | exclude_srcs: [ |
| 1306 | "arch-arm/generic/bionic/memcpy.S", |
| 1307 | "arch-arm/generic/bionic/memset.S", |
| 1308 | "arch-arm/generic/bionic/strcmp.S", |
| 1309 | "arch-arm/generic/bionic/strcpy.S", |
| 1310 | "arch-arm/generic/bionic/strlen.c", |
| 1311 | "bionic/__strcat_chk.cpp", |
| 1312 | "bionic/__strcpy_chk.cpp", |
| 1313 | ], |
| 1314 | }, |
| 1315 | |
| 1316 | arm64: { |
| 1317 | srcs: [ |
| 1318 | "arch-arm64/bionic/__bionic_clone.S", |
| 1319 | "arch-arm64/bionic/_exit_with_stack_teardown.S", |
| 1320 | "arch-arm64/bionic/setjmp.S", |
| 1321 | "arch-arm64/bionic/__set_tls.c", |
| 1322 | "arch-arm64/bionic/syscall.S", |
| 1323 | "arch-arm64/bionic/vfork.S", |
| 1324 | |
| 1325 | "arch-arm64/generic/bionic/memchr.S", |
| 1326 | "arch-arm64/generic/bionic/memcmp.S", |
| 1327 | "arch-arm64/generic/bionic/memcpy.S", |
| 1328 | "arch-arm64/generic/bionic/memmove.S", |
| 1329 | "arch-arm64/generic/bionic/memset.S", |
| 1330 | "arch-arm64/generic/bionic/stpcpy.S", |
| 1331 | "arch-arm64/generic/bionic/strchr.S", |
| 1332 | "arch-arm64/generic/bionic/strcmp.S", |
| 1333 | "arch-arm64/generic/bionic/strcpy.S", |
| 1334 | "arch-arm64/generic/bionic/strlen.S", |
| 1335 | "arch-arm64/generic/bionic/strncmp.S", |
| 1336 | "arch-arm64/generic/bionic/strnlen.S", |
| 1337 | "arch-arm64/generic/bionic/wmemmove.S", |
| 1338 | ], |
| 1339 | exclude_srcs: [ |
| 1340 | "bionic/__memcpy_chk.cpp", |
| 1341 | "bionic/strchr.cpp", |
| 1342 | "bionic/strnlen.c", |
| 1343 | ], |
| 1344 | }, |
| 1345 | denver64: { |
| 1346 | srcs: [ |
| 1347 | "arch-arm64/denver64/bionic/memcpy.S", |
| 1348 | "arch-arm64/denver64/bionic/memset.S", |
| 1349 | ], |
| 1350 | exclude_srcs: [ |
| 1351 | "arch-arm64/generic/bionic/memcpy.S", |
| 1352 | "arch-arm64/generic/bionic/memset.S", |
| 1353 | ], |
| 1354 | }, |
| 1355 | |
| 1356 | mips: { |
| 1357 | srcs: [ |
| 1358 | "arch-mips/bionic/__bionic_clone.S", |
| 1359 | "arch-mips/bionic/bzero.S", |
| 1360 | "arch-mips/bionic/cacheflush.cpp", |
| 1361 | "arch-mips/bionic/_exit_with_stack_teardown.S", |
| 1362 | "arch-mips/bionic/setjmp.S", |
| 1363 | "arch-mips/bionic/syscall.S", |
| 1364 | "arch-mips/bionic/vfork.S", |
| 1365 | |
| 1366 | "arch-mips/string/memcmp.c", |
| 1367 | "arch-mips/string/memcpy.S", |
| 1368 | "arch-mips/string/memset.S", |
| 1369 | "arch-mips/string/strcmp.S", |
| 1370 | "arch-mips/string/strlen.c", |
| 1371 | ], |
| 1372 | }, |
| 1373 | mips_rev6: { |
| 1374 | srcs: [ |
| 1375 | "arch-mips/string/mips_strlen.c" |
| 1376 | ], |
| 1377 | exclude_srcs: [ |
| 1378 | "arch-mips/string/strlen.c" |
| 1379 | ], |
| 1380 | }, |
| 1381 | |
| 1382 | mips64: { |
| 1383 | srcs: [ |
| 1384 | "arch-mips64/bionic/__bionic_clone.S", |
| 1385 | "arch-mips64/bionic/_exit_with_stack_teardown.S", |
| 1386 | "arch-mips64/bionic/setjmp.S", |
| 1387 | "arch-mips64/bionic/syscall.S", |
| 1388 | "arch-mips64/bionic/vfork.S", |
| 1389 | "arch-mips64/bionic/stat.cpp", |
| 1390 | |
| 1391 | "arch-mips/string/memcmp.c", |
| 1392 | "arch-mips/string/memcpy.S", |
| 1393 | "arch-mips/string/memset.S", |
| 1394 | "arch-mips/string/strcmp.S", |
| 1395 | "arch-mips/string/strlen.c", |
| 1396 | ], |
| 1397 | }, |
| 1398 | |
| 1399 | x86: { |
| 1400 | srcs: [ |
| 1401 | "arch-x86/bionic/__bionic_clone.S", |
| 1402 | "arch-x86/bionic/_exit_with_stack_teardown.S", |
| 1403 | "arch-x86/bionic/libgcc_compat.c", |
| 1404 | "arch-x86/bionic/__restore.S", |
| 1405 | "arch-x86/bionic/setjmp.S", |
| 1406 | "arch-x86/bionic/__set_tls.c", |
| 1407 | "arch-x86/bionic/syscall.S", |
| 1408 | "arch-x86/bionic/vfork.S", |
| 1409 | |
| 1410 | "arch-x86/generic/string/memcmp.S", |
| 1411 | "arch-x86/generic/string/strcmp.S", |
| 1412 | "arch-x86/generic/string/strncmp.S", |
| 1413 | "arch-x86/generic/string/strcat.S", |
| 1414 | "arch-x86/atom/string/sse2-memchr-atom.S", |
| 1415 | "arch-x86/atom/string/sse2-memrchr-atom.S", |
| 1416 | "arch-x86/atom/string/sse2-strchr-atom.S", |
| 1417 | "arch-x86/atom/string/sse2-strnlen-atom.S", |
| 1418 | "arch-x86/atom/string/sse2-strrchr-atom.S", |
| 1419 | "arch-x86/atom/string/sse2-wcschr-atom.S", |
| 1420 | "arch-x86/atom/string/sse2-wcsrchr-atom.S", |
| 1421 | "arch-x86/atom/string/sse2-wcslen-atom.S", |
| 1422 | "arch-x86/atom/string/sse2-wcscmp-atom.S", |
| 1423 | "arch-x86/silvermont/string/sse2-bcopy-slm.S", |
| 1424 | "arch-x86/silvermont/string/sse2-bzero-slm.S", |
| 1425 | "arch-x86/silvermont/string/sse2-memcpy-slm.S", |
| 1426 | "arch-x86/silvermont/string/sse2-memmove-slm.S", |
| 1427 | "arch-x86/silvermont/string/sse2-memset-slm.S", |
| 1428 | "arch-x86/silvermont/string/sse2-stpcpy-slm.S", |
| 1429 | "arch-x86/silvermont/string/sse2-stpncpy-slm.S", |
| 1430 | "arch-x86/silvermont/string/sse2-strcpy-slm.S", |
| 1431 | "arch-x86/silvermont/string/sse2-strlen-slm.S", |
| 1432 | "arch-x86/silvermont/string/sse2-strncpy-slm.S", |
| 1433 | ], |
| 1434 | }, |
| 1435 | x86_sse3: { |
| 1436 | srcs: [ |
| 1437 | "arch-x86/atom/string/ssse3-strncat-atom.S", |
| 1438 | "arch-x86/atom/string/ssse3-strlcat-atom.S", |
| 1439 | "arch-x86/atom/string/ssse3-strlcpy-atom.S", |
| 1440 | "arch-x86/atom/string/ssse3-strcmp-atom.S", |
| 1441 | "arch-x86/atom/string/ssse3-strncmp-atom.S", |
| 1442 | "arch-x86/atom/string/ssse3-strcat-atom.S", |
| 1443 | "arch-x86/atom/string/ssse3-wcscat-atom.S", |
| 1444 | "arch-x86/atom/string/ssse3-wcscpy-atom.S", |
| 1445 | ], |
| 1446 | exclude_srcs: [ |
| 1447 | "arch-x86/generic/string/strcmp.S", |
| 1448 | "arch-x86/generic/string/strncmp.S", |
| 1449 | "arch-x86/generic/string/strcat.S", |
| 1450 | ], |
| 1451 | }, |
| 1452 | x86_sse4: { |
| 1453 | srcs: [ |
| 1454 | "arch-x86/silvermont/string/sse4-memcmp-slm.S", |
| 1455 | "arch-x86/silvermont/string/sse4-wmemcmp-slm.S", |
| 1456 | ], |
| 1457 | exclude_srcs: [ |
| 1458 | "arch-x86/generic/string/memcmp.S", |
| 1459 | ], |
| 1460 | }, |
| 1461 | |
| 1462 | |
| 1463 | x86_64: { |
| 1464 | clang: use_clang_x86_64, |
| 1465 | srcs: [ |
| 1466 | "arch-x86_64/bionic/__bionic_clone.S", |
| 1467 | "arch-x86_64/bionic/_exit_with_stack_teardown.S", |
| 1468 | "arch-x86_64/bionic/__restore_rt.S", |
| 1469 | "arch-x86_64/bionic/setjmp.S", |
| 1470 | "arch-x86_64/bionic/__set_tls.c", |
| 1471 | "arch-x86_64/bionic/syscall.S", |
| 1472 | "arch-x86_64/bionic/vfork.S", |
| 1473 | |
| 1474 | "arch-x86_64/string/sse2-memcpy-slm.S", |
| 1475 | "arch-x86_64/string/sse2-memmove-slm.S", |
| 1476 | "arch-x86_64/string/sse2-memset-slm.S", |
| 1477 | "arch-x86_64/string/sse2-stpcpy-slm.S", |
| 1478 | "arch-x86_64/string/sse2-stpncpy-slm.S", |
| 1479 | "arch-x86_64/string/sse2-strcat-slm.S", |
| 1480 | "arch-x86_64/string/sse2-strcpy-slm.S", |
| 1481 | "arch-x86_64/string/sse2-strlcat-slm.S", |
| 1482 | "arch-x86_64/string/sse2-strlcpy-slm.S", |
| 1483 | "arch-x86_64/string/sse2-strlen-slm.S", |
| 1484 | "arch-x86_64/string/sse2-strncat-slm.S", |
| 1485 | "arch-x86_64/string/sse2-strncpy-slm.S", |
| 1486 | "arch-x86_64/string/sse4-memcmp-slm.S", |
| 1487 | "arch-x86_64/string/ssse3-strcmp-slm.S", |
| 1488 | "arch-x86_64/string/ssse3-strncmp-slm.S", |
| 1489 | ], |
| 1490 | }, |
| 1491 | |
| 1492 | }, |
| 1493 | multilib: { |
| 1494 | lib32: { |
| 1495 | // LP32 cruft |
| 1496 | srcs: ["bionic/mmap.cpp"] |
| 1497 | }, |
| 1498 | }, |
| 1499 | |
| 1500 | conlyflags: libc_common_conlyflags, |
| 1501 | cppflags: libc_common_cppflags + ["-Wold-style-cast"], |
| 1502 | product_variables: libc_common_product_variables, |
| 1503 | local_include_dirs: ["stdio"], |
| 1504 | include_dirs: ["bionic/libstdc++/include"], |
| 1505 | name: "libc_bionic_ndk", |
| 1506 | |
| 1507 | stl: "none", |
| 1508 | system_shared_libs: [], |
| 1509 | sanitize: ["never"], |
| 1510 | native_coverage: bionic_coverage, |
| 1511 | |
| 1512 | } |
| 1513 | |
| 1514 | cc_library_static { |
| 1515 | name: "libc_thread_atexit_impl", |
| 1516 | srcs: ["bionic/__cxa_thread_atexit_impl.cpp"], |
| 1517 | cflags: libc_common_cflags + ["-Wframe-larger-than=2048"], |
| 1518 | conlyflags: libc_common_conlyflags, |
| 1519 | cppflags: libc_common_cppflags + ["-Wold-style-cast"], |
| 1520 | product_variables: libc_common_product_variables, |
| 1521 | include_dirs: ["bionic/libstdc++/include"], |
| 1522 | // TODO: Clang tries to use __tls_get_addr which is not supported yet |
| 1523 | // remove after it is implemented. |
| 1524 | clang: false, |
| 1525 | stl: "none", |
| 1526 | system_shared_libs: [], |
| 1527 | sanitize: ["never"], |
| 1528 | native_coverage: bionic_coverage, |
| 1529 | } |
| 1530 | |
| 1531 | // ======================================================== |
| 1532 | // libc_pthread.a - pthreads parts that previously lived in |
| 1533 | // libc_bionic.a. Relocated to their own library because |
| 1534 | // they can't be included in libc_ndk.a (as they layout of |
| 1535 | // pthread_t has changed over the years and has ABI |
| 1536 | // compatibility issues). |
| 1537 | // ======================================================== |
| 1538 | |
| 1539 | cc_library_static { |
| 1540 | srcs: [ |
| 1541 | "bionic/pthread_atfork.cpp", |
| 1542 | "bionic/pthread_attr.cpp", |
| 1543 | "bionic/pthread_cond.cpp", |
| 1544 | "bionic/pthread_create.cpp", |
| 1545 | "bionic/pthread_detach.cpp", |
| 1546 | "bionic/pthread_equal.cpp", |
| 1547 | "bionic/pthread_exit.cpp", |
| 1548 | "bionic/pthread_getcpuclockid.cpp", |
| 1549 | "bionic/pthread_getschedparam.cpp", |
| 1550 | "bionic/pthread_gettid_np.cpp", |
| 1551 | "bionic/pthread_internal.cpp", |
| 1552 | "bionic/pthread_join.cpp", |
| 1553 | "bionic/pthread_key.cpp", |
| 1554 | "bionic/pthread_kill.cpp", |
| 1555 | "bionic/pthread_mutex.cpp", |
| 1556 | "bionic/pthread_once.cpp", |
| 1557 | "bionic/pthread_rwlock.cpp", |
| 1558 | "bionic/pthread_self.cpp", |
| 1559 | "bionic/pthread_setname_np.cpp", |
| 1560 | "bionic/pthread_setschedparam.cpp", |
| 1561 | "bionic/pthread_sigmask.cpp", |
| 1562 | ], |
| 1563 | cflags: libc_common_cflags + ["-Wframe-larger-than=2048"], |
| 1564 | |
| 1565 | arch: { |
| 1566 | x86_64: { |
| 1567 | clang: use_clang_x86_64, |
| 1568 | }, |
| 1569 | }, |
| 1570 | |
| 1571 | conlyflags: libc_common_conlyflags, |
| 1572 | cppflags: libc_common_cppflags + ["-Wold-style-cast"], |
| 1573 | product_variables: libc_common_product_variables, |
| 1574 | include_dirs: ["bionic/libstdc++/include"], |
| 1575 | name: "libc_pthread", |
| 1576 | |
| 1577 | stl: "none", |
| 1578 | system_shared_libs: [], |
| 1579 | sanitize: ["never"], |
| 1580 | native_coverage: bionic_coverage, |
| 1581 | } |
| 1582 | |
| 1583 | // ======================================================== |
| 1584 | // libc_cxa.a - Things traditionally in libstdc++ |
| 1585 | // ======================================================== |
| 1586 | |
| 1587 | cc_library_static { |
| 1588 | srcs: [ |
| 1589 | "bionic/__cxa_guard.cpp", |
| 1590 | "bionic/__cxa_pure_virtual.cpp", |
| 1591 | "bionic/new.cpp", |
| 1592 | ], |
| 1593 | cflags: libc_common_cflags + ["-fvisibility=hidden"], |
| 1594 | conlyflags: libc_common_conlyflags, |
| 1595 | cppflags: libc_common_cppflags, |
| 1596 | include_dirs: ["bionic/libstdc++/include"], |
| 1597 | name: "libc_cxa", |
| 1598 | clang: true, // GCC refuses to hide new/delete |
| 1599 | |
| 1600 | stl: "none", |
| 1601 | system_shared_libs: [], |
| 1602 | sanitize: ["never"], |
| 1603 | // b/17574078: Need to disable coverage until we have a prebuilt libprofile_rt. |
| 1604 | // Since this is a static library built with clang, it needs to link |
| 1605 | // libprofile_rt when it is linked into the final binary. Since the final binary |
| 1606 | // is built with GCC, it won't link libprofile_rt. We can't very easily just add |
| 1607 | // libprofile_rt to all link lines the way we've done for libgcov because |
| 1608 | // libprofile_rt isn't prebuilt, and it would be tricky to write a rule that |
| 1609 | // would make sure libprofile_rt is built. |
| 1610 | native_coverage: false, |
| 1611 | } |
| 1612 | |
| 1613 | // ======================================================== |
| 1614 | // libc_syscalls.a |
| 1615 | // ======================================================== |
| 1616 | |
| 1617 | cc_library_static { |
| 1618 | arch: { |
| 1619 | arm: { |
| 1620 | srcs: ["arch-arm/syscalls/**/*.S"], |
| 1621 | }, |
| 1622 | arm64: { |
| 1623 | srcs: ["arch-arm64/syscalls/**/*.S"], |
| 1624 | }, |
| 1625 | mips: { |
| 1626 | srcs: ["arch-mips/syscalls/**/*.S"], |
| 1627 | }, |
| 1628 | mips64: { |
| 1629 | srcs: ["arch-mips64/syscalls/**/*.S"], |
| 1630 | }, |
| 1631 | x86: { |
| 1632 | srcs: ["arch-x86/syscalls/**/*.S"], |
| 1633 | }, |
| 1634 | x86_64: { |
| 1635 | clang: use_clang_x86_64, |
| 1636 | srcs: ["arch-x86_64/syscalls/**/*.S"], |
| 1637 | }, |
| 1638 | }, |
| 1639 | name: "libc_syscalls", |
| 1640 | |
| 1641 | stl: "none", |
| 1642 | system_shared_libs: [], |
| 1643 | sanitize: ["never"], |
| 1644 | native_coverage: bionic_coverage, |
| 1645 | } |
| 1646 | |
| 1647 | // ======================================================== |
| 1648 | // libc_aeabi.a |
| 1649 | // This is an LP32 ARM-only library that needs to be built with -fno-builtin |
| 1650 | // to avoid infinite recursion. For the other architectures we just build an |
| 1651 | // empty library to keep this makefile simple. |
| 1652 | // ======================================================== |
| 1653 | |
| 1654 | cc_library_static { |
| 1655 | arch: { |
| 1656 | arm: { |
| 1657 | srcs: ["arch-arm/bionic/__aeabi.c"], |
| 1658 | }, |
| 1659 | x86_64: { |
| 1660 | clang: use_clang_x86_64, |
| 1661 | }, |
| 1662 | }, |
| 1663 | name: "libc_aeabi", |
| 1664 | cflags: libc_common_cflags + ["-fno-builtin"], |
| 1665 | product_variables: libc_common_product_variables, |
| 1666 | |
| 1667 | stl: "none", |
| 1668 | system_shared_libs: [], |
| 1669 | sanitize: ["never"], |
| 1670 | native_coverage: bionic_coverage, |
| 1671 | } |
| 1672 | |
| 1673 | // ======================================================== |
| 1674 | // libc_ndk.a |
| 1675 | // Compatibility library for the NDK. This library contains |
| 1676 | // all the parts of libc that are safe to statically link. |
| 1677 | // We can't safely statically link things that can only run |
| 1678 | // on a certain version of the OS. Examples include |
| 1679 | // anything that talks to netd (a large portion of the DNS |
| 1680 | // code) and anything that is dependent on the layout of a |
| 1681 | // data structure that has changed across releases (such as |
| 1682 | // pthread_t). |
| 1683 | // ======================================================== |
| 1684 | |
| 1685 | cc_library_static { |
| 1686 | name: "libc_ndk", |
| 1687 | srcs: libc_common_src_files + ["bionic/malloc_debug_common.cpp"], |
| 1688 | multilib: { |
| 1689 | lib32: { |
| 1690 | srcs: libc_common_src_files_32, |
| 1691 | }, |
| 1692 | }, |
| 1693 | arch: { |
| 1694 | arm: { |
| 1695 | srcs: [ |
| 1696 | "arch-arm/bionic/exidx_dynamic.c", |
| 1697 | "arch-common/bionic/crtbegin_so.c", |
| 1698 | "arch-arm/bionic/atexit_legacy.c", |
| 1699 | "arch-common/bionic/crtend_so.S", |
| 1700 | ], |
| 1701 | whole_static_libs: ["libc_aeabi"], |
| 1702 | }, |
| 1703 | x86_64: { |
| 1704 | clang: use_clang_x86_64, |
| 1705 | }, |
| 1706 | }, |
| 1707 | |
| 1708 | cflags: libc_common_cflags + [ |
| 1709 | "-fvisibility=hidden", |
| 1710 | "-DLIBC_STATIC", |
| 1711 | ], |
| 1712 | conlyflags: libc_common_conlyflags, |
| 1713 | cppflags: libc_common_cppflags, |
| 1714 | product_variables: libc_common_product_variables, |
| 1715 | |
| 1716 | whole_static_libs: [ |
| 1717 | "libc_bionic_ndk", |
| 1718 | "libc_cxa", |
| 1719 | "libc_freebsd", |
| 1720 | "libc_gdtoa", |
| 1721 | "libc_malloc", |
| 1722 | "libc_netbsd", |
| 1723 | "libc_openbsd_ndk", |
| 1724 | "libc_stack_protector", |
| 1725 | "libc_syscalls", |
| 1726 | "libc_tzcode", |
| 1727 | "libm", |
| 1728 | ], |
| 1729 | |
| 1730 | stl: "none", |
| 1731 | system_shared_libs: [], |
| 1732 | |
| 1733 | // TODO: split out the asflags. |
| 1734 | asflags: libc_common_cflags, |
| 1735 | sanitize: ["never"], |
| 1736 | native_coverage: bionic_coverage, |
| 1737 | } |
| 1738 | |
| 1739 | // ======================================================== |
| 1740 | // libc_common.a |
| 1741 | // ======================================================== |
| 1742 | |
| 1743 | cc_library_static { |
| 1744 | srcs: libc_common_src_files, |
| 1745 | multilib: { |
| 1746 | lib32: { |
| 1747 | srcs: libc_common_src_files_32, |
| 1748 | }, |
| 1749 | }, |
| 1750 | cflags: libc_common_cflags, |
| 1751 | conlyflags: libc_common_conlyflags, |
| 1752 | cppflags: libc_common_cppflags, |
| 1753 | product_variables: libc_common_product_variables, |
| 1754 | name: "libc_common", |
| 1755 | |
| 1756 | whole_static_libs: [ |
| 1757 | "libc_bionic", |
| 1758 | "libc_bionic_ndk", |
| 1759 | "libc_cxa", |
| 1760 | "libc_dns", |
| 1761 | "libc_freebsd", |
| 1762 | "libc_gdtoa", |
| 1763 | "libc_malloc", |
| 1764 | "libc_netbsd", |
| 1765 | "libc_openbsd", |
| 1766 | "libc_openbsd_ndk", |
| 1767 | "libc_pthread", |
| 1768 | "libc_stack_protector", |
| 1769 | "libc_syscalls", |
| 1770 | "libc_thread_atexit_impl", |
| 1771 | "libc_tzcode", |
| 1772 | ], |
| 1773 | |
| 1774 | arch: { |
| 1775 | arm: { |
| 1776 | whole_static_libs: ["libc_aeabi"], |
| 1777 | }, |
| 1778 | x86_64: { |
| 1779 | clang: use_clang_x86_64, |
| 1780 | }, |
| 1781 | }, |
| 1782 | |
| 1783 | stl: "none", |
| 1784 | system_shared_libs: [], |
| 1785 | |
| 1786 | // TODO: split out the asflags. |
| 1787 | asflags: libc_common_cflags, |
| 1788 | sanitize: ["never"], |
| 1789 | native_coverage: bionic_coverage, |
| 1790 | } |
| 1791 | |
| 1792 | // ======================================================== |
| 1793 | // libc_nomalloc.a |
| 1794 | // ======================================================== |
| 1795 | // |
| 1796 | // This is a version of the static C library that does not |
| 1797 | // include malloc. It's useful in situations when the user wants |
| 1798 | // to provide their own malloc implementation, or wants to |
| 1799 | // explicitly disallow the use of malloc, such as in the |
| 1800 | // dynamic linker. |
| 1801 | |
| 1802 | cc_library_static { |
| 1803 | srcs: [ |
| 1804 | "bionic/dl_iterate_phdr_static.cpp", |
| 1805 | "bionic/libc_init_static.cpp", |
| 1806 | ], |
| 1807 | |
| 1808 | arch: { |
| 1809 | arm: { |
| 1810 | srcs: ["arch-arm/bionic/exidx_static.c"], |
| 1811 | }, |
| 1812 | x86_64: { |
| 1813 | clang: use_clang_x86_64, |
| 1814 | }, |
| 1815 | }, |
| 1816 | |
| 1817 | cflags: libc_common_cflags + ["-DLIBC_STATIC"], |
| 1818 | |
| 1819 | conlyflags: libc_common_conlyflags, |
| 1820 | cppflags: libc_common_cppflags, |
| 1821 | product_variables: libc_common_product_variables, |
| 1822 | |
| 1823 | name: "libc_nomalloc", |
| 1824 | |
| 1825 | whole_static_libs: ["libc_common"], |
| 1826 | stl: "none", |
| 1827 | system_shared_libs: [], |
| 1828 | sanitize: ["never"], |
| 1829 | native_coverage: bionic_coverage, |
| 1830 | |
| 1831 | } |
| 1832 | |
| 1833 | // ======================================================== |
| 1834 | // libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc). |
| 1835 | // ======================================================== |
| 1836 | cc_library_static { |
| 1837 | product_variables: libc_common_product_variables + { |
| 1838 | device_uses_jemalloc: { |
| 1839 | srcs: ["bionic/jemalloc_wrapper.cpp"], |
| 1840 | whole_static_libs: ["libjemalloc"], |
| 1841 | }, |
| 1842 | device_uses_dlmalloc: { |
| 1843 | srcs: ["bionic/dlmalloc.c"], |
| 1844 | }, |
| 1845 | }, |
| 1846 | cflags: libc_common_cflags + ["-fvisibility=hidden"], |
| 1847 | |
| 1848 | conlyflags: libc_common_conlyflags, |
| 1849 | cppflags: libc_common_cppflags, |
| 1850 | name: "libc_malloc", |
| 1851 | stl: "none", |
| 1852 | sanitize: ["never"], |
| 1853 | native_coverage: bionic_coverage, |
| 1854 | |
| 1855 | arch: { |
| 1856 | x86_64: { |
| 1857 | clang: use_clang_x86_64, |
| 1858 | }, |
| 1859 | }, |
| 1860 | } |
| 1861 | |
| 1862 | // ======================================================== |
| 1863 | // libc.a + libc.so |
| 1864 | // ======================================================== |
| 1865 | cc_library { |
| 1866 | name: "libc", |
| 1867 | cflags: libc_common_cflags, |
| 1868 | conlyflags: libc_common_conlyflags, |
| 1869 | cppflags: libc_common_cppflags, |
| 1870 | product_variables: libc_common_product_variables + { |
| 1871 | platform_sdk_version: { |
| 1872 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], |
| 1873 | }, |
| 1874 | }, |
| 1875 | srcs: ["bionic/malloc_debug_common.cpp"], |
| 1876 | static: { |
| 1877 | srcs: [ |
| 1878 | "bionic/dl_iterate_phdr_static.cpp", |
| 1879 | "bionic/libc_init_static.cpp", |
| 1880 | ], |
| 1881 | cflags: ["-DLIBC_STATIC"], |
| 1882 | }, |
| 1883 | shared: { |
| 1884 | srcs: [ |
| 1885 | "arch-common/bionic/crtbegin_so.c", |
| 1886 | "arch-common/bionic/crtbrand.S", |
| 1887 | "bionic/libc_init_dynamic.cpp", |
| 1888 | "bionic/NetdClient.cpp", |
| 1889 | "arch-common/bionic/crtend_so.S", |
| 1890 | ], |
| 1891 | }, |
| 1892 | |
| 1893 | required: ["tzdata"], |
| 1894 | |
| 1895 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 1896 | // meaningful name resolution. |
| 1897 | strip: "keep_symbols", |
| 1898 | |
| 1899 | // WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, |
| 1900 | // make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This |
| 1901 | // ensures that symbols that are pulled into those new libraries from libgcc.a are not declared |
| 1902 | // external; if that were the case, then libc would not pull those symbols from libgcc.a as it |
| 1903 | // should, instead relying on the external symbols from the dependent libraries. That would |
| 1904 | // create a "cloaked" dependency on libgcc.a in libc though the libraries, which is not what |
| 1905 | // you wanted! |
| 1906 | |
| 1907 | shared_libs: ["libdl"], |
| 1908 | whole_static_libs: ["libc_common"], |
| 1909 | stl: "none", |
| 1910 | system_shared_libs: [], |
| 1911 | |
| 1912 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1913 | version_script: "libc.map", |
| 1914 | |
| 1915 | // We'd really like to do this for all architectures, but since this wasn't done |
| 1916 | // before, these symbols must continue to be exported on LP32 for binary |
| 1917 | // compatibility. |
| 1918 | multilib: { |
| 1919 | lib64: { |
| 1920 | ldflags: ["-Wl,--exclude-libs,libgcc.a"], |
| 1921 | }, |
| 1922 | }, |
| 1923 | |
| 1924 | nocrt: true, |
| 1925 | |
| 1926 | // special for arm |
| 1927 | arch: { |
| 1928 | arm: { |
Dmitriy Ivanov | 280d546 | 2015-09-28 10:14:17 -0700 | [diff] [blame^] | 1929 | //TODO: This is to work around b/24465209. Remove after root cause is fixed |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1930 | ldflags: ["-Wl,--hash-style=both"], |
| 1931 | |
| 1932 | shared: { |
| 1933 | srcs: ["arch-arm/bionic/exidx_dynamic.c"], |
| 1934 | }, |
| 1935 | static: { |
| 1936 | srcs: ["arch-arm/bionic/exidx_static.c"], |
| 1937 | }, |
| 1938 | cflags: ["-DCRT_LEGACY_WORKAROUND"], |
| 1939 | srcs: [ |
| 1940 | "arch-arm/bionic/atexit_legacy.c", |
| 1941 | ], |
| 1942 | }, |
| 1943 | x86: { |
Dmitriy Ivanov | 280d546 | 2015-09-28 10:14:17 -0700 | [diff] [blame^] | 1944 | //TODO: This is to work around b/24465209. Remove after root cause is fixed |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1945 | ldflags: ["-Wl,--hash-style=both"], |
| 1946 | }, |
| 1947 | x86_64: { |
| 1948 | clang: use_clang_x86_64, |
| 1949 | }, |
| 1950 | }, |
| 1951 | sanitize: ["never"], |
| 1952 | native_coverage: bionic_coverage, |
| 1953 | } |
| 1954 | |
| 1955 | // For all builds, except for the -user build we will enable memory |
| 1956 | // allocation checking (including memory leaks, buffer overwrites, etc.) |
| 1957 | // Note that all these checks are also controlled by env. settings |
| 1958 | // that can enable, or disable specific checks. Note also that some of |
| 1959 | // the checks are available only in emulator and are implemeted in |
| 1960 | // libc_malloc_qemu_instrumented.so. |
| 1961 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 1962 | // ifneq ($(TARGET_BUILD_VARIANT),user) |
| 1963 | // ======================================================== |
| 1964 | // libc_malloc_debug_leak.so |
| 1965 | // ======================================================== |
| 1966 | cc_library_shared { |
| 1967 | cflags: libc_common_cflags, |
| 1968 | conlyflags: libc_common_conlyflags, |
| 1969 | cppflags: libc_common_cppflags, |
| 1970 | product_variables: libc_common_product_variables, |
| 1971 | |
| 1972 | srcs: [ |
| 1973 | "bionic/debug_backtrace.cpp", |
| 1974 | "bionic/debug_mapinfo.cpp", |
| 1975 | "bionic/libc_logging.cpp", |
| 1976 | "bionic/malloc_debug_leak.cpp", |
| 1977 | "bionic/malloc_debug_check.cpp", |
| 1978 | ], |
| 1979 | |
| 1980 | name: "libc_malloc_debug_leak", |
| 1981 | |
| 1982 | shared_libs: [ |
| 1983 | "libc", |
| 1984 | "libdl", |
| 1985 | ], |
| 1986 | stl: "none", |
| 1987 | system_shared_libs: [], |
| 1988 | // Only need this for arm since libc++ uses its own unwind code that |
| 1989 | // doesn't mix with the other default unwind code. |
| 1990 | arch: { |
| 1991 | arm: { |
| 1992 | static_libs: [ |
| 1993 | "libunwind_llvm", |
| 1994 | "libc++abi", |
| 1995 | ], |
| 1996 | ldflags: ["-Wl,--exclude-libs,libunwind_llvm.a"], |
| 1997 | }, |
| 1998 | x86_64: { |
| 1999 | clang: use_clang_x86_64, |
| 2000 | }, |
| 2001 | }, |
| 2002 | allow_undefined_symbols: true, |
| 2003 | |
| 2004 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 2005 | version_script: "version_script.txt", |
| 2006 | |
| 2007 | // Don't install on release build |
| 2008 | tags: [ |
| 2009 | "eng", |
| 2010 | "debug", |
| 2011 | ], |
| 2012 | sanitize: ["never"], |
| 2013 | native_coverage: bionic_coverage, |
| 2014 | } |
| 2015 | |
| 2016 | // ======================================================== |
| 2017 | // libc_malloc_debug_qemu.so |
| 2018 | // ======================================================== |
| 2019 | cc_library_shared { |
| 2020 | cflags: libc_common_cflags + ["-DMALLOC_QEMU_INSTRUMENT"], |
| 2021 | |
| 2022 | conlyflags: libc_common_conlyflags, |
| 2023 | cppflags: libc_common_cppflags, |
| 2024 | product_variables: libc_common_product_variables, |
| 2025 | |
| 2026 | srcs: [ |
| 2027 | "bionic/libc_logging.cpp", |
| 2028 | "bionic/malloc_debug_qemu.cpp", |
| 2029 | ], |
| 2030 | |
| 2031 | name: "libc_malloc_debug_qemu", |
| 2032 | |
| 2033 | shared_libs: [ |
| 2034 | "libc", |
| 2035 | "libdl", |
| 2036 | ], |
| 2037 | stl: "none", |
| 2038 | system_shared_libs: [], |
| 2039 | |
| 2040 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 2041 | version_script: "version_script.txt", |
| 2042 | |
| 2043 | // Don't install on release build |
| 2044 | tags: [ |
| 2045 | "eng", |
| 2046 | "debug", |
| 2047 | ], |
| 2048 | sanitize: ["never"], |
| 2049 | native_coverage: bionic_coverage, |
| 2050 | |
| 2051 | arch: { |
| 2052 | x86_64: { |
| 2053 | clang: use_clang_x86_64, |
| 2054 | }, |
| 2055 | }, |
| 2056 | } |
| 2057 | |
| 2058 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 2059 | // endif |
| 2060 | //!user |
| 2061 | |
| 2062 | // ======================================================== |
| 2063 | // libstdc++.so + libstdc++.a |
| 2064 | // ======================================================== |
| 2065 | cc_library { |
| 2066 | include_dirs: ["bionic/libstdc++/include"], |
| 2067 | cflags: libc_common_cflags, |
| 2068 | cppflags: libc_common_cppflags, |
| 2069 | product_variables: libc_common_product_variables, |
| 2070 | srcs: [ |
| 2071 | "bionic/__cxa_guard.cpp", |
| 2072 | "bionic/__cxa_pure_virtual.cpp", |
| 2073 | "bionic/new.cpp", |
| 2074 | "bionic/libc_logging.cpp", |
| 2075 | ], |
| 2076 | name: "libstdc++", |
| 2077 | |
| 2078 | stl: "none", |
| 2079 | system_shared_libs: ["libc"], |
| 2080 | sanitize: ["never"], |
| 2081 | native_coverage: bionic_coverage, |
| 2082 | |
Dmitriy Ivanov | 280d546 | 2015-09-28 10:14:17 -0700 | [diff] [blame^] | 2083 | //TODO: This is to work around b/24465209. Remove after root cause is fixed |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2084 | arch: { |
| 2085 | arm: { |
| 2086 | ldflags: ["-Wl,--hash-style=both"], |
| 2087 | }, |
| 2088 | x86: { |
| 2089 | ldflags: ["-Wl,--hash-style=both"], |
| 2090 | }, |
| 2091 | }, |
| 2092 | } |
| 2093 | |
| 2094 | crt_arch_flags = { |
| 2095 | arm: { |
| 2096 | local_include_dirs: ["arch-arm/include"], |
| 2097 | cflags: ["-mthumb-interwork"], |
| 2098 | }, |
| 2099 | arm64: { |
| 2100 | local_include_dirs: ["arch-arm64/include"], |
| 2101 | }, |
| 2102 | mips: { |
| 2103 | local_include_dirs: ["arch-mips/include"], |
| 2104 | ldflags: ["-melf32ltsmip"], |
| 2105 | }, |
| 2106 | mips64: { |
| 2107 | local_include_dirs: ["arch-mips64/include"], |
| 2108 | ldflags: ["-melf64ltsmip"], |
| 2109 | }, |
| 2110 | x86: { |
| 2111 | cflags: ["-m32"], |
| 2112 | ldflags: ["-melf_i386"], |
| 2113 | local_include_dirs: ["arch-x86/include"], |
| 2114 | }, |
| 2115 | x86_64: { |
| 2116 | cflags: ["-m64"], |
| 2117 | ldflags: ["-melf_x86_64"], |
| 2118 | local_include_dirs: ["arch-x86_64/include"], |
| 2119 | }, |
| 2120 | } |
| 2121 | |
| 2122 | crt_arch_so_flags = crt_arch_flags + { |
| 2123 | mips: { |
| 2124 | cflags: ["-fPIC"], |
| 2125 | }, |
| 2126 | mips64: { |
| 2127 | cflags: ["-fPIC"], |
| 2128 | }, |
| 2129 | x86: { |
| 2130 | cflags: ["-fPIC"], |
| 2131 | }, |
| 2132 | x86_64: { |
| 2133 | cflags: ["-fPIC"], |
| 2134 | }, |
| 2135 | } |
| 2136 | |
| 2137 | // Android.mk:start |
| 2138 | // # crt obj files |
| 2139 | // # ======================================================== |
| 2140 | // # crtbrand.c needs <stdint.h> and a #define for the platform SDK version. |
| 2141 | // libc_crt_target_cflags := \ |
| 2142 | // -I$(LOCAL_PATH)/include \ |
| 2143 | // -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \ |
| 2144 | // |
| 2145 | // my_2nd_arch_prefix := |
| 2146 | // include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk |
| 2147 | // include $(LOCAL_PATH)/crt.mk |
| 2148 | // ifdef TARGET_2ND_ARCH |
| 2149 | // my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX) |
| 2150 | // include $(LOCAL_PATH)/arch-$(TARGET_2ND_ARCH)/$(TARGET_2ND_ARCH).mk |
| 2151 | // include $(LOCAL_PATH)/crt.mk |
| 2152 | // my_2nd_arch_prefix := |
| 2153 | // endif |
| 2154 | // |
| 2155 | // include $(call all-makefiles-under,$(LOCAL_PATH)) |
| 2156 | // Android.mk:end |
| 2157 | cc_object { |
| 2158 | name: "crtbrand", |
| 2159 | local_include_dirs: ["include"], |
| 2160 | product_variables: { |
| 2161 | platform_sdk_version: { |
| 2162 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], |
| 2163 | }, |
| 2164 | }, |
| 2165 | srcs: ["arch-common/bionic/crtbrand.S"], |
| 2166 | no_default_compiler_flags: true, |
| 2167 | |
| 2168 | arch: crt_arch_so_flags, |
| 2169 | } |
| 2170 | |
| 2171 | // Android.mk:ignore |
| 2172 | cc_object { |
| 2173 | name: "crtbegin_so1", |
| 2174 | local_include_dirs: ["include"], |
| 2175 | srcs: ["arch-common/bionic/crtbegin_so.c"], |
| 2176 | no_default_compiler_flags: true, |
| 2177 | |
| 2178 | arch: crt_arch_so_flags, |
| 2179 | } |
| 2180 | |
| 2181 | // Android.mk:ignore |
| 2182 | cc_object { |
| 2183 | name: "crtbegin_so", |
| 2184 | no_default_compiler_flags: true, |
| 2185 | |
| 2186 | arch: crt_arch_so_flags, |
| 2187 | deps: [ |
| 2188 | "crtbegin_so1", |
| 2189 | "crtbrand", |
| 2190 | ], |
| 2191 | } |
| 2192 | |
| 2193 | // Android.mk:ignore |
| 2194 | cc_object { |
| 2195 | name: "crtend_so", |
| 2196 | local_include_dirs: ["include"], |
| 2197 | srcs: ["arch-common/bionic/crtend_so.S"], |
| 2198 | no_default_compiler_flags: true, |
| 2199 | |
| 2200 | arch: crt_arch_so_flags, |
| 2201 | } |
| 2202 | |
| 2203 | // Android.mk:ignore |
| 2204 | cc_object { |
| 2205 | name: "crtbegin_static1", |
| 2206 | local_include_dirs: ["include"], |
| 2207 | srcs: ["arch-common/bionic/crtbegin.c"], |
| 2208 | no_default_compiler_flags: true, |
| 2209 | |
| 2210 | arch: crt_arch_flags + { |
| 2211 | arm64: { |
| 2212 | srcs: [ |
| 2213 | "arch-arm64/bionic/crtbegin.c", |
| 2214 | ], |
| 2215 | exclude_srcs: [ |
| 2216 | "arch-common/bionic/crtbegin.c", |
| 2217 | ], |
| 2218 | }, |
| 2219 | mips: { |
| 2220 | srcs: [ |
| 2221 | "arch-mips/bionic/crtbegin.c", |
| 2222 | ], |
| 2223 | exclude_srcs: [ |
| 2224 | "arch-common/bionic/crtbegin.c", |
| 2225 | ], |
| 2226 | }, |
| 2227 | mips64: { |
| 2228 | srcs: [ |
| 2229 | "arch-mips64/bionic/crtbegin.c", |
| 2230 | ], |
| 2231 | exclude_srcs: [ |
| 2232 | "arch-common/bionic/crtbegin.c", |
| 2233 | ], |
| 2234 | }, |
| 2235 | }, |
| 2236 | } |
| 2237 | |
| 2238 | // Android.mk:ignore |
| 2239 | cc_object { |
| 2240 | name: "crtbegin_static", |
| 2241 | no_default_compiler_flags: true, |
| 2242 | |
| 2243 | arch: crt_arch_flags, |
| 2244 | deps: [ |
| 2245 | "crtbegin_static1", |
| 2246 | "crtbrand", |
| 2247 | ], |
| 2248 | } |
| 2249 | |
| 2250 | // Android.mk:ignore |
| 2251 | cc_object { |
| 2252 | name: "crtbegin_dynamic1", |
| 2253 | local_include_dirs: ["include"], |
| 2254 | srcs: ["arch-common/bionic/crtbegin.c"], |
| 2255 | no_default_compiler_flags: true, |
| 2256 | |
| 2257 | arch: crt_arch_flags + { |
| 2258 | arm64: { |
| 2259 | srcs: [ |
| 2260 | "arch-arm64/bionic/crtbegin.c", |
| 2261 | ], |
| 2262 | exclude_srcs: [ |
| 2263 | "arch-common/bionic/crtbegin.c", |
| 2264 | ], |
| 2265 | }, |
| 2266 | mips: { |
| 2267 | srcs: [ |
| 2268 | "arch-mips/bionic/crtbegin.c", |
| 2269 | ], |
| 2270 | exclude_srcs: [ |
| 2271 | "arch-common/bionic/crtbegin.c", |
| 2272 | ], |
| 2273 | }, |
| 2274 | mips64: { |
| 2275 | srcs: [ |
| 2276 | "arch-mips64/bionic/crtbegin.c", |
| 2277 | ], |
| 2278 | exclude_srcs: [ |
| 2279 | "arch-common/bionic/crtbegin.c", |
| 2280 | ], |
| 2281 | }, |
| 2282 | }, |
| 2283 | } |
| 2284 | |
| 2285 | // Android.mk:ignore |
| 2286 | cc_object { |
| 2287 | name: "crtbegin_dynamic", |
| 2288 | no_default_compiler_flags: true, |
| 2289 | |
| 2290 | arch: crt_arch_flags, |
| 2291 | deps: [ |
| 2292 | "crtbegin_dynamic1", |
| 2293 | "crtbrand", |
| 2294 | ], |
| 2295 | } |
| 2296 | |
| 2297 | // Android.mk:ignore |
| 2298 | cc_object { |
| 2299 | // We rename crtend.o to crtend_android.o to avoid a |
| 2300 | // name clash between gcc and bionic. |
| 2301 | name: "crtend_android", |
| 2302 | local_include_dirs: ["include"], |
| 2303 | srcs: ["arch-common/bionic/crtend.S"], |
| 2304 | no_default_compiler_flags: true, |
| 2305 | |
| 2306 | arch: crt_arch_flags, |
| 2307 | } |