Android.mk revision 6b27e6e8e095fe288a450dbc9f42ea4ccec39ff0
1LOCAL_PATH := $(call my-dir)
2
3bionic_coverage := false
4
5# Make everything depend on any changes to included makefiles.
6libc_common_additional_dependencies := $(LOCAL_PATH)/Android.mk
7
8# Load config for TARGET_ARCH
9my_2nd_arch_prefix :=
10include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk
11libc_common_additional_dependencies += \
12    $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk
13
14
15ifdef TARGET_2ND_ARCH
16# Load config for TARGET_2ND_ARCH
17my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
18include $(LOCAL_PATH)/arch-$(TARGET_2ND_ARCH)/$(TARGET_2ND_ARCH).mk
19my_2nd_arch_prefix :=
20libc_common_additional_dependencies += \
21    $(LOCAL_PATH)/arch-$(TARGET_2ND_ARCH)/$(TARGET_2ND_ARCH).mk
22endif
23
24# crt obj files
25# ========================================================
26# crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
27libc_crt_target_cflags := \
28    -I$(LOCAL_PATH)/include \
29    -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \
30
31my_2nd_arch_prefix :=
32include $(LOCAL_PATH)/crt.mk
33ifdef TARGET_2ND_ARCH
34my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
35include $(LOCAL_PATH)/crt.mk
36my_2nd_arch_prefix :=
37endif
38
39# Define the common source files for all the libc instances
40# =========================================================
41libc_common_src_files := \
42    bionic/bindresvport.c \
43    bionic/ether_aton.c \
44    bionic/ether_ntoa.c \
45    bionic/fts.c \
46    bionic/getpriority.c \
47    bionic/if_indextoname.c \
48    bionic/if_nametoindex.c \
49    bionic/initgroups.c \
50    bionic/ioctl.c \
51    bionic/isatty.c \
52    bionic/memmem.c \
53    bionic/pututline.c \
54    bionic/sched_cpualloc.c \
55    bionic/sched_cpucount.c \
56    bionic/sigblock.c \
57    bionic/siginterrupt.c \
58    bionic/sigsetmask.c \
59    bionic/system_properties_compat.c \
60    stdio/findfp.c \
61    stdio/fread.c \
62    stdio/snprintf.c\
63    stdio/sprintf.c \
64    stdio/stdio.c \
65    stdio/stdio_ext.cpp \
66    stdlib/atexit.c \
67    stdlib/exit.c \
68
69# Fortify implementations of libc functions.
70libc_common_src_files += \
71    bionic/__FD_chk.cpp \
72    bionic/__fgets_chk.cpp \
73    bionic/__memchr_chk.cpp \
74    bionic/__memmove_chk.cpp \
75    bionic/__memrchr_chk.cpp \
76    bionic/__poll_chk.cpp \
77    bionic/__pread64_chk.cpp \
78    bionic/__pread_chk.cpp \
79    bionic/__read_chk.cpp \
80    bionic/__readlink_chk.cpp \
81    bionic/__readlinkat_chk.cpp \
82    bionic/__recvfrom_chk.cpp \
83    bionic/__stpcpy_chk.cpp \
84    bionic/__stpncpy_chk.cpp \
85    bionic/__strchr_chk.cpp \
86    bionic/__strlcat_chk.cpp \
87    bionic/__strlcpy_chk.cpp \
88    bionic/__strlen_chk.cpp \
89    bionic/__strncat_chk.cpp \
90    bionic/__strncpy_chk.cpp \
91    bionic/__strrchr_chk.cpp \
92    bionic/__umask_chk.cpp \
93    bionic/__vsnprintf_chk.cpp \
94    bionic/__vsprintf_chk.cpp \
95
96libc_bionic_ndk_src_files := \
97    bionic/abort.cpp \
98    bionic/accept.cpp \
99    bionic/accept4.cpp \
100    bionic/access.cpp \
101    bionic/assert.cpp \
102    bionic/atof.cpp \
103    bionic/bionic_systrace.cpp \
104    bionic/bionic_time_conversions.cpp \
105    bionic/brk.cpp \
106    bionic/c16rtomb.cpp \
107    bionic/c32rtomb.cpp \
108    bionic/chmod.cpp \
109    bionic/chown.cpp \
110    bionic/clearenv.cpp \
111    bionic/clock.cpp \
112    bionic/clock_getcpuclockid.cpp \
113    bionic/clock_nanosleep.cpp \
114    bionic/clone.cpp \
115    bionic/close.cpp \
116    bionic/__cmsg_nxthdr.cpp \
117    bionic/connect.cpp \
118    bionic/ctype.cpp \
119    bionic/dirent.cpp \
120    bionic/dup2.cpp \
121    bionic/epoll_create.cpp \
122    bionic/epoll_pwait.cpp \
123    bionic/epoll_wait.cpp \
124    bionic/__errno.cpp \
125    bionic/error.cpp \
126    bionic/eventfd_read.cpp \
127    bionic/eventfd_write.cpp \
128    bionic/faccessat.cpp \
129    bionic/fchmod.cpp \
130    bionic/fchmodat.cpp \
131    bionic/ffs.cpp \
132    bionic/flockfile.cpp \
133    bionic/fpclassify.cpp \
134    bionic/futimens.cpp \
135    bionic/getcwd.cpp \
136    bionic/gethostname.cpp \
137    bionic/getpgrp.cpp \
138    bionic/getpid.cpp \
139    bionic/gettid.cpp \
140    bionic/__gnu_basename.cpp \
141    bionic/inotify_init.cpp \
142    bionic/lchown.cpp \
143    bionic/lfs64_support.cpp \
144    bionic/__libc_current_sigrtmax.cpp \
145    bionic/__libc_current_sigrtmin.cpp \
146    bionic/libc_init_common.cpp \
147    bionic/libc_logging.cpp \
148    bionic/libgen.cpp \
149    bionic/link.cpp \
150    bionic/locale.cpp \
151    bionic/lstat.cpp \
152    bionic/malloc_info.cpp \
153    bionic/mbrtoc16.cpp \
154    bionic/mbrtoc32.cpp \
155    bionic/mbstate.cpp \
156    bionic/mempcpy.cpp \
157    bionic/mkdir.cpp \
158    bionic/mkfifo.cpp \
159    bionic/mknod.cpp \
160    bionic/mntent.cpp \
161    bionic/NetdClientDispatch.cpp \
162    bionic/open.cpp \
163    bionic/pathconf.cpp \
164    bionic/pause.cpp \
165    bionic/pipe.cpp \
166    bionic/poll.cpp \
167    bionic/posix_fadvise.cpp \
168    bionic/posix_fallocate.cpp \
169    bionic/posix_madvise.cpp \
170    bionic/posix_timers.cpp \
171    bionic/ptrace.cpp \
172    bionic/pty.cpp \
173    bionic/raise.cpp \
174    bionic/rand.cpp \
175    bionic/readlink.cpp \
176    bionic/reboot.cpp \
177    bionic/recv.cpp \
178    bionic/rename.cpp \
179    bionic/rmdir.cpp \
180    bionic/scandir.cpp \
181    bionic/sched_getaffinity.cpp \
182    bionic/sched_getcpu.cpp \
183    bionic/semaphore.cpp \
184    bionic/send.cpp \
185    bionic/setegid.cpp \
186    bionic/__set_errno.cpp \
187    bionic/seteuid.cpp \
188    bionic/setpgrp.cpp \
189    bionic/sigaction.cpp \
190    bionic/sigaddset.cpp \
191    bionic/sigdelset.cpp \
192    bionic/sigemptyset.cpp \
193    bionic/sigfillset.cpp \
194    bionic/sigismember.cpp \
195    bionic/signal.cpp \
196    bionic/signalfd.cpp \
197    bionic/sigpending.cpp \
198    bionic/sigprocmask.cpp \
199    bionic/sigqueue.cpp \
200    bionic/sigsuspend.cpp \
201    bionic/sigtimedwait.cpp \
202    bionic/sigwait.cpp \
203    bionic/sigwaitinfo.cpp \
204    bionic/socket.cpp \
205    bionic/stat.cpp \
206    bionic/statvfs.cpp \
207    bionic/strerror.cpp \
208    bionic/strerror_r.cpp \
209    bionic/strsignal.cpp \
210    bionic/strtold.cpp \
211    bionic/stubs.cpp \
212    bionic/symlink.cpp \
213    bionic/sysinfo.cpp \
214    bionic/syslog.cpp \
215    bionic/sys_siglist.c \
216    bionic/sys_signame.c \
217    bionic/system_properties.cpp \
218    bionic/tdestroy.cpp \
219    bionic/termios.cpp \
220    bionic/thread_private.cpp \
221    bionic/tmpfile.cpp \
222    bionic/umount.cpp \
223    bionic/unlink.cpp \
224    bionic/utimes.cpp \
225    bionic/wait.cpp \
226    bionic/wchar.cpp \
227    bionic/wctype.cpp \
228    bionic/wmempcpy.cpp \
229
230libc_bionic_src_files :=
231
232# The fork implementation depends on pthread data, so we can't include it in
233# libc_ndk.a.
234libc_bionic_src_files += bionic/fork.cpp
235
236# The data that backs getauxval is initialized in the libc init functions which
237# are invoked by the linker. If this file is included in libc_ndk.a, only one of
238# the copies of the global data will be initialized, resulting in nullptr
239# dereferences.
240libc_bionic_src_files += bionic/getauxval.cpp
241
242# These three require getauxval, which isn't available on older platforms.
243libc_bionic_src_files += bionic/getentropy_linux.c
244libc_bionic_src_files += bionic/sysconf.cpp
245libc_bionic_src_files += bionic/vdso.cpp
246
247libc_cxa_src_files := \
248    bionic/__cxa_guard.cpp \
249    bionic/__cxa_pure_virtual.cpp \
250    bionic/new.cpp \
251
252libc_upstream_freebsd_src_files := \
253    upstream-freebsd/lib/libc/gen/ldexp.c \
254    upstream-freebsd/lib/libc/gen/sleep.c \
255    upstream-freebsd/lib/libc/gen/usleep.c \
256    upstream-freebsd/lib/libc/stdlib/abs.c \
257    upstream-freebsd/lib/libc/stdlib/getopt_long.c \
258    upstream-freebsd/lib/libc/stdlib/imaxabs.c \
259    upstream-freebsd/lib/libc/stdlib/imaxdiv.c \
260    upstream-freebsd/lib/libc/stdlib/labs.c \
261    upstream-freebsd/lib/libc/stdlib/llabs.c \
262    upstream-freebsd/lib/libc/stdlib/qsort.c \
263    upstream-freebsd/lib/libc/stdlib/quick_exit.c \
264    upstream-freebsd/lib/libc/stdlib/realpath.c \
265    upstream-freebsd/lib/libc/string/wcpcpy.c \
266    upstream-freebsd/lib/libc/string/wcpncpy.c \
267    upstream-freebsd/lib/libc/string/wcscasecmp.c \
268    upstream-freebsd/lib/libc/string/wcscspn.c \
269    upstream-freebsd/lib/libc/string/wcsdup.c \
270    upstream-freebsd/lib/libc/string/wcslcat.c \
271    upstream-freebsd/lib/libc/string/wcsncasecmp.c \
272    upstream-freebsd/lib/libc/string/wcsncat.c \
273    upstream-freebsd/lib/libc/string/wcsncmp.c \
274    upstream-freebsd/lib/libc/string/wcsncpy.c \
275    upstream-freebsd/lib/libc/string/wcsnlen.c \
276    upstream-freebsd/lib/libc/string/wcspbrk.c \
277    upstream-freebsd/lib/libc/string/wcsspn.c \
278    upstream-freebsd/lib/libc/string/wcstok.c \
279    upstream-freebsd/lib/libc/string/wmemchr.c \
280    upstream-freebsd/lib/libc/string/wmemset.c \
281
282libc_upstream_netbsd_src_files := \
283    upstream-netbsd/common/lib/libc/stdlib/random.c \
284    upstream-netbsd/lib/libc/gen/ftw.c \
285    upstream-netbsd/lib/libc/gen/nftw.c \
286    upstream-netbsd/lib/libc/gen/nice.c \
287    upstream-netbsd/lib/libc/gen/popen.c \
288    upstream-netbsd/lib/libc/gen/psignal.c \
289    upstream-netbsd/lib/libc/gen/utime.c \
290    upstream-netbsd/lib/libc/gen/utmp.c \
291    upstream-netbsd/lib/libc/inet/nsap_addr.c \
292    upstream-netbsd/lib/libc/regex/regcomp.c \
293    upstream-netbsd/lib/libc/regex/regerror.c \
294    upstream-netbsd/lib/libc/regex/regexec.c \
295    upstream-netbsd/lib/libc/regex/regfree.c \
296    upstream-netbsd/lib/libc/stdlib/bsearch.c \
297    upstream-netbsd/lib/libc/stdlib/div.c \
298    upstream-netbsd/lib/libc/stdlib/drand48.c \
299    upstream-netbsd/lib/libc/stdlib/erand48.c \
300    upstream-netbsd/lib/libc/stdlib/jrand48.c \
301    upstream-netbsd/lib/libc/stdlib/lcong48.c \
302    upstream-netbsd/lib/libc/stdlib/ldiv.c \
303    upstream-netbsd/lib/libc/stdlib/lldiv.c \
304    upstream-netbsd/lib/libc/stdlib/lrand48.c \
305    upstream-netbsd/lib/libc/stdlib/mrand48.c \
306    upstream-netbsd/lib/libc/stdlib/nrand48.c \
307    upstream-netbsd/lib/libc/stdlib/_rand48.c \
308    upstream-netbsd/lib/libc/stdlib/rand_r.c \
309    upstream-netbsd/lib/libc/stdlib/seed48.c \
310    upstream-netbsd/lib/libc/stdlib/srand48.c \
311    upstream-netbsd/lib/libc/string/memccpy.c \
312    upstream-netbsd/lib/libc/string/strcasestr.c \
313    upstream-netbsd/lib/libc/string/strcoll.c \
314    upstream-netbsd/lib/libc/string/strxfrm.c \
315
316libc_upstream_openbsd_gdtoa_src_files := \
317    upstream-openbsd/android/gdtoa_support.cpp \
318    upstream-openbsd/lib/libc/gdtoa/dmisc.c \
319    upstream-openbsd/lib/libc/gdtoa/dtoa.c \
320    upstream-openbsd/lib/libc/gdtoa/gdtoa.c \
321    upstream-openbsd/lib/libc/gdtoa/gethex.c \
322    upstream-openbsd/lib/libc/gdtoa/gmisc.c \
323    upstream-openbsd/lib/libc/gdtoa/hd_init.c \
324    upstream-openbsd/lib/libc/gdtoa/hdtoa.c \
325    upstream-openbsd/lib/libc/gdtoa/hexnan.c \
326    upstream-openbsd/lib/libc/gdtoa/ldtoa.c \
327    upstream-openbsd/lib/libc/gdtoa/misc.c \
328    upstream-openbsd/lib/libc/gdtoa/smisc.c \
329    upstream-openbsd/lib/libc/gdtoa/strtod.c \
330    upstream-openbsd/lib/libc/gdtoa/strtodg.c \
331    upstream-openbsd/lib/libc/gdtoa/strtof.c \
332    upstream-openbsd/lib/libc/gdtoa/strtord.c \
333    upstream-openbsd/lib/libc/gdtoa/sum.c \
334    upstream-openbsd/lib/libc/gdtoa/ulp.c \
335
336libc_upstream_openbsd_gdtoa_src_files_32 := \
337    $(libc_upstream_openbsd_gdtoa_src_files) \
338
339libc_upstream_openbsd_gdtoa_src_files_64 := \
340    $(libc_upstream_openbsd_gdtoa_src_files) \
341    upstream-openbsd/lib/libc/gdtoa/strtorQ.c \
342
343# These two depend on getentropy_linux.cpp, which isn't in libc_ndk.a.
344libc_upstream_openbsd_src_files := \
345    upstream-openbsd/lib/libc/crypt/arc4random.c \
346    upstream-openbsd/lib/libc/crypt/arc4random_uniform.c \
347
348libc_upstream_openbsd_ndk_src_files := \
349    upstream-openbsd/lib/libc/compat-43/killpg.c \
350    upstream-openbsd/lib/libc/gen/alarm.c \
351    upstream-openbsd/lib/libc/gen/ctype_.c \
352    upstream-openbsd/lib/libc/gen/daemon.c \
353    upstream-openbsd/lib/libc/gen/err.c \
354    upstream-openbsd/lib/libc/gen/errx.c \
355    upstream-openbsd/lib/libc/gen/exec.c \
356    upstream-openbsd/lib/libc/gen/fnmatch.c \
357    upstream-openbsd/lib/libc/gen/ftok.c \
358    upstream-openbsd/lib/libc/gen/getprogname.c \
359    upstream-openbsd/lib/libc/gen/isctype.c \
360    upstream-openbsd/lib/libc/gen/setprogname.c \
361    upstream-openbsd/lib/libc/gen/time.c \
362    upstream-openbsd/lib/libc/gen/tolower_.c \
363    upstream-openbsd/lib/libc/gen/toupper_.c \
364    upstream-openbsd/lib/libc/gen/verr.c \
365    upstream-openbsd/lib/libc/gen/verrx.c \
366    upstream-openbsd/lib/libc/gen/vwarn.c \
367    upstream-openbsd/lib/libc/gen/vwarnx.c \
368    upstream-openbsd/lib/libc/gen/warn.c \
369    upstream-openbsd/lib/libc/gen/warnx.c \
370    upstream-openbsd/lib/libc/locale/btowc.c \
371    upstream-openbsd/lib/libc/locale/mbrlen.c \
372    upstream-openbsd/lib/libc/locale/mbstowcs.c \
373    upstream-openbsd/lib/libc/locale/mbtowc.c \
374    upstream-openbsd/lib/libc/locale/wcscoll.c \
375    upstream-openbsd/lib/libc/locale/wcstod.c \
376    upstream-openbsd/lib/libc/locale/wcstof.c \
377    upstream-openbsd/lib/libc/locale/wcstoimax.c \
378    upstream-openbsd/lib/libc/locale/wcstol.c \
379    upstream-openbsd/lib/libc/locale/wcstold.c \
380    upstream-openbsd/lib/libc/locale/wcstoll.c \
381    upstream-openbsd/lib/libc/locale/wcstombs.c \
382    upstream-openbsd/lib/libc/locale/wcstoul.c \
383    upstream-openbsd/lib/libc/locale/wcstoull.c \
384    upstream-openbsd/lib/libc/locale/wcstoumax.c \
385    upstream-openbsd/lib/libc/locale/wcsxfrm.c \
386    upstream-openbsd/lib/libc/locale/wctob.c \
387    upstream-openbsd/lib/libc/locale/wctomb.c \
388    upstream-openbsd/lib/libc/net/htonl.c \
389    upstream-openbsd/lib/libc/net/htons.c \
390    upstream-openbsd/lib/libc/net/inet_addr.c \
391    upstream-openbsd/lib/libc/net/inet_lnaof.c \
392    upstream-openbsd/lib/libc/net/inet_makeaddr.c \
393    upstream-openbsd/lib/libc/net/inet_netof.c \
394    upstream-openbsd/lib/libc/net/inet_network.c \
395    upstream-openbsd/lib/libc/net/inet_ntoa.c \
396    upstream-openbsd/lib/libc/net/inet_ntop.c \
397    upstream-openbsd/lib/libc/net/inet_pton.c \
398    upstream-openbsd/lib/libc/net/ntohl.c \
399    upstream-openbsd/lib/libc/net/ntohs.c \
400    upstream-openbsd/lib/libc/stdio/asprintf.c \
401    upstream-openbsd/lib/libc/stdio/clrerr.c \
402    upstream-openbsd/lib/libc/stdio/dprintf.c \
403    upstream-openbsd/lib/libc/stdio/fclose.c \
404    upstream-openbsd/lib/libc/stdio/fdopen.c \
405    upstream-openbsd/lib/libc/stdio/feof.c \
406    upstream-openbsd/lib/libc/stdio/ferror.c \
407    upstream-openbsd/lib/libc/stdio/fflush.c \
408    upstream-openbsd/lib/libc/stdio/fgetc.c \
409    upstream-openbsd/lib/libc/stdio/fgetln.c \
410    upstream-openbsd/lib/libc/stdio/fgetpos.c \
411    upstream-openbsd/lib/libc/stdio/fgets.c \
412    upstream-openbsd/lib/libc/stdio/fgetwc.c \
413    upstream-openbsd/lib/libc/stdio/fgetws.c \
414    upstream-openbsd/lib/libc/stdio/fileno.c \
415    upstream-openbsd/lib/libc/stdio/flags.c \
416    upstream-openbsd/lib/libc/stdio/fmemopen.c \
417    upstream-openbsd/lib/libc/stdio/fopen.c \
418    upstream-openbsd/lib/libc/stdio/fprintf.c \
419    upstream-openbsd/lib/libc/stdio/fpurge.c \
420    upstream-openbsd/lib/libc/stdio/fputc.c \
421    upstream-openbsd/lib/libc/stdio/fputs.c \
422    upstream-openbsd/lib/libc/stdio/fputwc.c \
423    upstream-openbsd/lib/libc/stdio/fputws.c \
424    upstream-openbsd/lib/libc/stdio/freopen.c \
425    upstream-openbsd/lib/libc/stdio/fscanf.c \
426    upstream-openbsd/lib/libc/stdio/fseek.c \
427    upstream-openbsd/lib/libc/stdio/fsetpos.c \
428    upstream-openbsd/lib/libc/stdio/ftell.c \
429    upstream-openbsd/lib/libc/stdio/funopen.c \
430    upstream-openbsd/lib/libc/stdio/fvwrite.c \
431    upstream-openbsd/lib/libc/stdio/fwalk.c \
432    upstream-openbsd/lib/libc/stdio/fwide.c \
433    upstream-openbsd/lib/libc/stdio/fwprintf.c \
434    upstream-openbsd/lib/libc/stdio/fwrite.c \
435    upstream-openbsd/lib/libc/stdio/fwscanf.c \
436    upstream-openbsd/lib/libc/stdio/getc.c \
437    upstream-openbsd/lib/libc/stdio/getchar.c \
438    upstream-openbsd/lib/libc/stdio/getdelim.c \
439    upstream-openbsd/lib/libc/stdio/getline.c \
440    upstream-openbsd/lib/libc/stdio/gets.c \
441    upstream-openbsd/lib/libc/stdio/getwc.c \
442    upstream-openbsd/lib/libc/stdio/getwchar.c \
443    upstream-openbsd/lib/libc/stdio/makebuf.c \
444    upstream-openbsd/lib/libc/stdio/mktemp.c \
445    upstream-openbsd/lib/libc/stdio/open_memstream.c \
446    upstream-openbsd/lib/libc/stdio/open_wmemstream.c \
447    upstream-openbsd/lib/libc/stdio/perror.c \
448    upstream-openbsd/lib/libc/stdio/printf.c \
449    upstream-openbsd/lib/libc/stdio/putc.c \
450    upstream-openbsd/lib/libc/stdio/putchar.c \
451    upstream-openbsd/lib/libc/stdio/puts.c \
452    upstream-openbsd/lib/libc/stdio/putwc.c \
453    upstream-openbsd/lib/libc/stdio/putwchar.c \
454    upstream-openbsd/lib/libc/stdio/refill.c \
455    upstream-openbsd/lib/libc/stdio/remove.c \
456    upstream-openbsd/lib/libc/stdio/rewind.c \
457    upstream-openbsd/lib/libc/stdio/rget.c \
458    upstream-openbsd/lib/libc/stdio/scanf.c \
459    upstream-openbsd/lib/libc/stdio/setbuf.c \
460    upstream-openbsd/lib/libc/stdio/setbuffer.c \
461    upstream-openbsd/lib/libc/stdio/setvbuf.c \
462    upstream-openbsd/lib/libc/stdio/sscanf.c \
463    upstream-openbsd/lib/libc/stdio/swprintf.c \
464    upstream-openbsd/lib/libc/stdio/swscanf.c \
465    upstream-openbsd/lib/libc/stdio/tempnam.c \
466    upstream-openbsd/lib/libc/stdio/tmpnam.c \
467    upstream-openbsd/lib/libc/stdio/ungetc.c \
468    upstream-openbsd/lib/libc/stdio/ungetwc.c \
469    upstream-openbsd/lib/libc/stdio/vasprintf.c \
470    upstream-openbsd/lib/libc/stdio/vdprintf.c \
471    upstream-openbsd/lib/libc/stdio/vfprintf.c \
472    upstream-openbsd/lib/libc/stdio/vfscanf.c \
473    upstream-openbsd/lib/libc/stdio/vfwprintf.c \
474    upstream-openbsd/lib/libc/stdio/vfwscanf.c \
475    upstream-openbsd/lib/libc/stdio/vprintf.c \
476    upstream-openbsd/lib/libc/stdio/vscanf.c \
477    upstream-openbsd/lib/libc/stdio/vsnprintf.c \
478    upstream-openbsd/lib/libc/stdio/vsprintf.c \
479    upstream-openbsd/lib/libc/stdio/vsscanf.c \
480    upstream-openbsd/lib/libc/stdio/vswprintf.c \
481    upstream-openbsd/lib/libc/stdio/vswscanf.c \
482    upstream-openbsd/lib/libc/stdio/vwprintf.c \
483    upstream-openbsd/lib/libc/stdio/vwscanf.c \
484    upstream-openbsd/lib/libc/stdio/wbuf.c \
485    upstream-openbsd/lib/libc/stdio/wprintf.c \
486    upstream-openbsd/lib/libc/stdio/wscanf.c \
487    upstream-openbsd/lib/libc/stdio/wsetup.c \
488    upstream-openbsd/lib/libc/stdlib/atoi.c \
489    upstream-openbsd/lib/libc/stdlib/atol.c \
490    upstream-openbsd/lib/libc/stdlib/atoll.c \
491    upstream-openbsd/lib/libc/stdlib/getenv.c \
492    upstream-openbsd/lib/libc/stdlib/insque.c \
493    upstream-openbsd/lib/libc/stdlib/lsearch.c \
494    upstream-openbsd/lib/libc/stdlib/reallocarray.c \
495    upstream-openbsd/lib/libc/stdlib/remque.c \
496    upstream-openbsd/lib/libc/stdlib/setenv.c \
497    upstream-openbsd/lib/libc/stdlib/strtoimax.c \
498    upstream-openbsd/lib/libc/stdlib/strtol.c \
499    upstream-openbsd/lib/libc/stdlib/strtoll.c \
500    upstream-openbsd/lib/libc/stdlib/strtoul.c \
501    upstream-openbsd/lib/libc/stdlib/strtoull.c \
502    upstream-openbsd/lib/libc/stdlib/strtoumax.c \
503    upstream-openbsd/lib/libc/stdlib/system.c \
504    upstream-openbsd/lib/libc/stdlib/tfind.c \
505    upstream-openbsd/lib/libc/stdlib/tsearch.c \
506    upstream-openbsd/lib/libc/string/strcasecmp.c \
507    upstream-openbsd/lib/libc/string/strcspn.c \
508    upstream-openbsd/lib/libc/string/strdup.c \
509    upstream-openbsd/lib/libc/string/strndup.c \
510    upstream-openbsd/lib/libc/string/strpbrk.c \
511    upstream-openbsd/lib/libc/string/strsep.c \
512    upstream-openbsd/lib/libc/string/strspn.c \
513    upstream-openbsd/lib/libc/string/strstr.c \
514    upstream-openbsd/lib/libc/string/strtok.c \
515    upstream-openbsd/lib/libc/string/wmemcpy.c \
516    upstream-openbsd/lib/libc/string/wcslcpy.c \
517    upstream-openbsd/lib/libc/string/wcsstr.c \
518    upstream-openbsd/lib/libc/string/wcswidth.c \
519
520libc_pthread_src_files := \
521    bionic/pthread_atfork.cpp \
522    bionic/pthread_attr.cpp \
523    bionic/pthread_cond.cpp \
524    bionic/pthread_create.cpp \
525    bionic/pthread_detach.cpp \
526    bionic/pthread_equal.cpp \
527    bionic/pthread_exit.cpp \
528    bionic/pthread_getcpuclockid.cpp \
529    bionic/pthread_getschedparam.cpp \
530    bionic/pthread_gettid_np.cpp \
531    bionic/pthread_internal.cpp \
532    bionic/pthread_join.cpp \
533    bionic/pthread_key.cpp \
534    bionic/pthread_kill.cpp \
535    bionic/pthread_mutex.cpp \
536    bionic/pthread_once.cpp \
537    bionic/pthread_rwlock.cpp \
538    bionic/pthread_self.cpp \
539    bionic/pthread_setname_np.cpp \
540    bionic/pthread_setschedparam.cpp \
541    bionic/pthread_sigmask.cpp \
542
543libc_thread_atexit_impl_src_files := \
544    bionic/__cxa_thread_atexit_impl.cpp \
545
546libc_arch_static_src_files := \
547    bionic/dl_iterate_phdr_static.cpp \
548
549# Various kinds of LP32 cruft.
550# ========================================================
551libc_bionic_src_files_32 += \
552    bionic/mmap.cpp \
553
554libc_common_src_files_32 += \
555    bionic/legacy_32_bit_support.cpp \
556    bionic/ndk_cruft.cpp \
557    bionic/time64.c \
558
559libc_netbsd_src_files_32 += \
560    upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
561
562libc_openbsd_src_files_32 += \
563    upstream-openbsd/lib/libc/stdio/putw.c \
564
565
566# Define some common cflags
567# ========================================================
568libc_common_cflags := \
569    -D_LIBC=1 \
570    -Wall -Wextra -Wunused \
571
572ifneq ($(TARGET_USES_LOGD),false)
573libc_common_cflags += -DTARGET_USES_LOGD
574endif
575
576use_clang := $(USE_CLANG_PLATFORM_BUILD)
577ifeq ($(use_clang),)
578  use_clang := false
579endif
580
581# Try to catch typical 32-bit assumptions that break with 64-bit pointers.
582libc_common_cflags += \
583    -Werror=pointer-to-int-cast \
584    -Werror=int-to-pointer-cast \
585    -Werror=type-limits \
586    -Werror \
587
588ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
589  libc_common_cflags += -DDEBUG
590endif
591
592ifeq ($(MALLOC_IMPL),dlmalloc)
593  libc_common_cflags += -DUSE_DLMALLOC
594  libc_malloc_src := bionic/dlmalloc.c
595else
596  libc_common_cflags += -DUSE_JEMALLOC
597  libc_malloc_src := bionic/jemalloc_wrapper.cpp
598  libc_common_c_includes += external/jemalloc/include
599endif
600
601# To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in
602# the appropriate BoardConfig.mk file.
603#
604ifneq ($(BOARD_MALLOC_ALIGNMENT),)
605  libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
606endif
607
608# Define some common conlyflags
609libc_common_conlyflags := \
610    -std=gnu99
611
612# Define some common cppflags
613libc_common_cppflags := \
614    -std=gnu++11
615
616# Define some common includes
617# ========================================================
618libc_common_c_includes += \
619    $(LOCAL_PATH)/stdio   \
620
621# ========================================================
622# Add in the arch or 32-bit specific flags
623# Must be called with $(eval).
624# $(1): the LOCAL_ variable name
625# $(2): the bionic variable name to pull in
626define patch-up-arch-specific-flags
627$(1)_$(TARGET_ARCH) += $($(2)_$(TARGET_ARCH))
628$(1)_32 += $($(2)_32)
629ifdef TARGET_2ND_ARCH
630$(1)_$(TARGET_2ND_ARCH) += $($(2)_$(TARGET_2ND_ARCH))
631endif
632endef
633
634
635# ========================================================
636# libc_stack_protector.a - stack protector code
637# ========================================================
638#
639# The stack protector code needs to be compiled
640# with -fno-stack-protector, since it modifies the
641# stack canary.
642
643include $(CLEAR_VARS)
644
645LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp
646LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector
647LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
648LOCAL_CPPFLAGS := $(libc_common_cppflags)
649LOCAL_C_INCLUDES := $(libc_common_c_includes)
650LOCAL_MODULE := libc_stack_protector
651LOCAL_CLANG := $(use_clang)
652LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
653LOCAL_CXX_STL := none
654LOCAL_SYSTEM_SHARED_LIBRARIES :=
655LOCAL_ADDRESS_SANITIZER := false
656LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
657
658$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
659include $(BUILD_STATIC_LIBRARY)
660
661
662# ========================================================
663# libc_tzcode.a - upstream 'tzcode' code
664# ========================================================
665
666include $(CLEAR_VARS)
667
668LOCAL_SRC_FILES := $(call all-c-files-under,tzcode)
669# tzcode doesn't include wcsftime, so we use the OpenBSD one.
670LOCAL_SRC_FILES += upstream-openbsd/lib/libc/time/wcsftime.c
671
672LOCAL_CFLAGS := $(libc_common_cflags) \
673    -fvisibility=hidden \
674
675# Don't use ridiculous amounts of stack.
676LOCAL_CFLAGS += -DALL_STATE
677# Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
678LOCAL_CFLAGS += -DSTD_INSPIRED
679# The name of the tm_gmtoff field in our struct tm.
680LOCAL_CFLAGS += -DTM_GMTOFF=tm_gmtoff
681# Where we store our tzdata.
682LOCAL_CFLAGS += -DTZDIR=\"/system/usr/share/zoneinfo\"
683# Include timezone and daylight globals.
684LOCAL_CFLAGS += -DUSG_COMPAT=1
685LOCAL_CFLAGS += -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU
686LOCAL_CFLAGS += -Dlint
687
688LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
689LOCAL_CPPFLAGS := $(libc_common_cppflags)
690LOCAL_C_INCLUDES := $(libc_common_c_includes) $(LOCAL_PATH)/tzcode/
691LOCAL_MODULE := libc_tzcode
692LOCAL_CLANG := $(use_clang)
693LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
694LOCAL_CXX_STL := none
695LOCAL_SYSTEM_SHARED_LIBRARIES :=
696LOCAL_ADDRESS_SANITIZER := false
697LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
698
699$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
700include $(BUILD_STATIC_LIBRARY)
701
702
703# ========================================================
704# libc_dns.a - modified NetBSD DNS code
705# ========================================================
706
707include $(CLEAR_VARS)
708
709LOCAL_SRC_FILES := \
710    $(call all-c-files-under,dns) \
711    upstream-netbsd/lib/libc/isc/ev_streams.c \
712    upstream-netbsd/lib/libc/isc/ev_timers.c \
713    upstream-netbsd/lib/libc/resolv/mtctxres.c \
714
715# We use the OpenBSD res_random.
716LOCAL_CFLAGS += \
717    -Dres_randomid=__res_randomid
718LOCAL_SRC_FILES += \
719    upstream-openbsd/lib/libc/net/res_random.c \
720
721LOCAL_CFLAGS += \
722    $(libc_common_cflags) \
723    -DANDROID_CHANGES \
724    -DINET6 \
725    -fvisibility=hidden \
726    -Wno-unused-parameter \
727    -include netbsd-compat.h \
728
729LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
730LOCAL_CPPFLAGS := $(libc_common_cppflags)
731LOCAL_C_INCLUDES := $(libc_common_c_includes) \
732    $(LOCAL_PATH)/dns/include \
733    $(LOCAL_PATH)/private \
734    $(LOCAL_PATH)/upstream-netbsd/lib/libc/include \
735    $(LOCAL_PATH)/upstream-netbsd/android/include \
736
737LOCAL_MODULE := libc_dns
738LOCAL_CLANG := $(use_clang)
739LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
740LOCAL_CXX_STL := none
741LOCAL_SYSTEM_SHARED_LIBRARIES :=
742LOCAL_ADDRESS_SANITIZER := false
743LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
744
745$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
746include $(BUILD_STATIC_LIBRARY)
747
748
749# ========================================================
750# libc_freebsd.a - upstream FreeBSD C library code
751# ========================================================
752#
753# These files are built with the freebsd-compat.h header file
754# automatically included.
755
756include $(CLEAR_VARS)
757
758LOCAL_SRC_FILES := $(libc_upstream_freebsd_src_files)
759LOCAL_CFLAGS := \
760    $(libc_common_cflags) \
761    -Wno-sign-compare -Wno-uninitialized \
762    -include freebsd-compat.h \
763
764LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
765LOCAL_CPPFLAGS := $(libc_common_cppflags)
766LOCAL_C_INCLUDES := $(libc_common_c_includes) \
767    $(LOCAL_PATH)/upstream-freebsd/android/include \
768    $(LOCAL_PATH)/upstream-freebsd/lib/libc/include \
769
770LOCAL_MODULE := libc_freebsd
771LOCAL_CLANG := $(use_clang)
772LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
773LOCAL_CXX_STL := none
774LOCAL_SYSTEM_SHARED_LIBRARIES :=
775LOCAL_ADDRESS_SANITIZER := false
776LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
777
778$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
779$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_freebsd_src_files))
780include $(BUILD_STATIC_LIBRARY)
781
782
783# ========================================================
784# libc_netbsd.a - upstream NetBSD C library code
785# ========================================================
786#
787# These files are built with the netbsd-compat.h header file
788# automatically included.
789
790include $(CLEAR_VARS)
791
792LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files)
793LOCAL_CFLAGS := \
794    $(libc_common_cflags) \
795    -Wno-sign-compare -Wno-uninitialized \
796    -DPOSIX_MISTAKE \
797    -include netbsd-compat.h \
798
799LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
800LOCAL_CPPFLAGS := $(libc_common_cppflags)
801LOCAL_C_INCLUDES := $(libc_common_c_includes) \
802    $(LOCAL_PATH)/upstream-netbsd/android/include \
803    $(LOCAL_PATH)/upstream-netbsd/lib/libc/include \
804
805LOCAL_MODULE := libc_netbsd
806LOCAL_CLANG := $(use_clang)
807LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
808LOCAL_CXX_STL := none
809LOCAL_SYSTEM_SHARED_LIBRARIES :=
810LOCAL_ADDRESS_SANITIZER := false
811LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
812
813$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
814$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_netbsd_src_files))
815include $(BUILD_STATIC_LIBRARY)
816
817
818# ========================================================
819# libc_openbsd_ndk.a - upstream OpenBSD C library code
820# that can be safely included in the libc_ndk.a (doesn't
821# contain any troublesome global data or constructors).
822# ========================================================
823#
824# These files are built with the openbsd-compat.h header file
825# automatically included.
826
827include $(CLEAR_VARS)
828
829LOCAL_SRC_FILES := $(libc_upstream_openbsd_ndk_src_files)
830LOCAL_CLANG := $(use_clang)
831
832LOCAL_CFLAGS := \
833    $(libc_common_cflags) \
834    -Wno-sign-compare \
835    -Wno-uninitialized \
836    -Wno-unused-parameter \
837    -include openbsd-compat.h \
838
839LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
840LOCAL_CPPFLAGS := $(libc_common_cppflags)
841LOCAL_C_INCLUDES := $(libc_common_c_includes) \
842    $(LOCAL_PATH)/private \
843    $(LOCAL_PATH)/upstream-openbsd/android/include \
844    $(LOCAL_PATH)/upstream-openbsd/lib/libc/include \
845    $(LOCAL_PATH)/upstream-openbsd/lib/libc/gdtoa/ \
846
847LOCAL_MODULE := libc_openbsd_ndk
848LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
849LOCAL_CXX_STL := none
850LOCAL_SYSTEM_SHARED_LIBRARIES :=
851LOCAL_ADDRESS_SANITIZER := false
852LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
853
854$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
855include $(BUILD_STATIC_LIBRARY)
856
857
858# ========================================================
859# libc_openbsd.a - upstream OpenBSD C library code
860# ========================================================
861#
862# These files are built with the openbsd-compat.h header file
863# automatically included.
864
865include $(CLEAR_VARS)
866
867LOCAL_SRC_FILES := $(libc_upstream_openbsd_src_files)
868LOCAL_CLANG := $(use_clang)
869
870LOCAL_CFLAGS := \
871    $(libc_common_cflags) \
872    -Wno-sign-compare \
873    -Wno-uninitialized \
874    -Wno-unused-parameter \
875    -include openbsd-compat.h \
876
877LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
878LOCAL_CPPFLAGS := $(libc_common_cppflags)
879LOCAL_C_INCLUDES := $(libc_common_c_includes) \
880    $(LOCAL_PATH)/private \
881    $(LOCAL_PATH)/upstream-openbsd/android/include \
882    $(LOCAL_PATH)/upstream-openbsd/lib/libc/include \
883    $(LOCAL_PATH)/upstream-openbsd/lib/libc/gdtoa/ \
884
885LOCAL_MODULE := libc_openbsd
886LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
887LOCAL_CXX_STL := none
888LOCAL_SYSTEM_SHARED_LIBRARIES :=
889LOCAL_ADDRESS_SANITIZER := false
890LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
891
892$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
893$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_openbsd_src_files))
894include $(BUILD_STATIC_LIBRARY)
895
896
897# ========================================================
898# libc_gdtoa.a - upstream OpenBSD C library gdtoa code
899# ========================================================
900#
901# These files are built with the openbsd-compat.h header file
902# automatically included.
903
904include $(CLEAR_VARS)
905
906LOCAL_SRC_FILES_32 := $(libc_upstream_openbsd_gdtoa_src_files_32)
907LOCAL_SRC_FILES_64 := $(libc_upstream_openbsd_gdtoa_src_files_64)
908LOCAL_CLANG := $(use_clang)
909
910LOCAL_CFLAGS := \
911    $(libc_common_cflags) \
912    -Wno-sign-compare -Wno-uninitialized \
913    -fvisibility=hidden \
914    -include openbsd-compat.h \
915
916LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
917LOCAL_CPPFLAGS := $(libc_common_cppflags)
918LOCAL_C_INCLUDES := $(libc_common_c_includes) \
919    $(LOCAL_PATH)/private \
920    $(LOCAL_PATH)/upstream-openbsd/android/include \
921    $(LOCAL_PATH)/upstream-openbsd/lib/libc/include \
922
923LOCAL_MODULE := libc_gdtoa
924LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
925LOCAL_CXX_STL := none
926LOCAL_SYSTEM_SHARED_LIBRARIES :=
927LOCAL_ADDRESS_SANITIZER := false
928LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
929
930$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
931include $(BUILD_STATIC_LIBRARY)
932
933
934# ========================================================
935# libc_bionic.a - home-grown C library code
936# ========================================================
937
938include $(CLEAR_VARS)
939
940LOCAL_SRC_FILES := $(libc_bionic_src_files)
941LOCAL_CFLAGS := $(libc_common_cflags) \
942    -Wframe-larger-than=2048 \
943
944# ssse3-strcmp-slm.S does not compile with Clang.
945LOCAL_CLANG_ASFLAGS_x86_64 += -no-integrated-as
946
947# memcpy.S, memchr.S, etc. do not compile with Clang.
948LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
949LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as
950
951LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
952LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast
953LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
954LOCAL_MODULE := libc_bionic
955LOCAL_CLANG := $(use_clang)
956LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
957LOCAL_CXX_STL := none
958LOCAL_SYSTEM_SHARED_LIBRARIES :=
959LOCAL_ADDRESS_SANITIZER := false
960LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
961
962$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
963include $(BUILD_STATIC_LIBRARY)
964
965
966# ========================================================
967# libc_bionic_ndk.a - The portions of libc_bionic that can
968# be safely used in libc_ndk.a (no troublesome global data
969# or constructors).
970# ========================================================
971
972include $(CLEAR_VARS)
973
974LOCAL_SRC_FILES := $(libc_bionic_ndk_src_files)
975LOCAL_CFLAGS := $(libc_common_cflags) \
976    -Wframe-larger-than=2048 \
977
978# ssse3-strcmp-slm.S does not compile with Clang.
979LOCAL_CLANG_ASFLAGS_x86_64 += -no-integrated-as
980
981# memcpy.S, memchr.S, etc. do not compile with Clang.
982LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
983LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as
984
985LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
986LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast
987LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
988LOCAL_MODULE := libc_bionic_ndk
989LOCAL_CLANG := $(use_clang)
990LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
991LOCAL_CXX_STL := none
992LOCAL_SYSTEM_SHARED_LIBRARIES :=
993LOCAL_ADDRESS_SANITIZER := false
994LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
995
996$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
997$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_src_files))
998include $(BUILD_STATIC_LIBRARY)
999
1000include $(CLEAR_VARS)
1001LOCAL_SRC_FILES := $(libc_thread_atexit_impl_src_files)
1002LOCAL_CFLAGS := $(libc_common_cflags) -Wframe-larger-than=2048
1003
1004LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1005LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast
1006LOCAL_C_INCLUDES := $(libc_common_c_includes)
1007LOCAL_MODULE := libc_thread_atexit_impl
1008# TODO: Clang tries to use __tls_get_addr which is not supported yet
1009# remove after it is implemented.
1010LOCAL_CLANG := false
1011LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1012LOCAL_CXX_STL := none
1013LOCAL_SYSTEM_SHARED_LIBRARIES :=
1014LOCAL_ADDRESS_SANITIZER := false
1015LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1016
1017include $(BUILD_STATIC_LIBRARY)
1018
1019# ========================================================
1020# libc_pthread.a - pthreads parts that previously lived in
1021# libc_bionic.a. Relocated to their own library because
1022# they can't be included in libc_ndk.a (as they layout of
1023# pthread_t has changed over the years and has ABI
1024# compatibility issues).
1025# ========================================================
1026
1027include $(CLEAR_VARS)
1028
1029LOCAL_SRC_FILES := $(libc_pthread_src_files)
1030LOCAL_CFLAGS := $(libc_common_cflags) \
1031    -Wframe-larger-than=2048 \
1032
1033# ssse3-strcmp-slm.S does not compile with Clang.
1034LOCAL_CLANG_ASFLAGS_x86_64 += -no-integrated-as
1035
1036# memcpy.S, memchr.S, etc. do not compile with Clang.
1037LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
1038LOCAL_CLANG_ASFLAGS_arm64 += -no-integrated-as
1039
1040LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1041LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast
1042LOCAL_C_INCLUDES := $(libc_common_c_includes)
1043LOCAL_MODULE := libc_pthread
1044LOCAL_CLANG := $(use_clang)
1045LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1046LOCAL_CXX_STL := none
1047LOCAL_SYSTEM_SHARED_LIBRARIES :=
1048LOCAL_ADDRESS_SANITIZER := false
1049LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1050
1051include $(BUILD_STATIC_LIBRARY)
1052
1053
1054# ========================================================
1055# libc_cxa.a - Things traditionally in libstdc++
1056# ========================================================
1057
1058include $(CLEAR_VARS)
1059
1060LOCAL_SRC_FILES := $(libc_cxa_src_files)
1061LOCAL_CFLAGS := $(libc_common_cflags) \
1062    -fvisibility=hidden \
1063
1064LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1065LOCAL_CPPFLAGS := $(libc_common_cppflags)
1066LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
1067LOCAL_MODULE := libc_cxa
1068LOCAL_CLANG := true # GCC refuses to hide new/delete
1069LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1070LOCAL_CXX_STL := none
1071LOCAL_SYSTEM_SHARED_LIBRARIES :=
1072LOCAL_ADDRESS_SANITIZER := false
1073# b/17574078: Need to disable coverage until we have a prebuilt libprofile_rt.
1074# Since this is a static library built with clang, it needs to link
1075# libprofile_rt when it is linked into the final binary. Since the final binary
1076# is built with GCC, it won't link libprofile_rt. We can't very easily just add
1077# libprofile_rt to all link lines the way we've done for libgcov because
1078# libprofile_rt isn't prebuilt, and it would be tricky to write a rule that
1079# would make sure libprofile_rt is built.
1080LOCAL_NATIVE_COVERAGE := false
1081
1082include $(BUILD_STATIC_LIBRARY)
1083
1084
1085# ========================================================
1086# libc_syscalls.a
1087# ========================================================
1088
1089include $(CLEAR_VARS)
1090
1091LOCAL_SRC_FILES_$(TARGET_ARCH) := $(call all-S-files-under,arch-$(TARGET_ARCH)/syscalls)
1092ifdef TARGET_2ND_ARCH
1093LOCAL_SRC_FILES_$(TARGET_2ND_ARCH) := $(call all-S-files-under,arch-$(TARGET_2ND_ARCH)/syscalls)
1094endif
1095LOCAL_MODULE := libc_syscalls
1096LOCAL_CLANG := $(use_clang)
1097LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1098LOCAL_CXX_STL := none
1099LOCAL_SYSTEM_SHARED_LIBRARIES :=
1100LOCAL_ADDRESS_SANITIZER := false
1101LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1102
1103include $(BUILD_STATIC_LIBRARY)
1104
1105
1106# ========================================================
1107# libc_aeabi.a
1108# This is an LP32 ARM-only library that needs to be built with -fno-builtin
1109# to avoid infinite recursion. For the other architectures we just build an
1110# empty library to keep this makefile simple.
1111# ========================================================
1112
1113include $(CLEAR_VARS)
1114
1115LOCAL_SRC_FILES_arm := arch-arm/bionic/__aeabi.c
1116LOCAL_MODULE := libc_aeabi
1117LOCAL_CLANG := $(use_clang)
1118LOCAL_CFLAGS := $(libc_common_cflags) -fno-builtin
1119LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1120LOCAL_CXX_STL := none
1121LOCAL_SYSTEM_SHARED_LIBRARIES :=
1122LOCAL_ADDRESS_SANITIZER := false
1123LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1124
1125include $(BUILD_STATIC_LIBRARY)
1126
1127# ========================================================
1128# libc_ndk.a
1129# Compatibility library for the NDK. This library contains
1130# all the parts of libc that are safe to statically link.
1131# We can't safely statically link things that can only run
1132# on a certain version of the OS. Examples include
1133# anything that talks to netd (a large portion of the DNS
1134# code) and anything that is dependent on the layout of a
1135# data structure that has changed across releases (such as
1136# pthread_t).
1137# ========================================================
1138
1139include $(CLEAR_VARS)
1140
1141LOCAL_MODULE := libc_ndk
1142LOCAL_CLANG := $(use_clang)
1143LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
1144LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1145LOCAL_CFLAGS := $(libc_common_cflags) -fvisibility=hidden -O0
1146LOCAL_CPPFLAGS := $(libc_common_cppflags)
1147LOCAL_C_INCLUDES := $(libc_common_c_includes)
1148LOCAL_ADDRESS_SANITIZER := false
1149LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1150LOCAL_SYSTEM_SHARED_LIBRARIES :=
1151
1152LOCAL_SRC_FILES := \
1153    $(libc_common_src_files) \
1154    $(libc_arch_dynamic_src_files) \
1155    $(libc_ndk_stub_src_files) \
1156    bionic/malloc_debug_common.cpp \
1157
1158LOCAL_SRC_FILES_arm += \
1159    arch-common/bionic/crtbegin_so.c \
1160    arch-arm/bionic/atexit_legacy.c \
1161    arch-common/bionic/crtend_so.S \
1162
1163LOCAL_CFLAGS := $(libc_common_cflags) \
1164    -DLIBC_STATIC \
1165
1166LOCAL_WHOLE_STATIC_LIBRARIES := \
1167    libc_bionic_ndk \
1168    libc_cxa \
1169    libc_freebsd \
1170    libc_gdtoa \
1171    libc_malloc \
1172    libc_netbsd \
1173    libc_openbsd_ndk \
1174    libc_stack_protector \
1175    libc_syscalls \
1176    libc_tzcode \
1177    libm \
1178
1179LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi
1180LOCAL_CXX_STL := none
1181
1182ifneq ($(MALLOC_IMPL),dlmalloc)
1183LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
1184endif
1185
1186$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
1187$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_common_src_files))
1188$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_dynamic_src_files))
1189$(eval $(call patch-up-arch-specific-flags,LOCAL_ASFLAGS,LOCAL_CFLAGS))
1190
1191LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1192include $(BUILD_STATIC_LIBRARY)
1193
1194# ========================================================
1195# libc_common.a
1196# ========================================================
1197
1198include $(CLEAR_VARS)
1199
1200LOCAL_SRC_FILES := $(libc_common_src_files)
1201LOCAL_CFLAGS := $(libc_common_cflags)
1202LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1203LOCAL_CPPFLAGS := $(libc_common_cppflags)
1204LOCAL_C_INCLUDES := $(libc_common_c_includes)
1205LOCAL_MODULE := libc_common
1206LOCAL_CLANG := $(use_clang)
1207LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1208LOCAL_WHOLE_STATIC_LIBRARIES := \
1209    libc_bionic \
1210    libc_bionic_ndk \
1211    libc_cxa \
1212    libc_dns \
1213    libc_freebsd \
1214    libc_gdtoa \
1215    libc_malloc \
1216    libc_netbsd \
1217    libc_openbsd \
1218    libc_openbsd_ndk \
1219    libc_pthread \
1220    libc_stack_protector \
1221    libc_syscalls \
1222    libc_thread_atexit_impl \
1223    libc_tzcode \
1224
1225LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi
1226
1227LOCAL_CXX_STL := none
1228LOCAL_SYSTEM_SHARED_LIBRARIES :=
1229
1230# TODO: split out the asflags.
1231LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
1232LOCAL_ADDRESS_SANITIZER := false
1233LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1234
1235$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
1236$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_common_src_files))
1237$(eval $(call patch-up-arch-specific-flags,LOCAL_ASFLAGS,LOCAL_CFLAGS))
1238include $(BUILD_STATIC_LIBRARY)
1239
1240
1241# ========================================================
1242# libc_nomalloc.a
1243# ========================================================
1244#
1245# This is a version of the static C library that does not
1246# include malloc. It's useful in situations when the user wants
1247# to provide their own malloc implementation, or wants to
1248# explicitly disallow the use of malloc, such as in the
1249# dynamic linker.
1250
1251include $(CLEAR_VARS)
1252
1253LOCAL_SRC_FILES := \
1254    $(libc_arch_static_src_files) \
1255    bionic/libc_init_static.cpp
1256
1257LOCAL_C_INCLUDES := $(libc_common_c_includes)
1258LOCAL_CFLAGS := $(libc_common_cflags) \
1259    -DLIBC_STATIC \
1260
1261LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1262LOCAL_CPPFLAGS := $(libc_common_cppflags)
1263
1264LOCAL_MODULE := libc_nomalloc
1265LOCAL_CLANG := $(use_clang)
1266LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1267LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1268LOCAL_CXX_STL := none
1269LOCAL_SYSTEM_SHARED_LIBRARIES :=
1270LOCAL_ADDRESS_SANITIZER := false
1271LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1272
1273$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
1274$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_static_src_files))
1275include $(BUILD_STATIC_LIBRARY)
1276
1277
1278# ========================================================
1279# libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1280# ========================================================
1281
1282include $(CLEAR_VARS)
1283LOCAL_SRC_FILES := $(libc_malloc_src)
1284LOCAL_CFLAGS := $(libc_common_cflags) \
1285    -fvisibility=hidden \
1286
1287LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1288LOCAL_CPPFLAGS := $(libc_common_cppflags)
1289LOCAL_C_INCLUDES := $(libc_common_c_includes)
1290LOCAL_MODULE := libc_malloc
1291LOCAL_CLANG := $(use_clang)
1292LOCAL_CXX_STL := none
1293LOCAL_ADDRESS_SANITIZER := false
1294LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1295LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1296include $(BUILD_STATIC_LIBRARY)
1297
1298
1299# ========================================================
1300# libc.a
1301# ========================================================
1302include $(CLEAR_VARS)
1303
1304LOCAL_SRC_FILES := \
1305    $(libc_arch_static_src_files) \
1306    bionic/malloc_debug_common.cpp \
1307    bionic/libc_init_static.cpp \
1308
1309LOCAL_CFLAGS := $(libc_common_cflags) \
1310    -DLIBC_STATIC \
1311
1312LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1313LOCAL_CPPFLAGS := $(libc_common_cppflags)
1314LOCAL_C_INCLUDES := $(libc_common_c_includes)
1315LOCAL_MODULE := libc
1316LOCAL_CLANG := $(use_clang)
1317LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
1318LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1319
1320ifneq ($(MALLOC_IMPL),dlmalloc)
1321LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
1322endif
1323
1324LOCAL_CXX_STL := none
1325LOCAL_SYSTEM_SHARED_LIBRARIES :=
1326LOCAL_ADDRESS_SANITIZER := false
1327LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1328
1329$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
1330$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_static_src_files))
1331include $(BUILD_STATIC_LIBRARY)
1332
1333
1334# ========================================================
1335# libc.so
1336# ========================================================
1337include $(CLEAR_VARS)
1338
1339LOCAL_CFLAGS := $(libc_common_cflags)
1340LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1341LOCAL_CPPFLAGS := $(libc_common_cppflags)
1342
1343LOCAL_C_INCLUDES := $(libc_common_c_includes)
1344LOCAL_SRC_FILES := \
1345    arch-common/bionic/crtbegin_so.c \
1346    arch-common/bionic/crtbrand.S \
1347    $(libc_arch_dynamic_src_files) \
1348    bionic/malloc_debug_common.cpp \
1349    bionic/libc_init_dynamic.cpp \
1350    bionic/NetdClient.cpp \
1351    arch-common/bionic/crtend_so.S \
1352
1353LOCAL_MODULE := libc
1354LOCAL_CLANG := $(use_clang)
1355LOCAL_REQUIRED_MODULES := tzdata
1356LOCAL_ADDITIONAL_DEPENDENCIES := \
1357    $(libc_common_additional_dependencies) \
1358    $(LOCAL_PATH)/version_script.txt \
1359
1360# Leave the symbols in the shared library so that stack unwinders can produce
1361# meaningful name resolution.
1362LOCAL_STRIP_MODULE := keep_symbols
1363
1364# Do not pack libc.so relocations; see http://b/20645321 for details.
1365LOCAL_PACK_MODULE_RELOCATIONS := false
1366
1367# WARNING: The only library libc.so should depend on is libdl.so!  If you add other libraries,
1368# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries.  This
1369# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
1370# external; if that were the case, then libc would not pull those symbols from libgcc.a as it
1371# should, instead relying on the external symbols from the dependent libraries.  That would
1372# create a "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
1373# you wanted!
1374
1375LOCAL_SHARED_LIBRARIES := libdl
1376LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1377
1378ifneq ($(MALLOC_IMPL),dlmalloc)
1379LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
1380endif
1381
1382LOCAL_CXX_STL := none
1383LOCAL_SYSTEM_SHARED_LIBRARIES :=
1384
1385# Don't re-export new/delete and friends, even if the compiler really wants to.
1386LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt
1387
1388# We'd really like to do this for all architectures, but since this wasn't done
1389# before, these symbols must continue to be exported on LP32 for binary
1390# compatibility.
1391LOCAL_LDFLAGS_64 := -Wl,--exclude-libs,libgcc.a
1392
1393# TODO: This is to work around b/19059885. Remove after root cause is fixed
1394LOCAL_LDFLAGS_arm := -Wl,--hash-style=sysv
1395
1396$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
1397$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_dynamic_src_files))
1398
1399LOCAL_NO_CRT := true
1400LOCAL_ASFLAGS += $(libc_crt_target_cflags)
1401
1402# special for arm
1403LOCAL_CFLAGS_arm += -DCRT_LEGACY_WORKAROUND
1404LOCAL_SRC_FILES_arm += \
1405    arch-arm/bionic/atexit_legacy.c
1406
1407LOCAL_ADDRESS_SANITIZER := false
1408LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1409
1410include $(BUILD_SHARED_LIBRARY)
1411
1412
1413# For all builds, except for the -user build we will enable memory
1414# allocation checking (including memory leaks, buffer overwrites, etc.)
1415# Note that all these checks are also controlled by env. settings
1416# that can enable, or disable specific checks. Note also that some of
1417# the checks are available only in emulator and are implemeted in
1418# libc_malloc_qemu_instrumented.so.
1419ifneq ($(TARGET_BUILD_VARIANT),user)
1420
1421# ========================================================
1422# libc_malloc_debug_leak.so
1423# ========================================================
1424include $(CLEAR_VARS)
1425
1426LOCAL_CFLAGS := $(libc_common_cflags)
1427LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1428LOCAL_CPPFLAGS := $(libc_common_cppflags)
1429
1430# Make sure that unwind.h comes from libunwind.
1431LOCAL_C_INCLUDES := \
1432    $(libc_common_c_includes) \
1433
1434LOCAL_SRC_FILES := \
1435    bionic/debug_mapinfo.cpp \
1436    bionic/debug_stacktrace.cpp \
1437    bionic/libc_logging.cpp \
1438    bionic/malloc_debug_leak.cpp \
1439    bionic/malloc_debug_check.cpp \
1440
1441LOCAL_MODULE := libc_malloc_debug_leak
1442LOCAL_CLANG := $(use_clang)
1443LOCAL_ADDITIONAL_DEPENDENCIES := \
1444    $(libc_common_additional_dependencies) \
1445    $(LOCAL_PATH)/version_script.txt \
1446
1447LOCAL_SHARED_LIBRARIES := libc libdl
1448LOCAL_CXX_STL := none
1449LOCAL_SYSTEM_SHARED_LIBRARIES :=
1450# Only need this for arm since libc++ uses its own unwind code that
1451# doesn't mix with the other default unwind code.
1452LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
1453LOCAL_STATIC_LIBRARIES += libc++abi
1454LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
1455
1456# Don't re-export new/delete and friends, even if the compiler really wants to.
1457LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt
1458
1459# Don't install on release build
1460LOCAL_MODULE_TAGS := eng debug
1461LOCAL_ADDRESS_SANITIZER := false
1462LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1463
1464$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
1465include $(BUILD_SHARED_LIBRARY)
1466
1467
1468# ========================================================
1469# libc_malloc_debug_qemu.so
1470# ========================================================
1471include $(CLEAR_VARS)
1472
1473LOCAL_CFLAGS := \
1474    $(libc_common_cflags) \
1475    -DMALLOC_QEMU_INSTRUMENT \
1476
1477LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1478LOCAL_CPPFLAGS := $(libc_common_cppflags)
1479
1480LOCAL_C_INCLUDES := $(libc_common_c_includes)
1481
1482LOCAL_SRC_FILES := \
1483    bionic/libc_logging.cpp \
1484    bionic/malloc_debug_qemu.cpp \
1485
1486LOCAL_MODULE := libc_malloc_debug_qemu
1487LOCAL_CLANG := $(use_clang)
1488LOCAL_ADDITIONAL_DEPENDENCIES := \
1489    $(libc_common_additional_dependencies) \
1490    $(LOCAL_PATH)/version_script.txt \
1491
1492LOCAL_SHARED_LIBRARIES := libc libdl
1493LOCAL_CXX_STL := none
1494LOCAL_SYSTEM_SHARED_LIBRARIES :=
1495
1496# Don't re-export new/delete and friends, even if the compiler really wants to.
1497LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt
1498
1499# Don't install on release build
1500LOCAL_MODULE_TAGS := eng debug
1501LOCAL_ADDRESS_SANITIZER := false
1502LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1503
1504$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
1505include $(BUILD_SHARED_LIBRARY)
1506
1507endif  #!user
1508
1509# ========================================================
1510# libstdc++.so
1511# ========================================================
1512libstdcxx_common_src_files := \
1513    bionic/__cxa_guard.cpp \
1514    bionic/__cxa_pure_virtual.cpp \
1515    bionic/new.cpp \
1516    bionic/libc_logging.cpp \
1517
1518include $(CLEAR_VARS)
1519LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
1520LOCAL_CFLAGS := $(libc_common_cflags)
1521LOCAL_CPPFLAGS := $(libc_common_cppflags)
1522
1523# TODO: This is to work around b/19059885. Remove after root cause is fixed
1524LOCAL_LDFLAGS_arm := -Wl,--hash-style=sysv
1525
1526LOCAL_SRC_FILES := $(libstdcxx_common_src_files)
1527LOCAL_MODULE:= libstdc++
1528LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
1529LOCAL_CXX_STL := none
1530LOCAL_SYSTEM_SHARED_LIBRARIES := libc
1531LOCAL_ADDRESS_SANITIZER := false
1532LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1533include $(BUILD_SHARED_LIBRARY)
1534
1535# ========================================================
1536# libstdc++.a
1537# ========================================================
1538include $(CLEAR_VARS)
1539LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
1540LOCAL_CFLAGS := $(libc_common_cflags)
1541LOCAL_CPPFLAGS := $(libc_common_cppflags)
1542LOCAL_SRC_FILES := $(libstdcxx_common_src_files)
1543LOCAL_MODULE:= libstdc++
1544LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
1545LOCAL_CXX_STL := none
1546LOCAL_SYSTEM_SHARED_LIBRARIES := libc
1547LOCAL_ADDRESS_SANITIZER := false
1548LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
1549include $(BUILD_STATIC_LIBRARY)
1550
1551
1552# ========================================================
1553include $(call all-makefiles-under,$(LOCAL_PATH))
1554