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