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