1 LOCAL_PATH := $(call my-dir)
3 # Make everything depend on any changes to included makefiles.
4 libc_common_additional_dependencies := \
5 $(LOCAL_PATH)/Android.mk \
7 # Define the common source files for all the libc instances
8 # =========================================================
9 libc_common_src_files := \
10 unistd/alarm.c \
11 unistd/exec.c \
12 unistd/fnmatch.c \
13 unistd/syslog.c \
14 unistd/system.c \
15 unistd/time.c \
16 stdio/asprintf.c \
17 stdio/fflush.c \
18 stdio/fgetc.c \
19 stdio/findfp.c \
20 stdio/fprintf.c \
21 stdio/fputc.c \
22 stdio/fread.c \
23 stdio/freopen.c \
24 stdio/fscanf.c \
25 stdio/fseek.c \
26 stdio/ftell.c \
27 stdio/fvwrite.c \
28 stdio/gets.c \
29 stdio/printf.c \
30 stdio/refill.c \
31 stdio/rewind.c \
32 stdio/scanf.c \
33 stdio/snprintf.c\
34 stdio/sprintf.c \
35 stdio/sscanf.c \
36 stdio/stdio.c \
37 stdio/ungetc.c \
38 stdio/vasprintf.c \
39 stdio/vfprintf.c \
40 stdio/vfscanf.c \
41 stdio/vprintf.c \
42 stdio/vsnprintf.c \
43 stdio/vsprintf.c \
44 stdio/vscanf.c \
45 stdio/vsscanf.c \
46 stdio/wbuf.c \
47 stdlib/atexit.c \
48 stdlib/ctype_.c \
49 stdlib/getenv.c \
50 stdlib/putenv.c \
51 stdlib/setenv.c \
52 stdlib/strtod.c \
53 stdlib/strtoimax.c \
54 stdlib/strtol.c \
55 stdlib/strtoll.c \
56 stdlib/strtoul.c \
57 stdlib/strtoull.c \
58 stdlib/strtoumax.c \
59 stdlib/tolower_.c \
60 stdlib/toupper_.c \
61 string/strcasecmp.c \
62 string/strcspn.c \
63 string/strdup.c \
64 string/strpbrk.c \
65 string/strsep.c \
66 string/strspn.c \
67 string/strstr.c \
68 string/strtok.c \
69 wchar/wcswidth.c \
70 wchar/wcsxfrm.c \
71 bionic/arc4random.c \
72 bionic/atoi.c \
73 bionic/atol.c \
74 bionic/atoll.c \
75 bionic/bindresvport.c \
76 bionic/clearenv.c \
77 bionic/daemon.c \
78 bionic/err.c \
79 bionic/ether_aton.c \
80 bionic/ether_ntoa.c \
81 bionic/fdprintf.c \
82 bionic/flockfile.c \
83 bionic/ftime.c \
84 bionic/ftok.c \
85 bionic/fts.c \
86 bionic/getdtablesize.c \
87 bionic/gethostname.c \
88 bionic/getpgrp.c \
89 bionic/getpriority.c \
90 bionic/getpt.c \
91 bionic/if_indextoname.c \
92 bionic/if_nametoindex.c \
93 bionic/initgroups.c \
94 bionic/ioctl.c \
95 bionic/isatty.c \
96 bionic/issetugid.c \
97 bionic/ldexp.c \
98 bionic/md5.c \
99 bionic/memmem.c \
100 bionic/memswap.c \
101 bionic/name_mem.c \
102 bionic/pathconf.c \
103 bionic/perror.c \
104 bionic/ptsname.c \
105 bionic/ptsname_r.c \
106 bionic/pututline.c \
107 bionic/reboot.c \
108 bionic/recv.c \
109 bionic/sched_cpualloc.c \
110 bionic/sched_cpucount.c \
111 bionic/semaphore.c \
112 bionic/send.c \
113 bionic/setpgrp.c \
114 bionic/sigblock.c \
115 bionic/siginterrupt.c \
116 bionic/siglist.c \
117 bionic/signame.c \
118 bionic/sigsetmask.c \
119 bionic/strndup.c \
120 bionic/strntoimax.c \
121 bionic/strntoumax.c \
122 bionic/strtotimeval.c \
123 bionic/system_properties.c \
124 bionic/system_properties_compat.c \
125 bionic/tcgetpgrp.c \
126 bionic/tcsetpgrp.c \
127 bionic/time64.c \
128 bionic/umount.c \
129 bionic/unlockpt.c \
130 bionic/utmp.c \
131 bionic/wcscoll.c \
134 libc_dns_src_files += \
135 netbsd/gethnamaddr.c \
136 netbsd/inet/nsap_addr.c \
137 netbsd/nameser/ns_name.c \
138 netbsd/nameser/ns_netint.c \
139 netbsd/nameser/ns_parse.c \
140 netbsd/nameser/ns_print.c \
141 netbsd/nameser/ns_samedomain.c \
142 netbsd/nameser/ns_ttl.c \
143 netbsd/net/base64.c \
144 netbsd/net/getaddrinfo.c \
145 netbsd/net/getnameinfo.c \
146 netbsd/net/getservbyname.c \
147 netbsd/net/getservbyport.c \
148 netbsd/net/getservent.c \
149 netbsd/net/nsdispatch.c \
150 netbsd/resolv/__dn_comp.c \
151 netbsd/resolv/herror.c \
152 netbsd/resolv/res_cache.c \
153 netbsd/resolv/__res_close.c \
154 netbsd/resolv/res_comp.c \
155 netbsd/resolv/res_data.c \
156 netbsd/resolv/res_debug.c \
157 netbsd/resolv/res_init.c \
158 netbsd/resolv/res_mkquery.c \
159 netbsd/resolv/res_query.c \
160 netbsd/resolv/__res_send.c \
161 netbsd/resolv/res_send.c \
162 netbsd/resolv/res_state.c \
165 # These are used by the 32-bit targets, but not the 64-bit ones.
166 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
167 libc_common_src_files += \
168 bionic/legacy_32_bit_support.cpp \
169 bionic/ndk_cruft.cpp \
171 endif
173 # Fortify implementations of libc functions.
174 libc_common_src_files += \
175 bionic/__FD_chk.cpp \
176 bionic/__fgets_chk.cpp \
177 bionic/__memcpy_chk.cpp \
178 bionic/__memmove_chk.cpp \
179 bionic/__memset_chk.cpp \
180 bionic/__read_chk.cpp \
181 bionic/__recvfrom_chk.cpp \
182 bionic/__strcat_chk.cpp \
183 bionic/__strchr_chk.cpp \
184 bionic/__strcpy_chk.cpp \
185 bionic/__strlcat_chk.cpp \
186 bionic/__strlcpy_chk.cpp \
187 bionic/__strlen_chk.cpp \
188 bionic/__strncat_chk.cpp \
189 bionic/__strncpy_chk.cpp \
190 bionic/__strrchr_chk.cpp \
191 bionic/__umask_chk.cpp \
192 bionic/__vsnprintf_chk.cpp \
193 bionic/__vsprintf_chk.cpp \
195 libc_bionic_src_files := \
196 bionic/abort.cpp \
197 bionic/access.cpp \
198 bionic/assert.cpp \
199 bionic/bionic_time_conversions.cpp \
200 bionic/brk.cpp \
201 bionic/chmod.cpp \
202 bionic/chown.cpp \
203 bionic/clone.cpp \
204 bionic/dirent.cpp \
205 bionic/dup2.cpp \
206 bionic/epoll_create.cpp \
207 bionic/epoll_wait.cpp \
208 bionic/epoll_pwait.cpp \
209 bionic/__errno.cpp \
210 bionic/eventfd_read.cpp \
211 bionic/eventfd_write.cpp \
212 bionic/ffs.cpp \
213 bionic/fork.cpp \
214 bionic/futimens.cpp \
215 bionic/getauxval.cpp \
216 bionic/getcwd.cpp \
217 bionic/inotify_init.cpp \
218 bionic/lchown.cpp \
219 bionic/libc_init_common.cpp \
220 bionic/libc_logging.cpp \
221 bionic/libgen.cpp \
222 bionic/link.cpp \
223 bionic/lstat.cpp \
224 bionic/mkdir.cpp \
225 bionic/mkfifo.cpp \
226 bionic/mknod.cpp \
227 bionic/open.cpp \
228 bionic/pause.cpp \
229 bionic/pipe.cpp \
230 bionic/poll.cpp \
231 bionic/posix_fallocate.cpp \
232 bionic/pthread_atfork.cpp \
233 bionic/pthread_attr.cpp \
234 bionic/pthread_cond.cpp \
235 bionic/pthread_create.cpp \
236 bionic/pthread_detach.cpp \
237 bionic/pthread_equal.cpp \
238 bionic/pthread_exit.cpp \
239 bionic/pthread_getcpuclockid.cpp \
240 bionic/pthread_getschedparam.cpp \
241 bionic/pthread_internals.cpp \
242 bionic/pthread_join.cpp \
243 bionic/pthread_key.cpp \
244 bionic/pthread_kill.cpp \
245 bionic/pthread_mutex.cpp \
246 bionic/pthread_once.cpp \
247 bionic/pthread_rwlock.cpp \
248 bionic/pthread_self.cpp \
249 bionic/pthread_setname_np.cpp \
250 bionic/pthread_setschedparam.cpp \
251 bionic/pthread_sigmask.cpp \
252 bionic/ptrace.cpp \
253 bionic/raise.cpp \
254 bionic/readlink.cpp \
255 bionic/rename.cpp \
256 bionic/rmdir.cpp \
257 bionic/sbrk.cpp \
258 bionic/scandir.cpp \
259 bionic/sched_getaffinity.cpp \
260 bionic/sched_getcpu.cpp \
261 bionic/setegid.cpp \
262 bionic/__set_errno.cpp \
263 bionic/seteuid.cpp \
264 bionic/setlocale.cpp \
265 bionic/signalfd.cpp \
266 bionic/sigaction.cpp \
267 bionic/sigaddset.cpp \
268 bionic/sigdelset.cpp \
269 bionic/sigemptyset.cpp \
270 bionic/sigfillset.cpp \
271 bionic/sigismember.cpp \
272 bionic/signal.cpp \
273 bionic/sigpending.cpp \
274 bionic/sigprocmask.cpp \
275 bionic/sigsuspend.cpp \
276 bionic/sigwait.cpp \
277 bionic/stat.cpp \
278 bionic/statvfs.cpp \
279 bionic/strerror.cpp \
280 bionic/strerror_r.cpp \
281 bionic/strsignal.cpp \
282 bionic/stubs.cpp \
283 bionic/symlink.cpp \
284 bionic/sysconf.cpp \
285 bionic/thread_atexit.cpp \
286 bionic/tdestroy.cpp \
287 bionic/timer.cpp \
288 bionic/tmpfile.cpp \
289 bionic/unlink.cpp \
290 bionic/utimes.cpp \
291 bionic/wait.cpp \
292 bionic/wchar.cpp \
294 # These are shared by all the 32-bit targets, but not the 64-bit ones.
295 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
296 libc_bionic_src_files += \
297 bionic/mmap.cpp \
299 endif
301 libc_tzcode_src_files := \
302 tzcode/asctime.c \
303 tzcode/difftime.c \
304 tzcode/localtime.c \
305 tzcode/strftime.c \
306 tzcode/strptime.c \
308 libc_upstream_freebsd_src_files := \
309 upstream-freebsd/lib/libc/gen/sleep.c \
310 upstream-freebsd/lib/libc/gen/usleep.c \
311 upstream-freebsd/lib/libc/stdio/clrerr.c \
312 upstream-freebsd/lib/libc/stdio/fclose.c \
313 upstream-freebsd/lib/libc/stdio/fdopen.c \
314 upstream-freebsd/lib/libc/stdio/feof.c \
315 upstream-freebsd/lib/libc/stdio/ferror.c \
316 upstream-freebsd/lib/libc/stdio/fgetln.c \
317 upstream-freebsd/lib/libc/stdio/fgetpos.c \
318 upstream-freebsd/lib/libc/stdio/fgets.c \
319 upstream-freebsd/lib/libc/stdio/fileno.c \
320 upstream-freebsd/lib/libc/stdio/flags.c \
321 upstream-freebsd/lib/libc/stdio/fopen.c \
322 upstream-freebsd/lib/libc/stdio/fpurge.c \
323 upstream-freebsd/lib/libc/stdio/fputs.c \
324 upstream-freebsd/lib/libc/stdio/fsetpos.c \
325 upstream-freebsd/lib/libc/stdio/funopen.c \
326 upstream-freebsd/lib/libc/stdio/fwalk.c \
327 upstream-freebsd/lib/libc/stdio/fwrite.c \
328 upstream-freebsd/lib/libc/stdio/getc.c \
329 upstream-freebsd/lib/libc/stdio/getchar.c \
330 upstream-freebsd/lib/libc/stdio/makebuf.c \
331 upstream-freebsd/lib/libc/stdio/mktemp.c \
332 upstream-freebsd/lib/libc/stdio/putc.c \
333 upstream-freebsd/lib/libc/stdio/putchar.c \
334 upstream-freebsd/lib/libc/stdio/puts.c \
335 upstream-freebsd/lib/libc/stdio/putw.c \
336 upstream-freebsd/lib/libc/stdio/remove.c \
337 upstream-freebsd/lib/libc/stdio/rget.c \
338 upstream-freebsd/lib/libc/stdio/setbuf.c \
339 upstream-freebsd/lib/libc/stdio/setbuffer.c \
340 upstream-freebsd/lib/libc/stdio/setvbuf.c \
341 upstream-freebsd/lib/libc/stdio/tempnam.c \
342 upstream-freebsd/lib/libc/stdio/tmpnam.c \
343 upstream-freebsd/lib/libc/stdio/wsetup.c \
344 upstream-freebsd/lib/libc/stdlib/abs.c \
345 upstream-freebsd/lib/libc/stdlib/getopt_long.c \
346 upstream-freebsd/lib/libc/stdlib/imaxabs.c \
347 upstream-freebsd/lib/libc/stdlib/imaxdiv.c \
348 upstream-freebsd/lib/libc/stdlib/labs.c \
349 upstream-freebsd/lib/libc/stdlib/llabs.c \
350 upstream-freebsd/lib/libc/stdlib/qsort.c \
351 upstream-freebsd/lib/libc/stdlib/realpath.c \
352 upstream-freebsd/lib/libc/string/wcpcpy.c \
353 upstream-freebsd/lib/libc/string/wcpncpy.c \
354 upstream-freebsd/lib/libc/string/wcscasecmp.c \
355 upstream-freebsd/lib/libc/string/wcscspn.c \
356 upstream-freebsd/lib/libc/string/wcsdup.c \
357 upstream-freebsd/lib/libc/string/wcslcat.c \
358 upstream-freebsd/lib/libc/string/wcslcpy.c \
359 upstream-freebsd/lib/libc/string/wcsncasecmp.c \
360 upstream-freebsd/lib/libc/string/wcsncat.c \
361 upstream-freebsd/lib/libc/string/wcsncmp.c \
362 upstream-freebsd/lib/libc/string/wcsncpy.c \
363 upstream-freebsd/lib/libc/string/wcsnlen.c \
364 upstream-freebsd/lib/libc/string/wcspbrk.c \
365 upstream-freebsd/lib/libc/string/wcsspn.c \
366 upstream-freebsd/lib/libc/string/wcsstr.c \
367 upstream-freebsd/lib/libc/string/wcstok.c \
368 upstream-freebsd/lib/libc/string/wmemchr.c \
369 upstream-freebsd/lib/libc/string/wmemcpy.c \
370 upstream-freebsd/lib/libc/string/wmemmove.c \
371 upstream-freebsd/lib/libc/string/wmemset.c \
373 libc_upstream_netbsd_src_files := \
374 upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
375 upstream-netbsd/common/lib/libc/inet/inet_addr.c \
376 upstream-netbsd/libc/compat-43/creat.c \
377 upstream-netbsd/libc/gen/ftw.c \
378 upstream-netbsd/libc/gen/nftw.c \
379 upstream-netbsd/libc/gen/nice.c \
380 upstream-netbsd/libc/gen/popen.c \
381 upstream-netbsd/libc/gen/psignal.c \
382 upstream-netbsd/libc/gen/setjmperr.c \
383 upstream-netbsd/libc/gen/utime.c \
384 upstream-netbsd/libc/inet/inet_ntoa.c \
385 upstream-netbsd/libc/inet/inet_ntop.c \
386 upstream-netbsd/libc/inet/inet_pton.c \
387 upstream-netbsd/libc/isc/ev_streams.c \
388 upstream-netbsd/libc/isc/ev_timers.c \
389 upstream-netbsd/libc/regex/regcomp.c \
390 upstream-netbsd/libc/regex/regerror.c \
391 upstream-netbsd/libc/regex/regexec.c \
392 upstream-netbsd/libc/regex/regfree.c \
393 upstream-netbsd/libc/stdio/getdelim.c \
394 upstream-netbsd/libc/stdio/getline.c \
395 upstream-netbsd/libc/stdlib/bsearch.c \
396 upstream-netbsd/libc/stdlib/div.c \
397 upstream-netbsd/libc/stdlib/drand48.c \
398 upstream-netbsd/libc/stdlib/erand48.c \
399 upstream-netbsd/libc/stdlib/exit.c \
400 upstream-netbsd/libc/stdlib/jrand48.c \
401 upstream-netbsd/libc/stdlib/ldiv.c \
402 upstream-netbsd/libc/stdlib/lldiv.c \
403 upstream-netbsd/libc/stdlib/lrand48.c \
404 upstream-netbsd/libc/stdlib/mrand48.c \
405 upstream-netbsd/libc/stdlib/nrand48.c \
406 upstream-netbsd/libc/stdlib/_rand48.c \
407 upstream-netbsd/libc/stdlib/seed48.c \
408 upstream-netbsd/libc/stdlib/srand48.c \
409 upstream-netbsd/libc/stdlib/tdelete.c \
410 upstream-netbsd/libc/stdlib/tfind.c \
411 upstream-netbsd/libc/stdlib/tsearch.c \
412 upstream-netbsd/libc/string/memccpy.c \
413 upstream-netbsd/libc/string/strcasestr.c \
414 upstream-netbsd/libc/string/strcoll.c \
415 upstream-netbsd/libc/string/strxfrm.c \
416 upstream-netbsd/libc/thread-stub/__isthreaded.c \
417 upstream-netbsd/libc/unistd/killpg.c \
419 # Architecture specific source files go here
420 # =========================================================
421 ifeq ($(TARGET_ARCH),arm)
422 libc_common_src_files += \
423 bionic/memchr.c \
424 bionic/memmove.c.arm \
425 bionic/memrchr.c \
426 bionic/strchr.cpp \
427 bionic/strnlen.c \
428 string/bcopy.c \
429 string/index.c \
430 string/strlcat.c \
431 string/strlcpy.c \
432 string/strncat.c \
433 string/strncmp.c \
434 string/strncpy.c \
435 string/strrchr.c \
436 upstream-freebsd/lib/libc/string/wcscat.c \
437 upstream-freebsd/lib/libc/string/wcschr.c \
438 upstream-freebsd/lib/libc/string/wcscmp.c \
439 upstream-freebsd/lib/libc/string/wcscpy.c \
440 upstream-freebsd/lib/libc/string/wcslen.c \
441 upstream-freebsd/lib/libc/string/wcsrchr.c \
442 upstream-freebsd/lib/libc/string/wmemcmp.c \
444 endif # arm
446 ifeq ($(TARGET_ARCH), arm64)
447 #TODO: Replace C stubs with optimised assembly
448 libc_common_src_files += \
449 bionic/memchr.c \
450 bionic/memcmp.c \
451 bionic/memcpy.c \
452 bionic/memmove.c \
453 bionic/memrchr.c \
454 bionic/memset.c \
455 bionic/strchr.cpp \
456 bionic/strnlen.c \
457 string/bcopy.c \
458 string/index.c \
459 string/memcmp16.c \
460 string/strcat.c \
461 string/strcmp.c \
462 string/strcpy.c \
463 string/strlcat.c \
464 string/strlcpy.c \
465 string/strlen.c \
466 string/strncat.c \
467 string/strncmp.c \
468 string/strncpy.c \
469 string/strrchr.c \
470 upstream-freebsd/lib/libc/string/wcscat.c \
471 upstream-freebsd/lib/libc/string/wcschr.c \
472 upstream-freebsd/lib/libc/string/wcscmp.c \
473 upstream-freebsd/lib/libc/string/wcscpy.c \
474 upstream-freebsd/lib/libc/string/wcslen.c \
475 upstream-freebsd/lib/libc/string/wcsrchr.c \
476 upstream-freebsd/lib/libc/string/wmemcmp.c \
478 endif # arm64
480 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64))
481 libc_common_src_files += \
482 bionic/memchr.c \
483 bionic/memcmp.c \
484 bionic/memmove.c \
485 bionic/memrchr.c \
486 bionic/strchr.cpp \
487 bionic/strnlen.c \
488 string/bcopy.c \
489 string/index.c \
490 string/strcat.c \
491 string/strcmp.c \
492 string/strcpy.c \
493 string/strlcat.c \
494 string/strlcpy.c \
495 string/strncat.c \
496 string/strncmp.c \
497 string/strncpy.c \
498 string/strrchr.c \
499 upstream-freebsd/lib/libc/string/wcscat.c \
500 upstream-freebsd/lib/libc/string/wcschr.c \
501 upstream-freebsd/lib/libc/string/wcscmp.c \
502 upstream-freebsd/lib/libc/string/wcscpy.c \
503 upstream-freebsd/lib/libc/string/wcslen.c \
504 upstream-freebsd/lib/libc/string/wcsrchr.c \
505 upstream-freebsd/lib/libc/string/wmemcmp.c \
507 endif # mips || mips64
509 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64))
510 libc_common_src_files += \
511 bionic/memchr.c \
512 bionic/memcmp.c \
513 bionic/memcpy.c \
514 bionic/memmove.c \
515 bionic/memrchr.c \
516 bionic/memset.c \
517 bionic/strchr.cpp \
518 bionic/strnlen.c \
519 string/bcopy.c \
520 string/index.c \
521 string/strcat.c \
522 string/strcmp.c \
523 string/strcpy.c \
524 string/strlcat.c \
525 string/strlcpy.c \
526 string/strlen.c \
527 string/strncat.c \
528 string/strncmp.c \
529 string/strncpy.c \
530 string/strrchr.c \
531 upstream-freebsd/lib/libc/string/wcscat.c \
532 upstream-freebsd/lib/libc/string/wcschr.c \
533 upstream-freebsd/lib/libc/string/wcscmp.c \
534 upstream-freebsd/lib/libc/string/wcscpy.c \
535 upstream-freebsd/lib/libc/string/wcslen.c \
536 upstream-freebsd/lib/libc/string/wcsrchr.c \
537 upstream-freebsd/lib/libc/string/wmemcmp.c \
539 endif # x86_64
541 ifeq ($(TARGET_ARCH),arm)
542 ifeq ($(strip $(TARGET_CPU_VARIANT)),)
543 $(warning TARGET_ARCH is arm, but TARGET_CPU_VARIANT is not defined)
544 endif
545 endif
547 ###########################################################
548 ## Add cpu specific source files.
549 ##
550 ## This can be called multiple times, but it will only add
551 ## the first source file for each unique $(1).
552 ## $(1): Unique identifier to identify the cpu variant
553 ## implementation.
554 ## $(2): Cpu specific source file.
555 ###########################################################
557 define libc-add-cpu-variant-src
558 $(if $(filter true,$(_LIBC_ARCH_CPU_VARIANT_HAS_$(1))), \
559 , \
560 $(eval _LIBC_ARCH_CPU_VARIANT_HAS_$(1) := true) \
561 $(eval _LIBC_ARCH_CPU_VARIANT_SRC_FILE.$(1) := $(2)) \
562 $(eval _LIBC_ARCH_CPU_VARIANT_SRC_FILES += $(2)) \
563 )
564 endef
566 _LIBC_ARCH_COMMON_SRC_FILES :=
567 _LIBC_ARCH_CPU_VARIANT_SRC_FILES :=
568 _LIBC_ARCH_STATIC_SRC_FILES :=
569 _LIBC_ARCH_DYNAMIC_SRC_FILES :=
570 _LIBC_ARCH_ADDITIONAL_DEPENDENCIES :=
572 libc_common_additional_dependencies += \
573 $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk
574 include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk
576 libc_bionic_src_files += $(_LIBC_ARCH_COMMON_SRC_FILES)
577 libc_bionic_src_files += $(_LIBC_ARCH_CPU_VARIANT_SRC_FILES)
578 libc_arch_static_src_files := $(_LIBC_ARCH_STATIC_SRC_FILES) bionic/dl_iterate_phdr_static.cpp
579 libc_arch_dynamic_src_files := $(_LIBC_ARCH_DYNAMIC_SRC_FILES)
580 libc_common_additional_dependencies += $(_LIBC_ARCH_ADDITIONAL_DEPENDENCIES)
582 # Define some common cflags
583 # ========================================================
584 libc_common_cflags := \
585 -DANDROID_CHANGES \
586 -D_LIBC=1 \
587 -Wall -Wextra \
589 # Try to catch typical 32-bit assumptions that break with 64-bit pointers.
590 libc_common_cflags += \
591 -Werror=pointer-to-int-cast \
592 -Werror=int-to-pointer-cast \
593 -Werror=type-limits \
595 ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
596 libc_common_cflags += -DDEBUG
597 endif
599 # To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in
600 # the appropriate BoardConfig.mk file.
601 #
602 ifneq ($(BOARD_MALLOC_ALIGNMENT),)
603 libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
604 endif
606 # crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
607 libc_crt_target_cflags := \
608 -I$(LOCAL_PATH)/include \
609 -I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include \
610 -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \
612 ifeq ($(TARGET_ARCH),arm)
613 libc_common_cflags += -DSOFTFLOAT
614 libc_common_cflags += -fstrict-aliasing
615 libc_crt_target_cflags += -mthumb-interwork
616 endif # arm
618 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64))
619 ifneq ($(ARCH_MIPS_HAS_FPU),true)
620 libc_common_cflags += -DSOFTFLOAT
621 endif
622 libc_common_cflags += -fstrict-aliasing
623 libc_crt_target_cflags += $(TARGET_GLOBAL_CFLAGS)
624 endif # mips
626 ifeq ($(TARGET_ARCH),x86)
627 libc_crt_target_cflags += -m32
628 libc_crt_target_ldflags := -melf_i386
629 endif # x86
631 ifeq ($(TARGET_ARCH),x86_64)
632 libc_crt_target_cflags += -m64
633 libc_crt_target_ldflags := -melf_x86_64
634 endif # x86_64
636 # Define ANDROID_SMP appropriately.
637 ifeq ($(TARGET_CPU_SMP),true)
638 libc_common_cflags += -DANDROID_SMP=1
639 else
640 libc_common_cflags += -DANDROID_SMP=0
641 endif
643 # Define some common conlyflags
644 libc_common_conlyflags := \
645 -std=gnu99
647 # Define some common cppflags
648 libc_common_cppflags := \
649 -std=gnu++11
651 # Define some common includes
652 # ========================================================
653 libc_common_c_includes := \
654 $(LOCAL_PATH)/stdlib \
655 $(LOCAL_PATH)/string \
656 $(LOCAL_PATH)/stdio \
657 external/safe-iop/include
659 # Define the libc run-time (crt) support object files that must be built,
660 # which are needed to build all other objects (shared/static libs and
661 # executables)
662 # ==========================================================================
663 # ARM, Arm64, MIPS, and x86 all need crtbegin_so/crtend_so.
664 #
665 # For x86, the .init section must point to a function that calls all
666 # entries in the .ctors section. (on ARM this is done through the
667 # .init_array section instead).
668 #
669 # For all the platforms, the .fini_array section must point to a function
670 # that will call __cxa_finalize(&__dso_handle) in order to ensure that
671 # static C++ destructors are properly called on dlclose().
672 #
673 libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-common/bionic/crtbegin.c
674 libc_crt_target_crtbegin_so_file := $(LOCAL_PATH)/arch-common/bionic/crtbegin_so.c
676 ifeq ($(TARGET_ARCH),arm)
677 libc_crt_target_so_cflags :=
678 endif
679 ifeq ($(TARGET_ARCH),arm64)
680 libc_crt_target_so_cflags :=
681 libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.c
682 endif
683 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64))
684 libc_crt_target_so_cflags := -fPIC
685 libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.c
686 endif
687 ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
688 libc_crt_target_so_cflags := -fPIC
689 endif
690 libc_crt_target_so_cflags += $(libc_crt_target_cflags)
692 # See the comment in crtbrand.c for the reason why we need to generate
693 # crtbrand.s before generating crtbrand.o.
694 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s
695 $(GEN): $(LOCAL_PATH)/bionic/crtbrand.c
696 @mkdir -p $(dir $@)
697 $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -S \
698 -MD -MF $(@:%.s=%.d) -o $@ $<
699 $(hide) sed -i -e '/\.note\.ABI-tag/s/progbits/note/' $@
700 $(call transform-d-to-p-args,$(@:%.s=%.d),$(@:%.s=%.P))
701 -include $(GEN:%.s=%.P)
702 ALL_GENERATED_SOURCES += $(GEN)
704 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
705 $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s
706 @mkdir -p $(dir $@)
707 $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $<
708 ALL_GENERATED_SOURCES += $(GEN)
710 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o
711 $(GEN): $(libc_crt_target_crtbegin_so_file)
712 @mkdir -p $(dir $@)
713 $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \
714 -MD -MF $(@:%.o=%.d) -o $@ -c $<
715 $(transform-d-to-p)
716 -include $(GEN:%.o=%.P)
717 ALL_GENERATED_SOURCES += $(GEN)
719 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o
720 $(GEN): $(LOCAL_PATH)/arch-common/bionic/crtend_so.S
721 @mkdir -p $(dir $@)
722 $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \
723 -MD -MF $(@:%.o=%.d) -o $@ -c $<
724 $(transform-d-to-p)
725 -include $(GEN:%.o=%.P)
726 ALL_GENERATED_SOURCES += $(GEN)
728 # The following two are installed to device
729 GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtbegin_so.o
730 $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o
731 $(hide) mkdir -p $(dir $@) && cp -f $< $@
732 ALL_GENERATED_SOURCES += $(GEN)
734 GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtend_so.o
735 $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o
736 $(hide) mkdir -p $(dir $@) && cp -f $< $@
737 ALL_GENERATED_SOURCES += $(GEN)
740 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o
741 $(GEN): $(libc_crt_target_crtbegin_file)
742 @mkdir -p $(dir $@)
743 $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
744 -MD -MF $(@:%.o=%.d) -o $@ -c $<
745 $(transform-d-to-p)
746 -include $(GEN:%.o=%.P)
747 ALL_GENERATED_SOURCES += $(GEN)
749 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o
750 $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
751 @mkdir -p $(dir $@)
752 $(hide) $(TARGET_LD) $(libc_crt_target_ldflags) -r -o $@ $^
753 ALL_GENERATED_SOURCES += $(GEN)
755 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o
756 $(GEN): $(libc_crt_target_crtbegin_file)
757 @mkdir -p $(dir $@)
758 $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
759 -MD -MF $(@:%.o=%.d) -o $@ -c $<
760 $(transform-d-to-p)
761 -include $(GEN:%.o=%.P)
762 ALL_GENERATED_SOURCES += $(GEN)
764 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o
765 $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
766 @mkdir -p $(dir $@)
767 $(hide) $(TARGET_LD) $(libc_crt_target_ldflags) -r -o $@ $^
768 ALL_GENERATED_SOURCES += $(GEN)
770 # We rename crtend.o to crtend_android.o to avoid a
771 # name clash between gcc and bionic.
772 GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o
773 $(GEN): $(LOCAL_PATH)/arch-common/bionic/crtend.S
774 @mkdir -p $(dir $@)
775 $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
776 -MD -MF $(@:%.o=%.d) -o $@ -c $<
777 $(transform-d-to-p)
778 -include $(GEN:%.o=%.P)
779 ALL_GENERATED_SOURCES += $(GEN)
782 # To enable malloc leak check for statically linked programs, add
783 # "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk
784 WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A))
786 # ========================================================
787 # libbionic_ssp.a - stack protector code
788 # ========================================================
789 #
790 # The stack protector code needs to be compiled
791 # with -fno-stack-protector, since it modifies the
792 # stack canary.
794 include $(CLEAR_VARS)
796 LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp
797 LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector -Werror
798 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
799 LOCAL_CPPFLAGS := $(libc_common_cppflags)
800 LOCAL_C_INCLUDES := $(libc_common_c_includes)
801 LOCAL_MODULE := libbionic_ssp
802 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
803 LOCAL_SYSTEM_SHARED_LIBRARIES :=
805 include $(BUILD_STATIC_LIBRARY)
808 # ========================================================
809 # libc_tzcode.a - upstream 'tzcode' code
810 # ========================================================
812 include $(CLEAR_VARS)
814 LOCAL_SRC_FILES := $(libc_tzcode_src_files)
815 LOCAL_CFLAGS := \
816 $(libc_common_cflags) \
817 -DSTD_INSPIRED=1 \
818 -DTZDIR=\"/system/usr/share/zoneinfo\" \
819 -DTM_GMTOFF=tm_gmtoff \
820 -DUSG_COMPAT=1
821 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
822 LOCAL_CPPFLAGS := $(libc_common_cppflags)
823 LOCAL_C_INCLUDES := $(libc_common_c_includes)
824 LOCAL_MODULE := libc_tzcode
825 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
826 LOCAL_SYSTEM_SHARED_LIBRARIES :=
828 include $(BUILD_STATIC_LIBRARY)
831 # ========================================================
832 # libc_dns.a - modified NetBSD DNS code
833 # ========================================================
835 include $(CLEAR_VARS)
837 LOCAL_SRC_FILES := $(libc_dns_src_files)
838 LOCAL_CFLAGS := \
839 $(libc_common_cflags) \
840 -DINET6 \
841 -I$(LOCAL_PATH)/private \
842 -I$(LOCAL_PATH)/upstream-netbsd/libc/include # for NetBSD private headers
844 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
845 LOCAL_CPPFLAGS := $(libc_common_cppflags)
846 LOCAL_C_INCLUDES := $(libc_common_c_includes)
847 LOCAL_MODULE := libc_dns
848 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
849 LOCAL_SYSTEM_SHARED_LIBRARIES :=
851 include $(BUILD_STATIC_LIBRARY)
854 # ========================================================
855 # libc_freebsd.a - upstream FreeBSD C library code
856 # ========================================================
857 #
858 # These files are built with the freebsd-compat.h header file
859 # automatically included.
861 include $(CLEAR_VARS)
863 LOCAL_SRC_FILES := $(libc_upstream_freebsd_src_files)
864 LOCAL_CFLAGS := \
865 $(libc_common_cflags) \
866 -I$(LOCAL_PATH)/upstream-freebsd \
867 -I$(LOCAL_PATH)/upstream-freebsd/libc/include \
868 -include upstream-freebsd/freebsd-compat.h
869 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
870 LOCAL_CPPFLAGS := $(libc_common_cppflags)
871 LOCAL_C_INCLUDES := $(libc_common_c_includes)
872 LOCAL_MODULE := libc_freebsd
873 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
874 LOCAL_SYSTEM_SHARED_LIBRARIES :=
876 include $(BUILD_STATIC_LIBRARY)
879 # ========================================================
880 # libc_netbsd.a - upstream NetBSD C library code
881 # ========================================================
882 #
883 # These files are built with the netbsd-compat.h header file
884 # automatically included.
886 include $(CLEAR_VARS)
888 LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files)
889 LOCAL_CFLAGS := \
890 $(libc_common_cflags) \
891 -DPOSIX_MISTAKE \
892 -I$(LOCAL_PATH)/upstream-netbsd \
893 -I$(LOCAL_PATH)/upstream-netbsd/libc/include \
894 -include upstream-netbsd/netbsd-compat.h
895 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
896 LOCAL_CPPFLAGS := $(libc_common_cppflags)
897 LOCAL_C_INCLUDES := $(libc_common_c_includes)
898 LOCAL_MODULE := libc_netbsd
899 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
900 LOCAL_SYSTEM_SHARED_LIBRARIES :=
902 include $(BUILD_STATIC_LIBRARY)
905 # ========================================================
906 # libc_bionic.a - home-grown C library code
907 # ========================================================
909 include $(CLEAR_VARS)
911 LOCAL_SRC_FILES := $(libc_bionic_src_files)
912 LOCAL_CFLAGS := $(libc_common_cflags) -Werror
913 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
914 LOCAL_CPPFLAGS := $(libc_common_cppflags)
915 LOCAL_C_INCLUDES := $(libc_common_c_includes)
916 LOCAL_MODULE := libc_bionic
917 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
918 LOCAL_SYSTEM_SHARED_LIBRARIES :=
920 # Set -DPTHREAD_DEBUG_ENABLED=true to enable support for pthread deadlock prediction.
921 # Since this code is experimental it is disabled by default.
922 LOCAL_CFLAGS += $(libc_common_cflags) -DPTHREAD_DEBUG_ENABLED=false
924 include $(BUILD_STATIC_LIBRARY)
927 # ========================================================
928 # libc_syscalls.a
929 # ========================================================
931 include $(CLEAR_VARS)
933 LOCAL_SRC_FILES := $(call all-S-files-under,arch-$(TARGET_ARCH)/syscalls)
934 LOCAL_MODULE := libc_syscalls
935 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
936 LOCAL_SYSTEM_SHARED_LIBRARIES :=
938 include $(BUILD_STATIC_LIBRARY)
941 # ========================================================
942 # libc_common.a
943 # ========================================================
945 include $(CLEAR_VARS)
947 LOCAL_SRC_FILES := $(libc_common_src_files)
948 LOCAL_CFLAGS := $(libc_common_cflags)
949 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
950 LOCAL_CPPFLAGS := $(libc_common_cppflags)
951 LOCAL_C_INCLUDES := $(libc_common_c_includes)
952 LOCAL_MODULE := libc_common
953 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
954 LOCAL_WHOLE_STATIC_LIBRARIES := \
955 libbionic_ssp \
956 libc_bionic \
957 libc_dns \
958 libc_freebsd \
959 libc_netbsd \
960 libc_syscalls \
961 libc_tzcode \
963 LOCAL_SYSTEM_SHARED_LIBRARIES :=
965 # TODO: split out the asflags.
966 LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
968 include $(BUILD_STATIC_LIBRARY)
971 # ========================================================
972 # libc_nomalloc.a
973 # ========================================================
974 #
975 # This is a version of the static C library that does not
976 # include malloc. It's useful in situations when the user wants
977 # to provide their own malloc implementation, or wants to
978 # explicitly disallow the use of the use of malloc,
979 # such as in the dynamic loader.
981 include $(CLEAR_VARS)
983 LOCAL_SRC_FILES := \
984 $(libc_arch_static_src_files) \
985 $(libc_static_common_src_files) \
986 bionic/libc_init_static.cpp
988 LOCAL_C_INCLUDES := $(libc_common_c_includes)
989 LOCAL_CFLAGS := $(libc_common_cflags) \
990 -DLIBC_STATIC
991 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
992 LOCAL_CPPFLAGS := $(libc_common_cppflags)
994 LOCAL_MODULE := libc_nomalloc
995 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
996 LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
997 LOCAL_SYSTEM_SHARED_LIBRARIES :=
999 include $(BUILD_STATIC_LIBRARY)
1002 # ========================================================
1003 # libc.a
1004 # ========================================================
1005 include $(CLEAR_VARS)
1007 LOCAL_SRC_FILES := \
1008 $(libc_arch_static_src_files) \
1009 $(libc_static_common_src_files) \
1010 bionic/dlmalloc.c \
1011 bionic/malloc_debug_common.cpp \
1012 bionic/libc_init_static.cpp
1014 LOCAL_CFLAGS := $(libc_common_cflags) \
1015 -DLIBC_STATIC
1016 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1017 LOCAL_CPPFLAGS := $(libc_common_cppflags)
1018 LOCAL_C_INCLUDES := $(libc_common_c_includes)
1019 LOCAL_MODULE := libc
1020 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1021 LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1022 LOCAL_SYSTEM_SHARED_LIBRARIES :=
1024 include $(BUILD_STATIC_LIBRARY)
1027 # ========================================================
1028 # libc.so
1029 # ========================================================
1030 include $(CLEAR_VARS)
1032 LOCAL_CFLAGS := $(libc_common_cflags)
1033 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1034 LOCAL_CPPFLAGS := $(libc_common_cppflags)
1035 LOCAL_C_INCLUDES := $(libc_common_c_includes)
1037 LOCAL_SRC_FILES := \
1038 $(libc_arch_dynamic_src_files) \
1039 $(libc_static_common_src_files) \
1040 bionic/dlmalloc.c \
1041 bionic/malloc_debug_common.cpp \
1042 bionic/debug_mapinfo.cpp \
1043 bionic/debug_stacktrace.cpp \
1044 bionic/pthread_debug.cpp \
1045 bionic/libc_init_dynamic.cpp \
1047 ifeq ($(TARGET_ARCH),arm)
1048 LOCAL_NO_CRT := true
1049 LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND
1051 LOCAL_SRC_FILES := \
1052 arch-common/bionic/crtbegin_so.c \
1053 arch-arm/bionic/atexit_legacy.c \
1054 $(LOCAL_SRC_FILES) \
1055 arch-common/bionic/crtend_so.S
1056 endif
1058 LOCAL_MODULE:= libc
1059 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1060 LOCAL_REQUIRED_MODULES := tzdata
1062 # WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
1063 # make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
1064 # ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
1065 # external; if that were the case, then libc would not pull those symbols from libgcc.a as it
1066 # should, instead relying on the external symbols from the dependent libraries. That would
1067 # create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
1068 # you wanted!
1070 LOCAL_SHARED_LIBRARIES := libdl
1071 LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1072 LOCAL_SYSTEM_SHARED_LIBRARIES :=
1074 include $(BUILD_SHARED_LIBRARY)
1077 # For all builds, except for the -user build we will enable memory
1078 # allocation checking (including memory leaks, buffer overwrites, etc.)
1079 # Note that all these checks are also controlled by env. settings
1080 # that can enable, or disable specific checks. Note also that some of
1081 # the checks are available only in emulator and are implemeted in
1082 # libc_malloc_qemu_instrumented.so.
1083 ifneq ($(TARGET_BUILD_VARIANT),user)
1085 # ========================================================
1086 # libc_malloc_debug_leak.so
1087 # ========================================================
1088 include $(CLEAR_VARS)
1090 LOCAL_CFLAGS := \
1091 $(libc_common_cflags) \
1092 -DMALLOC_LEAK_CHECK
1093 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1094 LOCAL_CPPFLAGS := $(libc_common_cppflags)
1096 LOCAL_C_INCLUDES := $(libc_common_c_includes)
1098 LOCAL_SRC_FILES := \
1099 bionic/debug_mapinfo.cpp \
1100 bionic/debug_stacktrace.cpp \
1101 bionic/malloc_debug_leak.cpp \
1102 bionic/malloc_debug_check.cpp \
1104 LOCAL_MODULE:= libc_malloc_debug_leak
1105 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1107 LOCAL_SHARED_LIBRARIES := libc libdl
1108 LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1109 LOCAL_SYSTEM_SHARED_LIBRARIES :=
1110 LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
1112 # Don't install on release build
1113 LOCAL_MODULE_TAGS := eng debug
1115 include $(BUILD_SHARED_LIBRARY)
1118 # ========================================================
1119 # libc_malloc_debug_qemu.so
1120 # ========================================================
1121 include $(CLEAR_VARS)
1123 LOCAL_CFLAGS := \
1124 $(libc_common_cflags) \
1125 -DMALLOC_QEMU_INSTRUMENT
1126 LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1127 LOCAL_CPPFLAGS := $(libc_common_cppflags)
1129 LOCAL_C_INCLUDES := $(libc_common_c_includes)
1131 LOCAL_SRC_FILES := \
1132 bionic/malloc_debug_qemu.cpp
1134 LOCAL_MODULE:= libc_malloc_debug_qemu
1135 LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1137 LOCAL_SHARED_LIBRARIES := libc libdl
1138 LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1139 LOCAL_SYSTEM_SHARED_LIBRARIES :=
1141 # Don't install on release build
1142 LOCAL_MODULE_TAGS := eng debug
1144 include $(BUILD_SHARED_LIBRARY)
1146 endif #!user
1149 # ========================================================
1150 include $(call all-makefiles-under,$(LOCAL_PATH))