Android.mk revision 99ae0983c0fd22e34e4d2aa61942b04e347447ee
1LOCAL_PATH := $(call my-dir) 2 3# Make everything depend on any changes to included makefiles. 4libc_common_additional_dependencies := $(LOCAL_PATH)/Android.mk 5 6# Load config for TARGET_ARCH 7my_2nd_arch_prefix := 8include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk 9libc_common_additional_dependencies += \ 10 $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk 11 12 13ifdef TARGET_2ND_ARCH 14# Load config for TARGET_2ND_ARCH 15my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX) 16include $(LOCAL_PATH)/arch-$(TARGET_2ND_ARCH)/$(TARGET_2ND_ARCH).mk 17my_2nd_arch_prefix := 18libc_common_additional_dependencies += \ 19 $(LOCAL_PATH)/arch-$(TARGET_2ND_ARCH)/$(TARGET_2ND_ARCH).mk 20endif 21 22# crt obj files 23# ======================================================== 24# crtbrand.c needs <stdint.h> and a #define for the platform SDK version. 25libc_crt_target_cflags := \ 26 -I$(LOCAL_PATH)/include \ 27 -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \ 28 29my_2nd_arch_prefix := 30include $(LOCAL_PATH)/crt.mk 31ifdef TARGET_2ND_ARCH 32my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX) 33include $(LOCAL_PATH)/crt.mk 34my_2nd_arch_prefix := 35endif 36 37# Define the common source files for all the libc instances 38# ========================================================= 39libc_common_src_files := \ 40 bionic/arc4random.c \ 41 bionic/bindresvport.c \ 42 bionic/daemon.c \ 43 bionic/err.c \ 44 bionic/ether_aton.c \ 45 bionic/ether_ntoa.c \ 46 bionic/fts.c \ 47 bionic/gethostname.c \ 48 bionic/getpriority.c \ 49 bionic/getpt.c \ 50 bionic/if_indextoname.c \ 51 bionic/if_nametoindex.c \ 52 bionic/initgroups.c \ 53 bionic/ioctl.c \ 54 bionic/isatty.c \ 55 bionic/memmem.c \ 56 bionic/pathconf.c \ 57 bionic/ptsname.c \ 58 bionic/ptsname_r.c \ 59 bionic/pututline.c \ 60 bionic/sched_cpualloc.c \ 61 bionic/sched_cpucount.c \ 62 bionic/semaphore.c \ 63 bionic/sigblock.c \ 64 bionic/siginterrupt.c \ 65 bionic/sigsetmask.c \ 66 bionic/system_properties_compat.c \ 67 bionic/unlockpt.c \ 68 stdio/snprintf.c\ 69 stdio/sprintf.c \ 70 unistd/syslog.c \ 71 72# Fortify implementations of libc functions. 73libc_common_src_files += \ 74 bionic/__FD_chk.cpp \ 75 bionic/__fgets_chk.cpp \ 76 bionic/__memmove_chk.cpp \ 77 bionic/__read_chk.cpp \ 78 bionic/__recvfrom_chk.cpp \ 79 bionic/__stpcpy_chk.cpp \ 80 bionic/__stpncpy_chk.cpp \ 81 bionic/__strchr_chk.cpp \ 82 bionic/__strlcat_chk.cpp \ 83 bionic/__strlcpy_chk.cpp \ 84 bionic/__strlen_chk.cpp \ 85 bionic/__strncat_chk.cpp \ 86 bionic/__strncpy_chk.cpp \ 87 bionic/__strrchr_chk.cpp \ 88 bionic/__umask_chk.cpp \ 89 bionic/__vsnprintf_chk.cpp \ 90 bionic/__vsprintf_chk.cpp \ 91 92libc_bionic_src_files := \ 93 bionic/abort.cpp \ 94 bionic/accept.cpp \ 95 bionic/accept4.cpp \ 96 bionic/access.cpp \ 97 bionic/assert.cpp \ 98 bionic/atof.cpp \ 99 bionic/__bionic_name_mem.cpp \ 100 bionic/bionic_time_conversions.cpp \ 101 bionic/brk.cpp \ 102 bionic/c16rtomb.cpp \ 103 bionic/c32rtomb.cpp \ 104 bionic/chmod.cpp \ 105 bionic/chown.cpp \ 106 bionic/clearenv.cpp \ 107 bionic/clock.cpp \ 108 bionic/clone.cpp \ 109 bionic/__cmsg_nxthdr.cpp \ 110 bionic/connect.cpp \ 111 bionic/ctype.cpp \ 112 bionic/__cxa_guard.cpp \ 113 bionic/__cxa_pure_virtual.cpp \ 114 bionic/dirent.cpp \ 115 bionic/dup2.cpp \ 116 bionic/epoll_create.cpp \ 117 bionic/epoll_pwait.cpp \ 118 bionic/epoll_wait.cpp \ 119 bionic/__errno.cpp \ 120 bionic/eventfd_read.cpp \ 121 bionic/eventfd_write.cpp \ 122 bionic/ffs.cpp \ 123 bionic/flockfile.cpp \ 124 bionic/fork.cpp \ 125 bionic/fpclassify.cpp \ 126 bionic/futimens.cpp \ 127 bionic/getauxval.cpp \ 128 bionic/getcwd.cpp \ 129 bionic/getpgrp.cpp \ 130 bionic/getpid.cpp \ 131 bionic/gettid.cpp \ 132 bionic/inotify_init.cpp \ 133 bionic/lchown.cpp \ 134 bionic/lfs64_support.cpp \ 135 bionic/__libc_current_sigrtmax.cpp \ 136 bionic/__libc_current_sigrtmin.cpp \ 137 bionic/libc_init_common.cpp \ 138 bionic/libc_logging.cpp \ 139 bionic/libgen.cpp \ 140 bionic/link.cpp \ 141 bionic/locale.cpp \ 142 bionic/lstat.cpp \ 143 bionic/mbrtoc16.cpp \ 144 bionic/mbrtoc32.cpp \ 145 bionic/mbstate.cpp \ 146 bionic/mkdir.cpp \ 147 bionic/mkfifo.cpp \ 148 bionic/mknod.cpp \ 149 bionic/mntent.cpp \ 150 bionic/NetdClientDispatch.cpp \ 151 bionic/new.cpp \ 152 bionic/open.cpp \ 153 bionic/pause.cpp \ 154 bionic/pipe.cpp \ 155 bionic/poll.cpp \ 156 bionic/posix_fallocate.cpp \ 157 bionic/posix_timers.cpp \ 158 bionic/pthread_atfork.cpp \ 159 bionic/pthread_attr.cpp \ 160 bionic/pthread_cond.cpp \ 161 bionic/pthread_create.cpp \ 162 bionic/pthread_detach.cpp \ 163 bionic/pthread_equal.cpp \ 164 bionic/pthread_exit.cpp \ 165 bionic/pthread_getcpuclockid.cpp \ 166 bionic/pthread_getschedparam.cpp \ 167 bionic/pthread_internals.cpp \ 168 bionic/pthread_join.cpp \ 169 bionic/pthread_key.cpp \ 170 bionic/pthread_kill.cpp \ 171 bionic/pthread_mutex.cpp \ 172 bionic/pthread_once.cpp \ 173 bionic/pthread_rwlock.cpp \ 174 bionic/pthread_self.cpp \ 175 bionic/pthread_setname_np.cpp \ 176 bionic/pthread_setschedparam.cpp \ 177 bionic/pthread_sigmask.cpp \ 178 bionic/ptrace.cpp \ 179 bionic/raise.cpp \ 180 bionic/rand.cpp \ 181 bionic/readlink.cpp \ 182 bionic/reboot.cpp \ 183 bionic/recv.cpp \ 184 bionic/rename.cpp \ 185 bionic/rmdir.cpp \ 186 bionic/scandir.cpp \ 187 bionic/sched_getaffinity.cpp \ 188 bionic/sched_getcpu.cpp \ 189 bionic/send.cpp \ 190 bionic/setegid.cpp \ 191 bionic/__set_errno.cpp \ 192 bionic/seteuid.cpp \ 193 bionic/setpgrp.cpp \ 194 bionic/sigaction.cpp \ 195 bionic/sigaddset.cpp \ 196 bionic/sigdelset.cpp \ 197 bionic/sigemptyset.cpp \ 198 bionic/sigfillset.cpp \ 199 bionic/sigismember.cpp \ 200 bionic/signal.cpp \ 201 bionic/signalfd.cpp \ 202 bionic/sigpending.cpp \ 203 bionic/sigprocmask.cpp \ 204 bionic/sigsuspend.cpp \ 205 bionic/sigwait.cpp \ 206 bionic/socket.cpp \ 207 bionic/stat.cpp \ 208 bionic/statvfs.cpp \ 209 bionic/strcoll_l.cpp \ 210 bionic/strerror.cpp \ 211 bionic/strerror_r.cpp \ 212 bionic/strftime_l.cpp \ 213 bionic/strsignal.cpp \ 214 bionic/strtold.cpp \ 215 bionic/strtold_l.cpp \ 216 bionic/strtoll_l.cpp \ 217 bionic/strtoull_l.cpp \ 218 bionic/strxfrm_l.cpp \ 219 bionic/stubs.cpp \ 220 bionic/symlink.cpp \ 221 bionic/sysconf.cpp \ 222 bionic/sys_siglist.c \ 223 bionic/sys_signame.c \ 224 bionic/system_properties.cpp \ 225 bionic/tdestroy.cpp \ 226 bionic/termios.cpp \ 227 bionic/thread_private.cpp \ 228 bionic/tmpfile.cpp \ 229 bionic/umount.cpp \ 230 bionic/unlink.cpp \ 231 bionic/utimes.cpp \ 232 bionic/vfork.cpp \ 233 bionic/wait.cpp \ 234 bionic/wchar.cpp \ 235 bionic/wctype.cpp \ 236 237libc_upstream_freebsd_src_files := \ 238 upstream-freebsd/lib/libc/gen/ldexp.c \ 239 upstream-freebsd/lib/libc/gen/sleep.c \ 240 upstream-freebsd/lib/libc/gen/usleep.c \ 241 upstream-freebsd/lib/libc/stdio/fclose.c \ 242 upstream-freebsd/lib/libc/stdio/flags.c \ 243 upstream-freebsd/lib/libc/stdio/fopen.c \ 244 upstream-freebsd/lib/libc/stdlib/abs.c \ 245 upstream-freebsd/lib/libc/stdlib/getopt_long.c \ 246 upstream-freebsd/lib/libc/stdlib/imaxabs.c \ 247 upstream-freebsd/lib/libc/stdlib/imaxdiv.c \ 248 upstream-freebsd/lib/libc/stdlib/labs.c \ 249 upstream-freebsd/lib/libc/stdlib/llabs.c \ 250 upstream-freebsd/lib/libc/stdlib/qsort.c \ 251 upstream-freebsd/lib/libc/stdlib/quick_exit.c \ 252 upstream-freebsd/lib/libc/stdlib/realpath.c \ 253 upstream-freebsd/lib/libc/string/wcpcpy.c \ 254 upstream-freebsd/lib/libc/string/wcpncpy.c \ 255 upstream-freebsd/lib/libc/string/wcscasecmp.c \ 256 upstream-freebsd/lib/libc/string/wcscspn.c \ 257 upstream-freebsd/lib/libc/string/wcsdup.c \ 258 upstream-freebsd/lib/libc/string/wcslcat.c \ 259 upstream-freebsd/lib/libc/string/wcsncasecmp.c \ 260 upstream-freebsd/lib/libc/string/wcsncat.c \ 261 upstream-freebsd/lib/libc/string/wcsncmp.c \ 262 upstream-freebsd/lib/libc/string/wcsncpy.c \ 263 upstream-freebsd/lib/libc/string/wcsnlen.c \ 264 upstream-freebsd/lib/libc/string/wcspbrk.c \ 265 upstream-freebsd/lib/libc/string/wcsspn.c \ 266 upstream-freebsd/lib/libc/string/wcstok.c \ 267 upstream-freebsd/lib/libc/string/wmemchr.c \ 268 upstream-freebsd/lib/libc/string/wmemcpy.c \ 269 upstream-freebsd/lib/libc/string/wmemset.c \ 270 271libc_upstream_netbsd_src_files := \ 272 upstream-netbsd/common/lib/libc/stdlib/random.c \ 273 upstream-netbsd/lib/libc/gen/ftw.c \ 274 upstream-netbsd/lib/libc/gen/nftw.c \ 275 upstream-netbsd/lib/libc/gen/nice.c \ 276 upstream-netbsd/lib/libc/gen/popen.c \ 277 upstream-netbsd/lib/libc/gen/psignal.c \ 278 upstream-netbsd/lib/libc/gen/utime.c \ 279 upstream-netbsd/lib/libc/gen/utmp.c \ 280 upstream-netbsd/lib/libc/inet/nsap_addr.c \ 281 upstream-netbsd/lib/libc/regex/regcomp.c \ 282 upstream-netbsd/lib/libc/regex/regerror.c \ 283 upstream-netbsd/lib/libc/regex/regexec.c \ 284 upstream-netbsd/lib/libc/regex/regfree.c \ 285 upstream-netbsd/lib/libc/resolv/mtctxres.c \ 286 upstream-netbsd/lib/libc/stdlib/bsearch.c \ 287 upstream-netbsd/lib/libc/stdlib/div.c \ 288 upstream-netbsd/lib/libc/stdlib/drand48.c \ 289 upstream-netbsd/lib/libc/stdlib/erand48.c \ 290 upstream-netbsd/lib/libc/stdlib/jrand48.c \ 291 upstream-netbsd/lib/libc/stdlib/ldiv.c \ 292 upstream-netbsd/lib/libc/stdlib/lldiv.c \ 293 upstream-netbsd/lib/libc/stdlib/lrand48.c \ 294 upstream-netbsd/lib/libc/stdlib/lsearch.c \ 295 upstream-netbsd/lib/libc/stdlib/mrand48.c \ 296 upstream-netbsd/lib/libc/stdlib/nrand48.c \ 297 upstream-netbsd/lib/libc/stdlib/_rand48.c \ 298 upstream-netbsd/lib/libc/stdlib/rand_r.c \ 299 upstream-netbsd/lib/libc/stdlib/seed48.c \ 300 upstream-netbsd/lib/libc/stdlib/srand48.c \ 301 upstream-netbsd/lib/libc/stdlib/tdelete.c \ 302 upstream-netbsd/lib/libc/stdlib/tfind.c \ 303 upstream-netbsd/lib/libc/stdlib/tsearch.c \ 304 upstream-netbsd/lib/libc/string/memccpy.c \ 305 upstream-netbsd/lib/libc/string/strcasestr.c \ 306 upstream-netbsd/lib/libc/string/strcoll.c \ 307 upstream-netbsd/lib/libc/string/strxfrm.c \ 308 upstream-netbsd/lib/libc/unistd/killpg.c \ 309 310libc_upstream_openbsd_gdtoa_src_files := \ 311 upstream-openbsd/android/gdtoa_support.cpp \ 312 upstream-openbsd/lib/libc/gdtoa/dmisc.c \ 313 upstream-openbsd/lib/libc/gdtoa/dtoa.c \ 314 upstream-openbsd/lib/libc/gdtoa/gdtoa.c \ 315 upstream-openbsd/lib/libc/gdtoa/gethex.c \ 316 upstream-openbsd/lib/libc/gdtoa/gmisc.c \ 317 upstream-openbsd/lib/libc/gdtoa/hd_init.c \ 318 upstream-openbsd/lib/libc/gdtoa/hdtoa.c \ 319 upstream-openbsd/lib/libc/gdtoa/hexnan.c \ 320 upstream-openbsd/lib/libc/gdtoa/ldtoa.c \ 321 upstream-openbsd/lib/libc/gdtoa/misc.c \ 322 upstream-openbsd/lib/libc/gdtoa/smisc.c \ 323 upstream-openbsd/lib/libc/gdtoa/strtod.c \ 324 upstream-openbsd/lib/libc/gdtoa/strtodg.c \ 325 upstream-openbsd/lib/libc/gdtoa/strtof.c \ 326 upstream-openbsd/lib/libc/gdtoa/strtord.c \ 327 upstream-openbsd/lib/libc/gdtoa/sum.c \ 328 upstream-openbsd/lib/libc/gdtoa/ulp.c \ 329 330libc_upstream_openbsd_gdtoa_src_files_32 := \ 331 $(libc_upstream_openbsd_gdtoa_src_files) \ 332 333libc_upstream_openbsd_gdtoa_src_files_64 := \ 334 $(libc_upstream_openbsd_gdtoa_src_files) \ 335 upstream-openbsd/lib/libc/gdtoa/strtorQ.c \ 336 337libc_upstream_openbsd_src_files := \ 338 upstream-openbsd/lib/libc/gen/alarm.c \ 339 upstream-openbsd/lib/libc/gen/ctype_.c \ 340 upstream-openbsd/lib/libc/gen/exec.c \ 341 upstream-openbsd/lib/libc/gen/fnmatch.c \ 342 upstream-openbsd/lib/libc/gen/ftok.c \ 343 upstream-openbsd/lib/libc/gen/getprogname.c \ 344 upstream-openbsd/lib/libc/gen/isctype.c \ 345 upstream-openbsd/lib/libc/gen/setprogname.c \ 346 upstream-openbsd/lib/libc/gen/time.c \ 347 upstream-openbsd/lib/libc/gen/tolower_.c \ 348 upstream-openbsd/lib/libc/gen/toupper_.c \ 349 upstream-openbsd/lib/libc/locale/btowc.c \ 350 upstream-openbsd/lib/libc/locale/mbrlen.c \ 351 upstream-openbsd/lib/libc/locale/mbstowcs.c \ 352 upstream-openbsd/lib/libc/locale/mbtowc.c \ 353 upstream-openbsd/lib/libc/locale/wcscoll.c \ 354 upstream-openbsd/lib/libc/locale/wcstod.c \ 355 upstream-openbsd/lib/libc/locale/wcstof.c \ 356 upstream-openbsd/lib/libc/locale/wcstoimax.c \ 357 upstream-openbsd/lib/libc/locale/wcstol.c \ 358 upstream-openbsd/lib/libc/locale/wcstold.c \ 359 upstream-openbsd/lib/libc/locale/wcstoll.c \ 360 upstream-openbsd/lib/libc/locale/wcstombs.c \ 361 upstream-openbsd/lib/libc/locale/wcstoul.c \ 362 upstream-openbsd/lib/libc/locale/wcstoull.c \ 363 upstream-openbsd/lib/libc/locale/wcstoumax.c \ 364 upstream-openbsd/lib/libc/locale/wcsxfrm.c \ 365 upstream-openbsd/lib/libc/locale/wctob.c \ 366 upstream-openbsd/lib/libc/locale/wctomb.c \ 367 upstream-openbsd/lib/libc/net/htonl.c \ 368 upstream-openbsd/lib/libc/net/htons.c \ 369 upstream-openbsd/lib/libc/net/inet_addr.c \ 370 upstream-openbsd/lib/libc/net/inet_lnaof.c \ 371 upstream-openbsd/lib/libc/net/inet_makeaddr.c \ 372 upstream-openbsd/lib/libc/net/inet_netof.c \ 373 upstream-openbsd/lib/libc/net/inet_network.c \ 374 upstream-openbsd/lib/libc/net/inet_ntoa.c \ 375 upstream-openbsd/lib/libc/net/inet_ntop.c \ 376 upstream-openbsd/lib/libc/net/inet_pton.c \ 377 upstream-openbsd/lib/libc/net/ntohl.c \ 378 upstream-openbsd/lib/libc/net/ntohs.c \ 379 upstream-openbsd/lib/libc/stdio/asprintf.c \ 380 upstream-openbsd/lib/libc/stdio/clrerr.c \ 381 upstream-openbsd/lib/libc/stdio/dprintf.c \ 382 upstream-openbsd/lib/libc/stdio/fdopen.c \ 383 upstream-openbsd/lib/libc/stdio/feof.c \ 384 upstream-openbsd/lib/libc/stdio/ferror.c \ 385 upstream-openbsd/lib/libc/stdio/fflush.c \ 386 upstream-openbsd/lib/libc/stdio/fgetc.c \ 387 upstream-openbsd/lib/libc/stdio/fgetln.c \ 388 upstream-openbsd/lib/libc/stdio/fgetpos.c \ 389 upstream-openbsd/lib/libc/stdio/fgets.c \ 390 upstream-openbsd/lib/libc/stdio/fgetwc.c \ 391 upstream-openbsd/lib/libc/stdio/fgetws.c \ 392 upstream-openbsd/lib/libc/stdio/fileno.c \ 393 upstream-openbsd/lib/libc/stdio/findfp.c \ 394 upstream-openbsd/lib/libc/stdio/fprintf.c \ 395 upstream-openbsd/lib/libc/stdio/fpurge.c \ 396 upstream-openbsd/lib/libc/stdio/fputc.c \ 397 upstream-openbsd/lib/libc/stdio/fputs.c \ 398 upstream-openbsd/lib/libc/stdio/fputwc.c \ 399 upstream-openbsd/lib/libc/stdio/fputws.c \ 400 upstream-openbsd/lib/libc/stdio/fread.c \ 401 upstream-openbsd/lib/libc/stdio/freopen.c \ 402 upstream-openbsd/lib/libc/stdio/fscanf.c \ 403 upstream-openbsd/lib/libc/stdio/fseek.c \ 404 upstream-openbsd/lib/libc/stdio/fsetpos.c \ 405 upstream-openbsd/lib/libc/stdio/ftell.c \ 406 upstream-openbsd/lib/libc/stdio/funopen.c \ 407 upstream-openbsd/lib/libc/stdio/fvwrite.c \ 408 upstream-openbsd/lib/libc/stdio/fwalk.c \ 409 upstream-openbsd/lib/libc/stdio/fwide.c \ 410 upstream-openbsd/lib/libc/stdio/fwprintf.c \ 411 upstream-openbsd/lib/libc/stdio/fwrite.c \ 412 upstream-openbsd/lib/libc/stdio/fwscanf.c \ 413 upstream-openbsd/lib/libc/stdio/getc.c \ 414 upstream-openbsd/lib/libc/stdio/getchar.c \ 415 upstream-openbsd/lib/libc/stdio/getdelim.c \ 416 upstream-openbsd/lib/libc/stdio/getline.c \ 417 upstream-openbsd/lib/libc/stdio/gets.c \ 418 upstream-openbsd/lib/libc/stdio/getwc.c \ 419 upstream-openbsd/lib/libc/stdio/getwchar.c \ 420 upstream-openbsd/lib/libc/stdio/makebuf.c \ 421 upstream-openbsd/lib/libc/stdio/mktemp.c \ 422 upstream-openbsd/lib/libc/stdio/perror.c \ 423 upstream-openbsd/lib/libc/stdio/printf.c \ 424 upstream-openbsd/lib/libc/stdio/putc.c \ 425 upstream-openbsd/lib/libc/stdio/putchar.c \ 426 upstream-openbsd/lib/libc/stdio/puts.c \ 427 upstream-openbsd/lib/libc/stdio/putwc.c \ 428 upstream-openbsd/lib/libc/stdio/putwchar.c \ 429 upstream-openbsd/lib/libc/stdio/refill.c \ 430 upstream-openbsd/lib/libc/stdio/remove.c \ 431 upstream-openbsd/lib/libc/stdio/rewind.c \ 432 upstream-openbsd/lib/libc/stdio/rget.c \ 433 upstream-openbsd/lib/libc/stdio/scanf.c \ 434 upstream-openbsd/lib/libc/stdio/setbuf.c \ 435 upstream-openbsd/lib/libc/stdio/setbuffer.c \ 436 upstream-openbsd/lib/libc/stdio/setvbuf.c \ 437 upstream-openbsd/lib/libc/stdio/sscanf.c \ 438 upstream-openbsd/lib/libc/stdio/stdio.c \ 439 upstream-openbsd/lib/libc/stdio/swprintf.c \ 440 upstream-openbsd/lib/libc/stdio/swscanf.c \ 441 upstream-openbsd/lib/libc/stdio/tempnam.c \ 442 upstream-openbsd/lib/libc/stdio/tmpnam.c \ 443 upstream-openbsd/lib/libc/stdio/ungetc.c \ 444 upstream-openbsd/lib/libc/stdio/ungetwc.c \ 445 upstream-openbsd/lib/libc/stdio/vasprintf.c \ 446 upstream-openbsd/lib/libc/stdio/vdprintf.c \ 447 upstream-openbsd/lib/libc/stdio/vfprintf.c \ 448 upstream-openbsd/lib/libc/stdio/vfscanf.c \ 449 upstream-openbsd/lib/libc/stdio/vfwprintf.c \ 450 upstream-openbsd/lib/libc/stdio/vfwscanf.c \ 451 upstream-openbsd/lib/libc/stdio/vprintf.c \ 452 upstream-openbsd/lib/libc/stdio/vscanf.c \ 453 upstream-openbsd/lib/libc/stdio/vsnprintf.c \ 454 upstream-openbsd/lib/libc/stdio/vsprintf.c \ 455 upstream-openbsd/lib/libc/stdio/vsscanf.c \ 456 upstream-openbsd/lib/libc/stdio/vswprintf.c \ 457 upstream-openbsd/lib/libc/stdio/vswscanf.c \ 458 upstream-openbsd/lib/libc/stdio/vwprintf.c \ 459 upstream-openbsd/lib/libc/stdio/vwscanf.c \ 460 upstream-openbsd/lib/libc/stdio/wbuf.c \ 461 upstream-openbsd/lib/libc/stdio/wprintf.c \ 462 upstream-openbsd/lib/libc/stdio/wscanf.c \ 463 upstream-openbsd/lib/libc/stdio/wsetup.c \ 464 upstream-openbsd/lib/libc/stdlib/atexit.c \ 465 upstream-openbsd/lib/libc/stdlib/atoi.c \ 466 upstream-openbsd/lib/libc/stdlib/atol.c \ 467 upstream-openbsd/lib/libc/stdlib/atoll.c \ 468 upstream-openbsd/lib/libc/stdlib/exit.c \ 469 upstream-openbsd/lib/libc/stdlib/getenv.c \ 470 upstream-openbsd/lib/libc/stdlib/setenv.c \ 471 upstream-openbsd/lib/libc/stdlib/strtoimax.c \ 472 upstream-openbsd/lib/libc/stdlib/strtol.c \ 473 upstream-openbsd/lib/libc/stdlib/strtoll.c \ 474 upstream-openbsd/lib/libc/stdlib/strtoul.c \ 475 upstream-openbsd/lib/libc/stdlib/strtoull.c \ 476 upstream-openbsd/lib/libc/stdlib/strtoumax.c \ 477 upstream-openbsd/lib/libc/stdlib/system.c \ 478 upstream-openbsd/lib/libc/string/strcasecmp.c \ 479 upstream-openbsd/lib/libc/string/strcspn.c \ 480 upstream-openbsd/lib/libc/string/strdup.c \ 481 upstream-openbsd/lib/libc/string/strndup.c \ 482 upstream-openbsd/lib/libc/string/strpbrk.c \ 483 upstream-openbsd/lib/libc/string/strsep.c \ 484 upstream-openbsd/lib/libc/string/strspn.c \ 485 upstream-openbsd/lib/libc/string/strstr.c \ 486 upstream-openbsd/lib/libc/string/strtok.c \ 487 upstream-openbsd/lib/libc/string/wcslcpy.c \ 488 upstream-openbsd/lib/libc/string/wcsstr.c \ 489 upstream-openbsd/lib/libc/string/wcswidth.c \ 490 491libc_arch_static_src_files := \ 492 bionic/dl_iterate_phdr_static.cpp \ 493 494# Define some common cflags 495# ======================================================== 496libc_common_cflags := \ 497 -D_LIBC=1 \ 498 -Wall -Wextra -Wunused \ 499 500ifneq ($(TARGET_USES_LOGD),false) 501libc_common_cflags += -DTARGET_USES_LOGD 502endif 503 504use_clang := false 505 506# Try to catch typical 32-bit assumptions that break with 64-bit pointers. 507libc_common_cflags += \ 508 -Werror=pointer-to-int-cast \ 509 -Werror=int-to-pointer-cast \ 510 -Werror=type-limits \ 511 -Werror \ 512 513ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true) 514 libc_common_cflags += -DDEBUG 515endif 516 517ifeq ($(MALLOC_IMPL),dlmalloc) 518 libc_common_cflags += -DUSE_DLMALLOC 519 libc_malloc_src := bionic/dlmalloc.c 520else 521 libc_common_cflags += -DUSE_JEMALLOC 522 libc_malloc_src := bionic/jemalloc_wrapper.cpp 523 libc_common_c_includes += external/jemalloc/include 524endif 525 526# To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in 527# the appropriate BoardConfig.mk file. 528# 529ifneq ($(BOARD_MALLOC_ALIGNMENT),) 530 libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT) 531endif 532 533# Define ANDROID_SMP appropriately. 534ifeq ($(TARGET_CPU_SMP),true) 535 libc_common_cflags += -DANDROID_SMP=1 536else 537 libc_common_cflags += -DANDROID_SMP=0 538endif 539 540# Define some common conlyflags 541libc_common_conlyflags := \ 542 -std=gnu99 543 544# Define some common cppflags 545libc_common_cppflags := \ 546 -std=gnu++11 547 548# Define some common includes 549# ======================================================== 550libc_common_c_includes += \ 551 $(LOCAL_PATH)/stdio \ 552 553# ======================================================== 554# Add in the arch-specific flags. 555# Must be called with $(eval). 556# $(1): the LOCAL_ variable name 557# $(2): the bionic variable name to pull in 558define patch-up-arch-specific-flags 559$(1)_$(TARGET_ARCH) += $($(2)_$(TARGET_ARCH)) 560ifdef TARGET_2ND_ARCH 561$(1)_$(TARGET_2ND_ARCH) += $($(2)_$(TARGET_2ND_ARCH)) 562endif 563endef 564 565 566# ======================================================== 567# libc_stack_protector.a - stack protector code 568# ======================================================== 569# 570# The stack protector code needs to be compiled 571# with -fno-stack-protector, since it modifies the 572# stack canary. 573 574include $(CLEAR_VARS) 575 576LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp 577LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector 578LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 579LOCAL_CPPFLAGS := $(libc_common_cppflags) 580LOCAL_C_INCLUDES := $(libc_common_c_includes) 581LOCAL_MODULE := libc_stack_protector 582LOCAL_CLANG := $(use_clang) 583LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 584LOCAL_SYSTEM_SHARED_LIBRARIES := 585 586$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 587include $(BUILD_STATIC_LIBRARY) 588 589 590# ======================================================== 591# libc_tzcode.a - upstream 'tzcode' code 592# ======================================================== 593 594include $(CLEAR_VARS) 595 596LOCAL_SRC_FILES := $(call all-c-files-under,tzcode) 597# tzcode doesn't include wcsftime, so we use the OpenBSD one. 598LOCAL_SRC_FILES += upstream-openbsd/lib/libc/time/wcsftime.c 599 600LOCAL_CFLAGS := $(libc_common_cflags) \ 601 -fvisibility=hidden \ 602 603# Don't use ridiculous amounts of stack. 604LOCAL_CFLAGS += -DALL_STATE 605# Include tzsetwall, timelocal, timegm, time2posix, and posix2time. 606LOCAL_CFLAGS += -DSTD_INSPIRED 607# The name of the tm_gmtoff field in our struct tm. 608LOCAL_CFLAGS += -DTM_GMTOFF=tm_gmtoff 609# Where we store our tzdata. 610LOCAL_CFLAGS += -DTZDIR=\"/system/usr/share/zoneinfo\" 611# Include timezone and daylight globals. 612LOCAL_CFLAGS += -DUSG_COMPAT=1 613LOCAL_CFLAGS += -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU 614LOCAL_CFLAGS += -Dlint 615 616LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 617LOCAL_CPPFLAGS := $(libc_common_cppflags) 618LOCAL_C_INCLUDES := $(libc_common_c_includes) $(LOCAL_PATH)/tzcode/ 619LOCAL_MODULE := libc_tzcode 620LOCAL_CLANG := $(use_clang) 621LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 622LOCAL_SYSTEM_SHARED_LIBRARIES := 623 624$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 625include $(BUILD_STATIC_LIBRARY) 626 627 628# ======================================================== 629# libc_dns.a - modified NetBSD DNS code 630# ======================================================== 631 632include $(CLEAR_VARS) 633 634LOCAL_SRC_FILES := \ 635 $(call all-c-files-under,dns) \ 636 upstream-netbsd/lib/libc/isc/ev_streams.c \ 637 upstream-netbsd/lib/libc/isc/ev_timers.c \ 638 639LOCAL_CFLAGS := \ 640 $(libc_common_cflags) \ 641 -DANDROID_CHANGES \ 642 -DINET6 \ 643 -fvisibility=hidden \ 644 -Wno-unused-parameter \ 645 -I$(LOCAL_PATH)/dns/include \ 646 -I$(LOCAL_PATH)/private \ 647 -I$(LOCAL_PATH)/upstream-netbsd/lib/libc/include \ 648 -I$(LOCAL_PATH)/upstream-netbsd/android/include \ 649 -include netbsd-compat.h \ 650 651LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 652LOCAL_CPPFLAGS := $(libc_common_cppflags) 653LOCAL_C_INCLUDES := $(libc_common_c_includes) 654LOCAL_MODULE := libc_dns 655LOCAL_CLANG := $(use_clang) 656LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 657LOCAL_SYSTEM_SHARED_LIBRARIES := 658 659$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 660include $(BUILD_STATIC_LIBRARY) 661 662 663# ======================================================== 664# libc_freebsd.a - upstream FreeBSD C library code 665# ======================================================== 666# 667# These files are built with the freebsd-compat.h header file 668# automatically included. 669 670include $(CLEAR_VARS) 671 672LOCAL_SRC_FILES := $(libc_upstream_freebsd_src_files) 673LOCAL_CFLAGS := \ 674 $(libc_common_cflags) \ 675 -Wno-sign-compare -Wno-uninitialized \ 676 -I$(LOCAL_PATH)/upstream-freebsd/android/include \ 677 -I$(LOCAL_PATH)/upstream-freebsd/lib/libc/include \ 678 -include freebsd-compat.h \ 679 680LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 681LOCAL_CPPFLAGS := $(libc_common_cppflags) 682LOCAL_C_INCLUDES := $(libc_common_c_includes) 683LOCAL_MODULE := libc_freebsd 684LOCAL_CLANG := $(use_clang) 685LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 686LOCAL_SYSTEM_SHARED_LIBRARIES := 687 688$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 689include $(BUILD_STATIC_LIBRARY) 690 691 692# ======================================================== 693# libc_netbsd.a - upstream NetBSD C library code 694# ======================================================== 695# 696# These files are built with the netbsd-compat.h header file 697# automatically included. 698 699include $(CLEAR_VARS) 700 701LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files) 702LOCAL_CFLAGS := \ 703 $(libc_common_cflags) \ 704 -Wno-sign-compare -Wno-uninitialized \ 705 -DPOSIX_MISTAKE \ 706 -I$(LOCAL_PATH)/upstream-netbsd/android/include \ 707 -I$(LOCAL_PATH)/upstream-netbsd/lib/libc/include \ 708 -include netbsd-compat.h \ 709 710LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 711LOCAL_CPPFLAGS := $(libc_common_cppflags) 712LOCAL_C_INCLUDES := $(libc_common_c_includes) 713LOCAL_MODULE := libc_netbsd 714LOCAL_CLANG := $(use_clang) 715LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 716LOCAL_SYSTEM_SHARED_LIBRARIES := 717 718$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 719$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_netbsd_src_files)) 720include $(BUILD_STATIC_LIBRARY) 721 722 723# ======================================================== 724# libc_openbsd.a - upstream OpenBSD C library code 725# ======================================================== 726# 727# These files are built with the openbsd-compat.h header file 728# automatically included. 729 730include $(CLEAR_VARS) 731 732LOCAL_SRC_FILES := $(libc_upstream_openbsd_src_files) 733LOCAL_CFLAGS := \ 734 $(libc_common_cflags) \ 735 -Wno-sign-compare -Wno-uninitialized -Wno-unused-parameter \ 736 -I$(LOCAL_PATH)/private \ 737 -I$(LOCAL_PATH)/upstream-openbsd/android/include \ 738 -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/include \ 739 -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/gdtoa/ \ 740 -include openbsd-compat.h \ 741 742LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 743LOCAL_CPPFLAGS := $(libc_common_cppflags) 744LOCAL_C_INCLUDES := $(libc_common_c_includes) 745LOCAL_MODULE := libc_openbsd 746LOCAL_CLANG := $(use_clang) 747LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 748LOCAL_SYSTEM_SHARED_LIBRARIES := 749 750$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 751include $(BUILD_STATIC_LIBRARY) 752 753 754# ======================================================== 755# libc_gdtoa.a - upstream OpenBSD C library gdtoa code 756# ======================================================== 757# 758# These files are built with the openbsd-compat.h header file 759# automatically included. 760 761include $(CLEAR_VARS) 762 763LOCAL_SRC_FILES_32 := $(libc_upstream_openbsd_gdtoa_src_files_32) 764LOCAL_SRC_FILES_64 := $(libc_upstream_openbsd_gdtoa_src_files_64) 765LOCAL_CFLAGS := \ 766 $(libc_common_cflags) \ 767 -Wno-sign-compare -Wno-uninitialized \ 768 -fvisibility=hidden \ 769 -I$(LOCAL_PATH)/private \ 770 -I$(LOCAL_PATH)/upstream-openbsd/android/include \ 771 -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/include \ 772 -include openbsd-compat.h \ 773 774LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 775LOCAL_CPPFLAGS := $(libc_common_cppflags) 776LOCAL_C_INCLUDES := $(libc_common_c_includes) 777LOCAL_MODULE := libc_gdtoa 778LOCAL_CLANG := $(use_clang) 779LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 780LOCAL_SYSTEM_SHARED_LIBRARIES := 781 782$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 783include $(BUILD_STATIC_LIBRARY) 784 785 786# ======================================================== 787# libc_bionic.a - home-grown C library code 788# ======================================================== 789 790include $(CLEAR_VARS) 791 792LOCAL_SRC_FILES := $(libc_bionic_src_files) 793LOCAL_CFLAGS := $(libc_common_cflags) \ 794 -Wframe-larger-than=2048 \ 795 796LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 797LOCAL_CPPFLAGS := $(libc_common_cppflags) 798LOCAL_C_INCLUDES := $(libc_common_c_includes) 799LOCAL_MODULE := libc_bionic 800LOCAL_CLANG := $(use_clang) 801LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 802LOCAL_SYSTEM_SHARED_LIBRARIES := 803 804$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 805$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_src_files)) 806include $(BUILD_STATIC_LIBRARY) 807 808 809# ======================================================== 810# libc_syscalls.a 811# ======================================================== 812 813include $(CLEAR_VARS) 814 815LOCAL_SRC_FILES_$(TARGET_ARCH) := $(call all-S-files-under,arch-$(TARGET_ARCH)/syscalls) 816ifdef TARGET_2ND_ARCH 817LOCAL_SRC_FILES_$(TARGET_2ND_ARCH) := $(call all-S-files-under,arch-$(TARGET_2ND_ARCH)/syscalls) 818endif 819LOCAL_MODULE := libc_syscalls 820LOCAL_CLANG := $(use_clang) 821LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 822LOCAL_SYSTEM_SHARED_LIBRARIES := 823 824include $(BUILD_STATIC_LIBRARY) 825 826 827# ======================================================== 828# libc_aeabi.a 829# This is an LP32 ARM-only library that needs to be built with -fno-builtin 830# to avoid infinite recursion. For the other architectures we just build an 831# empty library to keep this makefile simple. 832# ======================================================== 833 834include $(CLEAR_VARS) 835 836LOCAL_SRC_FILES_arm := arch-arm/bionic/__aeabi.c 837LOCAL_MODULE := libc_aeabi 838LOCAL_CLANG := $(use_clang) 839LOCAL_CFLAGS := $(libc_common_cflags) -fno-builtin 840LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 841LOCAL_SYSTEM_SHARED_LIBRARIES := 842 843include $(BUILD_STATIC_LIBRARY) 844 845# ======================================================== 846# libc_common.a 847# ======================================================== 848 849include $(CLEAR_VARS) 850 851LOCAL_SRC_FILES := $(libc_common_src_files) 852LOCAL_CFLAGS := $(libc_common_cflags) 853LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 854LOCAL_CPPFLAGS := $(libc_common_cppflags) 855LOCAL_C_INCLUDES := $(libc_common_c_includes) 856LOCAL_MODULE := libc_common 857LOCAL_CLANG := $(use_clang) 858LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 859LOCAL_WHOLE_STATIC_LIBRARIES := \ 860 libc_bionic \ 861 libc_dns \ 862 libc_freebsd \ 863 libc_gdtoa \ 864 libc_malloc \ 865 libc_netbsd \ 866 libc_openbsd \ 867 libc_stack_protector \ 868 libc_syscalls \ 869 libc_tzcode \ 870 871LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi 872 873ifneq ($(MALLOC_IMPL),dlmalloc) 874LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc 875endif 876 877LOCAL_SYSTEM_SHARED_LIBRARIES := 878 879# TODO: split out the asflags. 880LOCAL_ASFLAGS := $(LOCAL_CFLAGS) 881 882$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 883$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_common_src_files)) 884$(eval $(call patch-up-arch-specific-flags,LOCAL_ASFLAGS,LOCAL_CFLAGS)) 885include $(BUILD_STATIC_LIBRARY) 886 887 888# ======================================================== 889# libc_nomalloc.a 890# ======================================================== 891# 892# This is a version of the static C library that does not 893# include malloc. It's useful in situations when the user wants 894# to provide their own malloc implementation, or wants to 895# explicitly disallow the use of malloc, such as in the 896# dynamic linker. 897 898include $(CLEAR_VARS) 899 900LOCAL_SRC_FILES := \ 901 $(libc_arch_static_src_files) \ 902 $(libc_static_common_src_files) \ 903 bionic/libc_init_static.cpp 904 905LOCAL_C_INCLUDES := $(libc_common_c_includes) 906LOCAL_CFLAGS := $(libc_common_cflags) \ 907 -DLIBC_STATIC \ 908 909LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 910LOCAL_CPPFLAGS := $(libc_common_cppflags) 911 912LOCAL_MODULE := libc_nomalloc 913LOCAL_CLANG := $(use_clang) 914LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 915LOCAL_WHOLE_STATIC_LIBRARIES := libc_common 916LOCAL_SYSTEM_SHARED_LIBRARIES := 917 918$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 919$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_static_src_files)) 920include $(BUILD_STATIC_LIBRARY) 921 922 923# ======================================================== 924# libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc). 925# ======================================================== 926 927include $(CLEAR_VARS) 928LOCAL_SRC_FILES := $(libc_malloc_src) 929LOCAL_CFLAGS := $(libc_common_cflags) \ 930 -fvisibility=hidden \ 931 932LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 933LOCAL_CPPFLAGS := $(libc_common_cppflags) 934LOCAL_C_INCLUDES := $(libc_common_c_includes) 935LOCAL_MODULE := libc_malloc 936LOCAL_CLANG := $(use_clang) 937LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 938include $(BUILD_STATIC_LIBRARY) 939 940 941# ======================================================== 942# libc.a 943# ======================================================== 944include $(CLEAR_VARS) 945 946LOCAL_SRC_FILES := \ 947 $(libc_arch_static_src_files) \ 948 $(libc_static_common_src_files) \ 949 bionic/malloc_debug_common.cpp \ 950 bionic/libc_init_static.cpp \ 951 952LOCAL_CFLAGS := $(libc_common_cflags) \ 953 -DLIBC_STATIC \ 954 955LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 956LOCAL_CPPFLAGS := $(libc_common_cppflags) 957LOCAL_C_INCLUDES := $(libc_common_c_includes) 958LOCAL_MODULE := libc 959LOCAL_CLANG := $(use_clang) 960LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 961LOCAL_WHOLE_STATIC_LIBRARIES := libc_common 962LOCAL_SYSTEM_SHARED_LIBRARIES := 963 964$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 965$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_static_src_files)) 966include $(BUILD_STATIC_LIBRARY) 967 968 969# ======================================================== 970# libc.so 971# ======================================================== 972include $(CLEAR_VARS) 973 974LOCAL_CFLAGS := $(libc_common_cflags) 975LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 976LOCAL_CPPFLAGS := $(libc_common_cppflags) 977LOCAL_C_INCLUDES := $(libc_common_c_includes) 978LOCAL_SRC_FILES := \ 979 $(libc_arch_dynamic_src_files) \ 980 $(libc_static_common_src_files) \ 981 bionic/malloc_debug_common.cpp \ 982 bionic/debug_mapinfo.cpp \ 983 bionic/debug_stacktrace.cpp \ 984 bionic/libc_init_dynamic.cpp \ 985 bionic/NetdClient.cpp \ 986 987LOCAL_MODULE := libc 988LOCAL_CLANG := $(use_clang) 989LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 990LOCAL_REQUIRED_MODULES := tzdata 991 992# Leave the symbols in the shared library so that stack unwinders can produce 993# meaningful name resolution. 994LOCAL_STRIP_MODULE := keep_symbols 995 996# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, 997# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This 998# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared 999# external; if that were the case, then libc would not pull those symbols from libgcc.a as it 1000# should, instead relying on the external symbols from the dependent libraries. That would 1001# create a "cloaked" dependency on libgcc.a in libc though the libraries, which is not what 1002# you wanted! 1003 1004LOCAL_SHARED_LIBRARIES := libdl 1005LOCAL_WHOLE_STATIC_LIBRARIES := libc_common 1006LOCAL_SYSTEM_SHARED_LIBRARIES := 1007 1008# We'd really like to do this for all architectures, but since this wasn't done 1009# before, these symbols must continue to be exported on LP32 for binary 1010# compatibility. 1011LOCAL_LDFLAGS_arm64 := -Wl,--exclude-libs,libgcc.a 1012LOCAL_LDFLAGS_mips64 := -Wl,--exclude-libs,libgcc.a 1013LOCAL_LDFLAGS_x86_64 := -Wl,--exclude-libs,libgcc.a 1014 1015$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 1016$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_dynamic_src_files)) 1017$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_static_common_src_files)) 1018# special for arm 1019LOCAL_NO_CRT_arm := true 1020LOCAL_CFLAGS_arm += -DCRT_LEGACY_WORKAROUND 1021LOCAL_SRC_FILES_arm += \ 1022 arch-common/bionic/crtbegin_so.c \ 1023 arch-arm/bionic/atexit_legacy.c \ 1024 arch-common/bionic/crtend_so.S 1025 1026include $(BUILD_SHARED_LIBRARY) 1027 1028 1029# For all builds, except for the -user build we will enable memory 1030# allocation checking (including memory leaks, buffer overwrites, etc.) 1031# Note that all these checks are also controlled by env. settings 1032# that can enable, or disable specific checks. Note also that some of 1033# the checks are available only in emulator and are implemeted in 1034# libc_malloc_qemu_instrumented.so. 1035ifneq ($(TARGET_BUILD_VARIANT),user) 1036 1037# ======================================================== 1038# libc_malloc_debug_leak.so 1039# ======================================================== 1040include $(CLEAR_VARS) 1041 1042LOCAL_CFLAGS := \ 1043 $(libc_common_cflags) \ 1044 -DMALLOC_LEAK_CHECK \ 1045 1046LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 1047LOCAL_CPPFLAGS := $(libc_common_cppflags) 1048 1049LOCAL_C_INCLUDES := $(libc_common_c_includes) 1050 1051LOCAL_SRC_FILES := \ 1052 bionic/debug_mapinfo.cpp \ 1053 bionic/debug_stacktrace.cpp \ 1054 bionic/libc_logging.cpp \ 1055 bionic/malloc_debug_leak.cpp \ 1056 bionic/malloc_debug_check.cpp \ 1057 1058LOCAL_MODULE := libc_malloc_debug_leak 1059LOCAL_CLANG := $(use_clang) 1060LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 1061 1062LOCAL_SHARED_LIBRARIES := libc libdl 1063LOCAL_SYSTEM_SHARED_LIBRARIES := 1064LOCAL_ALLOW_UNDEFINED_SYMBOLS := true 1065 1066# Don't install on release build 1067LOCAL_MODULE_TAGS := eng debug 1068 1069$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 1070include $(BUILD_SHARED_LIBRARY) 1071 1072 1073# ======================================================== 1074# libc_malloc_debug_qemu.so 1075# ======================================================== 1076include $(CLEAR_VARS) 1077 1078LOCAL_CFLAGS := \ 1079 $(libc_common_cflags) \ 1080 -DMALLOC_QEMU_INSTRUMENT \ 1081 1082LOCAL_CONLYFLAGS := $(libc_common_conlyflags) 1083LOCAL_CPPFLAGS := $(libc_common_cppflags) 1084 1085LOCAL_C_INCLUDES := $(libc_common_c_includes) 1086 1087LOCAL_SRC_FILES := \ 1088 bionic/libc_logging.cpp \ 1089 bionic/malloc_debug_qemu.cpp \ 1090 1091LOCAL_MODULE := libc_malloc_debug_qemu 1092LOCAL_CLANG := $(use_clang) 1093LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 1094 1095LOCAL_SHARED_LIBRARIES := libc libdl 1096LOCAL_SYSTEM_SHARED_LIBRARIES := 1097 1098# Don't install on release build 1099LOCAL_MODULE_TAGS := eng debug 1100 1101$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) 1102include $(BUILD_SHARED_LIBRARY) 1103 1104endif #!user 1105 1106 1107# ======================================================== 1108include $(call all-makefiles-under,$(LOCAL_PATH)) 1109