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