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